Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

663 lines
16 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. MScopePP.cpp
  7. This file contains all of the implementation for the
  8. scope property page.
  9. FILE HISTORY:
  10. */
  11. #include "stdafx.h"
  12. #include "nodes.h"
  13. #include "mscopepp.h"
  14. #include "mscope.h"
  15. #include "server.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. //
  23. // CMScopeProperties holder
  24. //
  25. /////////////////////////////////////////////////////////////////////////////
  26. CMScopeProperties::CMScopeProperties
  27. (
  28. ITFSNode * pNode,
  29. IComponentData * pComponentData,
  30. ITFSComponentData * pTFSCompData,
  31. LPCTSTR pszSheetName
  32. ) : CPropertyPageHolderBase(pNode, pComponentData, pszSheetName)
  33. {
  34. //ASSERT(pFolderNode == GetContainerNode());
  35. m_bAutoDeletePages = FALSE; // we have the pages as embedded members
  36. m_liVersion.QuadPart = 0;
  37. AddPageToList((CPropertyPageBase*) &m_pageGeneral);
  38. AddPageToList((CPropertyPageBase*) &m_pageLifetime);
  39. Assert(pTFSCompData != NULL);
  40. m_spTFSCompData.Set(pTFSCompData);
  41. }
  42. CMScopeProperties::~CMScopeProperties()
  43. {
  44. RemovePageFromList((CPropertyPageBase*) &m_pageGeneral, FALSE);
  45. RemovePageFromList((CPropertyPageBase*) &m_pageLifetime, FALSE);
  46. }
  47. void
  48. CMScopeProperties::SetVersion
  49. (
  50. LARGE_INTEGER & liVersion
  51. )
  52. {
  53. m_liVersion = liVersion;
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CScopePropGeneral property page
  57. IMPLEMENT_DYNCREATE(CMScopePropGeneral, CPropertyPageBase)
  58. CMScopePropGeneral::CMScopePropGeneral() : CPropertyPageBase(CMScopePropGeneral::IDD)
  59. {
  60. //{{AFX_DATA_INIT(CMScopePropGeneral)
  61. m_strComment = _T("");
  62. m_strName = _T("");
  63. //}}AFX_DATA_INIT
  64. m_bUpdateInfo = FALSE;
  65. m_bUpdateLease = FALSE;
  66. m_bUpdateRange = FALSE;
  67. m_bUpdateTTL = FALSE;
  68. m_uImage = 0;
  69. }
  70. CMScopePropGeneral::~CMScopePropGeneral()
  71. {
  72. }
  73. void CMScopePropGeneral::DoDataExchange(CDataExchange* pDX)
  74. {
  75. CPropertyPageBase::DoDataExchange(pDX);
  76. //{{AFX_DATA_MAP(CMScopePropGeneral)
  77. DDX_Control(pDX, IDC_EDIT_SCOPE_NAME, m_editName);
  78. DDX_Control(pDX, IDC_EDIT_SCOPE_COMMENT, m_editComment);
  79. DDX_Control(pDX, IDC_EDIT_TTL, m_editTTL);
  80. DDX_Control(pDX, IDC_RADIO_LEASE_UNLIMITED, m_radioUnlimited);
  81. DDX_Control(pDX, IDC_RADIO_LEASE_LIMITED, m_radioLimited);
  82. DDX_Control(pDX, IDC_EDIT_LEASE_MINUTES, m_editMinutes);
  83. DDX_Control(pDX, IDC_EDIT_LEASE_HOURS, m_editHours);
  84. DDX_Control(pDX, IDC_EDIT_LEASE_DAYS, m_editDays);
  85. DDX_Control(pDX, IDC_SPIN_TTL, m_spinTTL);
  86. DDX_Control(pDX, IDC_SPIN_LEASE_HOURS, m_spinHours);
  87. DDX_Control(pDX, IDC_SPIN_LEASE_MINUTES, m_spinMinutes);
  88. DDX_Control(pDX, IDC_SPIN_LEASE_DAYS, m_spinDays);
  89. DDX_Text(pDX, IDC_EDIT_SCOPE_COMMENT, m_strComment);
  90. DDX_Text(pDX, IDC_EDIT_SCOPE_NAME, m_strName);
  91. //}}AFX_DATA_MAP
  92. DDX_Control(pDX, IDC_IPADDR_START, m_ipaStart);
  93. DDX_Control(pDX, IDC_IPADDR_END, m_ipaEnd);
  94. }
  95. BEGIN_MESSAGE_MAP(CMScopePropGeneral, CPropertyPageBase)
  96. //{{AFX_MSG_MAP(CMScopePropGeneral)
  97. ON_BN_CLICKED(IDC_RADIO_LEASE_LIMITED, OnRadioLeaseLimited)
  98. ON_BN_CLICKED(IDC_RADIO_LEASE_UNLIMITED, OnRadioLeaseUnlimited)
  99. ON_EN_CHANGE(IDC_EDIT_LEASE_DAYS, OnChangeEditLeaseDays)
  100. ON_EN_CHANGE(IDC_EDIT_LEASE_HOURS, OnChangeEditLeaseHours)
  101. ON_EN_CHANGE(IDC_EDIT_LEASE_MINUTES, OnChangeEditLeaseMinutes)
  102. ON_EN_CHANGE(IDC_EDIT_TTL, OnChangeEditTTL)
  103. ON_EN_CHANGE(IDC_EDIT_SCOPE_COMMENT, OnChangeEditScopeComment)
  104. ON_EN_CHANGE(IDC_EDIT_SCOPE_NAME, OnChangeEditScopeName)
  105. //}}AFX_MSG_MAP
  106. ON_EN_CHANGE(IDC_IPADDR_START, OnChangeIpAddrStart)
  107. ON_EN_CHANGE(IDC_IPADDR_END, OnChangeIpAddrStart)
  108. END_MESSAGE_MAP()
  109. /////////////////////////////////////////////////////////////////////////////
  110. // CMScopePropGeneral message handlers
  111. BOOL CMScopePropGeneral::OnInitDialog()
  112. {
  113. CPropertyPageBase::OnInitDialog();
  114. m_ipaStart.SetAddress(m_ScopeCfg.m_dwStartAddress);
  115. m_ipaEnd.SetAddress(m_ScopeCfg.m_dwEndAddress);
  116. m_spinMinutes.SetRange(0, 59);
  117. m_spinHours.SetRange(0, 23);
  118. m_spinDays.SetRange(0, 999);
  119. m_editMinutes.LimitText(2);
  120. m_editHours.LimitText(2);
  121. m_editDays.LimitText(3);
  122. // fill in the name & comment
  123. m_editName.SetWindowText(m_SubnetInfo.SubnetName);
  124. m_editComment.SetWindowText(m_SubnetInfo.SubnetComment);
  125. // fill in lease time info
  126. if (m_ScopeCfg.m_dwLeaseTime != DHCP_INFINIT_LEASE)
  127. {
  128. int nDays, nHours, nMinutes;
  129. UtilConvertLeaseTime(m_ScopeCfg.m_dwLeaseTime, &nDays, &nHours, &nMinutes);
  130. m_spinDays.SetPos(nDays);
  131. m_spinHours.SetPos(nHours);
  132. m_spinMinutes.SetPos(nMinutes);
  133. }
  134. // setup the lease time controls
  135. ActivateDuration (m_ScopeCfg.m_dwLeaseTime != DHCP_INFINIT_LEASE);
  136. m_radioUnlimited.SetCheck(m_ScopeCfg.m_dwLeaseTime == DHCP_INFINIT_LEASE);
  137. m_radioLimited.SetCheck(m_ScopeCfg.m_dwLeaseTime != DHCP_INFINIT_LEASE);
  138. // set the ttl
  139. m_spinTTL.SetRange(1, 255);
  140. m_spinTTL.SetPos(m_SubnetInfo.TTL);
  141. // load the correct icon
  142. for (int i = 0; i < ICON_IDX_MAX; i++)
  143. {
  144. if (g_uIconMap[i][1] == m_uImage)
  145. {
  146. HICON hIcon = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(g_uIconMap[i][0]));
  147. if (hIcon)
  148. ((CStatic *) GetDlgItem(IDC_STATIC_ICON))->SetIcon(hIcon);
  149. break;
  150. }
  151. }
  152. SetDirty(FALSE);
  153. return TRUE; // return TRUE unless you set the focus to a control
  154. // EXCEPTION: OCX Property Pages should return FALSE
  155. }
  156. void CMScopePropGeneral::OnRadioLeaseLimited()
  157. {
  158. ActivateDuration(TRUE);
  159. SetDirty(TRUE);
  160. }
  161. void CMScopePropGeneral::OnRadioLeaseUnlimited()
  162. {
  163. ActivateDuration(FALSE);
  164. SetDirty(TRUE);
  165. }
  166. BOOL CMScopePropGeneral::OnApply()
  167. {
  168. // this gets the name and comment
  169. UpdateData();
  170. // grab the lease time
  171. DWORD dwLeaseTime;
  172. if (m_radioUnlimited.GetCheck())
  173. {
  174. dwLeaseTime = DHCP_INFINIT_LEASE;
  175. }
  176. else
  177. {
  178. dwLeaseTime = UtilConvertLeaseTime(m_spinDays.GetPos(),
  179. m_spinHours.GetPos(),
  180. m_spinMinutes.GetPos());
  181. }
  182. if (dwLeaseTime == 0)
  183. {
  184. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  185. DhcpMessageBox(IDS_ERR_NO_DURATION_SPECIFIED);
  186. m_editDays.SetFocus();
  187. return FALSE;
  188. }
  189. if (dwLeaseTime != m_ScopeCfg.m_dwLeaseTime)
  190. {
  191. m_bUpdateLease = TRUE;
  192. m_ScopeCfgTemp.m_dwLeaseTime = dwLeaseTime;
  193. }
  194. m_bUpdateInfo = (m_editName.GetModify() || m_editComment.GetModify());
  195. // grab the TTL
  196. CString strTemp;
  197. DWORD dwTemp;
  198. m_editTTL.GetWindowText(strTemp);
  199. FCvtAsciiToInteger((LPCTSTR) strTemp, &dwTemp);
  200. m_SubnetInfoTemp.TTL = LOBYTE(LOWORD(dwTemp));
  201. if ( (dwTemp < 1) ||
  202. (dwTemp > 255) )
  203. {
  204. // invalid TTL specified
  205. AfxMessageBox(IDS_INVALID_TTL);
  206. m_editTTL.SetFocus();
  207. m_editTTL.SetSel(0,-1);
  208. return FALSE;
  209. }
  210. if (m_SubnetInfo.TTL != m_SubnetInfoTemp.TTL)
  211. {
  212. m_bUpdateInfo = TRUE;
  213. }
  214. // grab the addresses
  215. if (m_ipaStart.GetModify() ||
  216. m_ipaEnd.GetModify() )
  217. {
  218. m_bUpdateRange = TRUE;
  219. m_ipaStart.GetAddress(&m_ScopeCfgTemp.m_dwStartAddress);
  220. m_ipaEnd.GetAddress(&m_ScopeCfgTemp.m_dwEndAddress);
  221. }
  222. // call the base on apply which does the thread switch for us
  223. // and we come back through OnPropertyChange
  224. BOOL bRet = CPropertyPageBase::OnApply();
  225. if (bRet == FALSE)
  226. {
  227. // Something bad happened... grab the error code
  228. AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  229. ::DhcpMessageBox(GetHolder()->GetError());
  230. }
  231. m_editName.SetModify(FALSE);
  232. m_editComment.SetModify(FALSE);
  233. m_editTTL.SetModify(FALSE);
  234. return bRet;
  235. }
  236. BOOL CMScopePropGeneral::OnPropertyChange(BOOL bScope, LONG_PTR *ChangeMask)
  237. {
  238. CDhcpMScope * pScope;
  239. SPITFSNode spNode;
  240. DWORD dwError = 0;
  241. spNode = GetHolder()->GetNode();
  242. pScope = GETHANDLER(CDhcpMScope, spNode);
  243. BEGIN_WAIT_CURSOR;
  244. //
  245. // Check to see if we need to update the least time
  246. //
  247. if (m_bUpdateLease)
  248. {
  249. // Lease time changed, update on server
  250. dwError = pScope->SetLeaseTime(m_ScopeCfgTemp.m_dwLeaseTime);
  251. if (dwError != ERROR_SUCCESS)
  252. {
  253. GetHolder()->SetError(dwError);
  254. }
  255. else
  256. {
  257. m_ScopeCfg.m_dwLeaseTime = m_ScopeCfgTemp.m_dwLeaseTime;
  258. m_bUpdateLease = FALSE;
  259. }
  260. }
  261. //
  262. // Now check the allocation range
  263. //
  264. if (m_bUpdateRange)
  265. {
  266. // need to update the address pool allocation range
  267. DHCP_IP_RANGE dhcpIpRange;
  268. dhcpIpRange.StartAddress = m_ScopeCfgTemp.m_dwStartAddress;
  269. dhcpIpRange.EndAddress = m_ScopeCfgTemp.m_dwEndAddress;
  270. dwError = pScope->UpdateIpRange(&dhcpIpRange);
  271. if (dwError != ERROR_SUCCESS)
  272. {
  273. GetHolder()->SetError(dwError);
  274. }
  275. else
  276. {
  277. m_ScopeCfg.m_dwStartAddress = m_ScopeCfgTemp.m_dwStartAddress;
  278. m_ScopeCfg.m_dwEndAddress = m_ScopeCfgTemp.m_dwEndAddress;
  279. m_bUpdateRange = FALSE;
  280. }
  281. }
  282. //
  283. // Update the name and comment if necessary
  284. //
  285. LPCTSTR pNewName = NULL;
  286. CString strDisplay, strOldComment;
  287. strOldComment = pScope->GetComment();
  288. if (m_bUpdateInfo)
  289. {
  290. // update the comment
  291. m_SubnetInfoTemp.SubnetComment = m_strComment;
  292. pScope->SetComment(m_strComment);
  293. // name
  294. m_SubnetInfoTemp.SubnetName = m_strName;
  295. pNewName = (LPCTSTR) m_strName;
  296. *ChangeMask = SCOPE_PANE_CHANGE_ITEM_DATA;
  297. // Lease time changed, update on server
  298. dwError = pScope->SetTTL(m_SubnetInfoTemp.TTL);
  299. // try to set the new info
  300. dwError = pScope->SetInfo(pNewName);
  301. if (dwError != ERROR_SUCCESS)
  302. {
  303. // failed, revert to old info
  304. pScope->SetComment(strOldComment);
  305. GetHolder()->SetError(dwError);
  306. }
  307. else
  308. {
  309. // success, rebuild display name
  310. pScope->BuildDisplayName(&strDisplay, pNewName);
  311. pScope->SetDisplayName(strDisplay);
  312. m_SubnetInfo = m_SubnetInfoTemp;
  313. m_bUpdateInfo = FALSE;
  314. }
  315. }
  316. END_WAIT_CURSOR;
  317. return FALSE;
  318. }
  319. void CMScopePropGeneral::OnChangeEditLeaseDays()
  320. {
  321. ValidateLeaseTime();
  322. SetDirty(TRUE);
  323. }
  324. void CMScopePropGeneral::OnChangeEditLeaseHours()
  325. {
  326. ValidateLeaseTime();
  327. SetDirty(TRUE);
  328. }
  329. void CMScopePropGeneral::OnChangeEditLeaseMinutes()
  330. {
  331. ValidateLeaseTime();
  332. SetDirty(TRUE);
  333. }
  334. void CMScopePropGeneral::OnChangeEditTTL()
  335. {
  336. SetDirty(TRUE);
  337. }
  338. void CMScopePropGeneral::OnChangeEditScopeComment()
  339. {
  340. SetDirty(TRUE);
  341. }
  342. void CMScopePropGeneral::OnChangeEditScopeName()
  343. {
  344. SetDirty(TRUE);
  345. }
  346. void CMScopePropGeneral::OnChangeIpAddrStart()
  347. {
  348. SetDirty(TRUE);
  349. }
  350. void CMScopePropGeneral::OnChangeIpAddrEnd()
  351. {
  352. SetDirty(TRUE);
  353. }
  354. //
  355. // Helpers
  356. //
  357. void
  358. CMScopePropGeneral::ActivateDuration
  359. (
  360. BOOL fActive
  361. )
  362. {
  363. m_spinMinutes.EnableWindow(fActive);
  364. m_spinHours.EnableWindow(fActive);
  365. m_spinDays.EnableWindow(fActive);
  366. m_editMinutes.EnableWindow(fActive);
  367. m_editHours.EnableWindow(fActive);
  368. m_editDays.EnableWindow(fActive);
  369. GetDlgItem(IDC_STATIC_DAYS)->EnableWindow(fActive);
  370. GetDlgItem(IDC_STATIC_HOURS)->EnableWindow(fActive);
  371. GetDlgItem(IDC_STATIC_MINUTES)->EnableWindow(fActive);
  372. }
  373. void
  374. CMScopePropGeneral::ValidateLeaseTime()
  375. {
  376. CString strText;
  377. if (IsWindow(m_editHours.GetSafeHwnd()))
  378. {
  379. m_editHours.GetWindowText(strText);
  380. // check to see if the value is greater than the max
  381. if (_ttoi(strText) > HOURS_MAX)
  382. {
  383. LPTSTR pBuf = strText.GetBuffer(5);
  384. _itot(HOURS_MAX, pBuf, 10);
  385. strText.ReleaseBuffer();
  386. m_editHours.SetWindowText(strText);
  387. m_spinHours.SetPos(HOURS_MAX);
  388. MessageBeep(MB_ICONEXCLAMATION);
  389. }
  390. }
  391. if (IsWindow(m_editMinutes.GetSafeHwnd()))
  392. {
  393. m_editMinutes.GetWindowText(strText);
  394. // check to see if the value is greater than the max
  395. if (_ttoi(strText) > MINUTES_MAX)
  396. {
  397. LPTSTR pBuf = strText.GetBuffer(5);
  398. _itot(MINUTES_MAX, pBuf, 10);
  399. strText.ReleaseBuffer();
  400. m_editMinutes.SetWindowText(strText);
  401. m_spinMinutes.SetPos(MINUTES_MAX);
  402. MessageBeep(MB_ICONEXCLAMATION);
  403. }
  404. }
  405. }
  406. /////////////////////////////////////////////////////////////////////////////
  407. // CMScopePropLifetime property page
  408. IMPLEMENT_DYNCREATE(CMScopePropLifetime, CPropertyPageBase)
  409. CMScopePropLifetime::CMScopePropLifetime() : CPropertyPageBase(CMScopePropLifetime::IDD)
  410. {
  411. //{{AFX_DATA_INIT(CMScopePropLifetime)
  412. //}}AFX_DATA_INIT
  413. m_Expiry.dwLowDateTime = DHCP_DATE_TIME_INFINIT_LOW;
  414. m_Expiry.dwHighDateTime = DHCP_DATE_TIME_INFINIT_HIGH;
  415. }
  416. CMScopePropLifetime::~CMScopePropLifetime()
  417. {
  418. }
  419. void CMScopePropLifetime::DoDataExchange(CDataExchange* pDX)
  420. {
  421. CPropertyPageBase::DoDataExchange(pDX);
  422. //{{AFX_DATA_MAP(CMScopePropLifetime)
  423. DDX_Control(pDX, IDC_RADIO_MSCOPE_FINITE, m_radioFinite);
  424. DDX_Control(pDX, IDC_RADIO_MSCOPE_INFINITE, m_radioInfinite);
  425. //}}AFX_DATA_MAP
  426. }
  427. BEGIN_MESSAGE_MAP(CMScopePropLifetime, CPropertyPageBase)
  428. //{{AFX_MSG_MAP(CMScopePropLifetime)
  429. ON_NOTIFY(DTN_DATETIMECHANGE, IDC_DATETIMEPICKER_TIME, OnDatetimechangeDatetimepickerTime)
  430. ON_NOTIFY(DTN_DATETIMECHANGE, IDC_DATETIMEPICKER_DATE, OnDatetimechangeDatetimepickerDate)
  431. ON_BN_CLICKED(IDC_RADIO_MSCOPE_INFINITE, OnRadioScopeInfinite)
  432. ON_BN_CLICKED(IDC_RADIO_MSCOPE_FINITE, OnRadioMscopeFinite)
  433. //}}AFX_MSG_MAP
  434. END_MESSAGE_MAP()
  435. /////////////////////////////////////////////////////////////////////////////
  436. // CMScopePropLifetime message handlers
  437. BOOL CMScopePropLifetime::OnInitDialog()
  438. {
  439. CPropertyPageBase::OnInitDialog();
  440. if ( (m_Expiry.dwLowDateTime == DHCP_DATE_TIME_INFINIT_LOW) &&
  441. (m_Expiry.dwHighDateTime == DHCP_DATE_TIME_INFINIT_HIGH) )
  442. {
  443. m_radioInfinite.SetCheck(TRUE);
  444. }
  445. else
  446. {
  447. SYSTEMTIME st;
  448. FILETIME ft;
  449. m_radioFinite.SetCheck(TRUE);
  450. FileTimeToLocalFileTime((FILETIME *) &m_Expiry, &ft);
  451. FileTimeToSystemTime(&ft, &st);
  452. ::SendMessage(GetDlgItem(IDC_DATETIMEPICKER_DATE)->GetSafeHwnd(), DTM_SETSYSTEMTIME, 0, (LPARAM) &st);
  453. ::SendMessage(GetDlgItem(IDC_DATETIMEPICKER_TIME)->GetSafeHwnd(), DTM_SETSYSTEMTIME, 0, (LPARAM) &st);
  454. }
  455. UpdateControls();
  456. SetDirty(FALSE);
  457. return TRUE; // return TRUE unless you set the focus to a control
  458. // EXCEPTION: OCX Property Pages should return FALSE
  459. }
  460. BOOL CMScopePropLifetime::OnApply()
  461. {
  462. DATE_TIME datetime;
  463. if (m_radioInfinite.GetCheck())
  464. {
  465. datetime.dwLowDateTime = DHCP_DATE_TIME_INFINIT_LOW;
  466. datetime.dwHighDateTime = DHCP_DATE_TIME_INFINIT_HIGH;
  467. }
  468. else
  469. {
  470. SYSTEMTIME stDate, stTime;
  471. ::SendMessage(GetDlgItem(IDC_DATETIMEPICKER_DATE)->GetSafeHwnd(), DTM_GETSYSTEMTIME, 0, (LPARAM) &stDate);
  472. ::SendMessage(GetDlgItem(IDC_DATETIMEPICKER_TIME)->GetSafeHwnd(), DTM_GETSYSTEMTIME, 0, (LPARAM) &stTime);
  473. SYSTEMTIME systemtime;
  474. systemtime.wYear = stDate.wYear;
  475. systemtime.wMonth = stDate.wMonth;
  476. systemtime.wDayOfWeek = stDate.wDayOfWeek;
  477. systemtime.wDay = stDate.wDay;
  478. systemtime.wHour = stTime.wHour;
  479. systemtime.wMinute = stTime.wMinute;
  480. systemtime.wSecond = stTime.wSecond;
  481. systemtime.wMilliseconds = 0;
  482. FILETIME ft;
  483. ::SystemTimeToFileTime(&systemtime, &ft);
  484. ::LocalFileTimeToFileTime(&ft, (LPFILETIME) &datetime);
  485. }
  486. CDhcpMScope * pScope;
  487. SPITFSNode spNode;
  488. DWORD dwError = 0;
  489. spNode = GetHolder()->GetNode();
  490. pScope = GETHANDLER(CDhcpMScope, spNode);
  491. pScope->SetLifetime(&datetime);
  492. dwError = pScope->SetInfo(NULL);
  493. if (dwError != ERROR_SUCCESS)
  494. {
  495. DhcpMessageBox(dwError);
  496. return FALSE;
  497. }
  498. return CPropertyPageBase::OnApply();
  499. }
  500. void CMScopePropLifetime::UpdateControls()
  501. {
  502. BOOL fEnable = TRUE;
  503. if (m_radioInfinite.GetCheck())
  504. {
  505. fEnable = FALSE;
  506. }
  507. GetDlgItem(IDC_DATETIMEPICKER_DATE)->EnableWindow(fEnable);
  508. GetDlgItem(IDC_DATETIMEPICKER_TIME)->EnableWindow(fEnable);
  509. }
  510. void CMScopePropLifetime::OnDatetimechangeDatetimepickerTime(NMHDR* pNMHDR, LRESULT* pResult)
  511. {
  512. SetDirty(TRUE);
  513. *pResult = 0;
  514. }
  515. void CMScopePropLifetime::OnDatetimechangeDatetimepickerDate(NMHDR* pNMHDR, LRESULT* pResult)
  516. {
  517. SetDirty(TRUE);
  518. *pResult = 0;
  519. }
  520. void CMScopePropLifetime::OnRadioScopeInfinite()
  521. {
  522. SetDirty(TRUE);
  523. UpdateControls();
  524. }
  525. void CMScopePropLifetime::OnRadioMscopeFinite()
  526. {
  527. SetDirty(TRUE);
  528. UpdateControls();
  529. }