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.

687 lines
18 KiB

  1. // DPWmiQueryPage.cpp : implementation file
  2. //
  3. // 03/05/00 v-marfin bug 59643 : Make this the default starting page.
  4. // 03/29/00 v-marfin bug 62585 : Set new Data collector's ENABLED to TRUE if user presses OK.
  5. // 03/30/00 v-marfin bug 59237 : If user does not change the default name of the data
  6. // collector when they first create it, change it for
  7. // them to a more meaningful name based on the data
  8. // they select in the property pages.
  9. #include "stdafx.h"
  10. #include "snapin.h"
  11. #include "DPWmiQueryPage.h"
  12. #include "HMObject.h"
  13. #include "WmiBrowseDlg.h"
  14. #include "WmiPropertyBrowseDlg.h"
  15. #include "DataElement.h"
  16. #include "DataGroupScopeItem.h"
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CDPWmiQueryPage property page
  24. IMPLEMENT_DYNCREATE(CDPWmiQueryPage, CHMPropertyPage)
  25. CDPWmiQueryPage::CDPWmiQueryPage() : CHMPropertyPage(CDPWmiQueryPage::IDD)
  26. {
  27. //{{AFX_DATA_INIT(CDPWmiQueryPage)
  28. m_bRequireReset = FALSE;
  29. m_sNamespace = _T("");
  30. m_sQuery = _T("");
  31. m_sClass = _T("");
  32. m_iEventType = -1;
  33. //}}AFX_DATA_INIT
  34. m_sHelpTopic = _T("HMon21.chm::/dDEevent.htm");
  35. }
  36. CDPWmiQueryPage::~CDPWmiQueryPage()
  37. {
  38. }
  39. void CDPWmiQueryPage::DoDataExchange(CDataExchange* pDX)
  40. {
  41. CHMPropertyPage::DoDataExchange(pDX);
  42. //{{AFX_DATA_MAP(CDPWmiQueryPage)
  43. DDX_Control(pDX, IDC_LIST_PROPERTIES, m_Properties);
  44. DDX_Control(pDX, IDC_COMBO_EVENT_TYPE, m_IntrinsicEventTypeBox);
  45. DDX_Check(pDX, IDC_CHECK_REQUIRE_RESET, m_bRequireReset);
  46. DDX_Text(pDX, IDC_EDIT_NAMESPACE, m_sNamespace);
  47. DDX_Text(pDX, IDC_EDIT_QUERY, m_sQuery);
  48. DDX_Text(pDX, IDC_EDIT_CLASS, m_sClass);
  49. DDX_Radio(pDX, IDC_RADIO1, m_iEventType);
  50. //}}AFX_DATA_MAP
  51. if( m_iEventType == 0 )
  52. {
  53. m_IntrinsicEventTypeBox.EnableWindow();
  54. }
  55. else if( m_iEventType == 1 )
  56. {
  57. m_IntrinsicEventTypeBox.EnableWindow(FALSE);
  58. }
  59. }
  60. void CDPWmiQueryPage::UpdateProperties()
  61. {
  62. m_Properties.DeleteAllItems();
  63. if( m_sClass.IsEmpty() )
  64. {
  65. return;
  66. }
  67. CWbemClassObject classobject;
  68. classobject.SetNamespace(_T("\\\\") + GetObjectPtr()->GetSystemName() + _T("\\") + m_sNamespace);
  69. HRESULT hr = classobject.GetObject(m_sClass);
  70. if( hr != S_OK )
  71. {
  72. return;
  73. }
  74. CStringArray saNames;
  75. classobject.GetPropertyNames(saNames);
  76. classobject.Destroy();
  77. for( int i = 0; i < saNames.GetSize(); i++ )
  78. {
  79. m_Properties.InsertItem(0,saNames[i]);
  80. }
  81. m_Properties.SetColumnWidth(0,LVSCW_AUTOSIZE);
  82. }
  83. inline void CDPWmiQueryPage::ConstructQuery()
  84. {
  85. if( m_iEventType == 1 )
  86. {
  87. m_sQuery.Format(_T("SELECT * FROM %s"), m_sClass.IsEmpty() ? _T("<<your_class_name_here>>") : m_sClass);
  88. }
  89. else if( m_iEventType == 0 )
  90. {
  91. CString sIntrinsicType;
  92. switch(m_IntrinsicEventTypeBox.GetCurSel())
  93. {
  94. case 0:
  95. {
  96. sIntrinsicType = _T("__InstanceCreationEvent");
  97. }
  98. break;
  99. case 1:
  100. {
  101. sIntrinsicType = _T("__InstanceDeletionEvent");
  102. }
  103. break;
  104. case 2:
  105. {
  106. sIntrinsicType = _T("__InstanceModificationEvent");
  107. }
  108. break;
  109. case 3:
  110. {
  111. sIntrinsicType = _T("__ClassCreationEvent");
  112. }
  113. break;
  114. case 4:
  115. {
  116. sIntrinsicType = _T("__ClassDeletionEvent");
  117. }
  118. break;
  119. case 5:
  120. {
  121. sIntrinsicType = _T("__ClassModificationEvent");
  122. }
  123. break;
  124. case 6:
  125. {
  126. sIntrinsicType = _T("__NamespaceCreationEvent");
  127. }
  128. break;
  129. case 7:
  130. {
  131. sIntrinsicType = _T("__NamespaceDeletionEvent");
  132. }
  133. break;
  134. case 8:
  135. {
  136. sIntrinsicType = _T("__NamespaceModificationEvent");
  137. }
  138. break;
  139. }
  140. m_sQuery.Format(_T("SELECT * FROM %s where TargetInstance isa \"%s\""), sIntrinsicType, m_sClass.IsEmpty() ? _T("") : m_sClass);
  141. }
  142. GetDlgItem(IDC_EDIT_QUERY)->SetWindowText(m_sQuery);
  143. }
  144. BEGIN_MESSAGE_MAP(CDPWmiQueryPage, CHMPropertyPage)
  145. //{{AFX_MSG_MAP(CDPWmiQueryPage)
  146. ON_BN_CLICKED(IDC_BUTTON_BROWSE_NAMESPACE, OnButtonBrowseNamespace)
  147. ON_WM_DESTROY()
  148. ON_BN_CLICKED(IDC_BUTTON_BROWSE_CLASS, OnButtonBrowseClass)
  149. ON_EN_CHANGE(IDC_EDIT_CLASS, OnChangeEditClass)
  150. ON_EN_CHANGE(IDC_EDIT_NAMESPACE, OnChangeEditNamespace)
  151. ON_EN_CHANGE(IDC_EDIT_QUERY, OnChangeEditQuery)
  152. ON_BN_CLICKED(IDC_CHECK_REQUIRE_RESET, OnCheckRequireReset)
  153. ON_EN_CHANGE(IDC_EDIT_INSTANCE, OnChangeEditInstance)
  154. ON_CBN_EDITCHANGE(IDC_COMBO_EVENT_TYPE, OnEditchangeComboEventType)
  155. ON_CBN_SELENDOK(IDC_COMBO_EVENT_TYPE, OnSelendokComboEventType)
  156. ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
  157. ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
  158. ON_NOTIFY(NM_CLICK, IDC_LIST_PROPERTIES, OnClickListProperties)
  159. //}}AFX_MSG_MAP
  160. END_MESSAGE_MAP()
  161. /////////////////////////////////////////////////////////////////////////////
  162. // CDPWmiQueryPage message handlers
  163. BOOL CDPWmiQueryPage::OnInitDialog()
  164. {
  165. // v-marfin : bug 59643 : This will be the default starting page for the property
  166. // sheet so call CnxPropertyPageCreate() to unmarshal the
  167. // connection for this thread. This function must be called
  168. // by the first page of the property sheet. It used to
  169. // be called by the "General" page and its call still remains
  170. // there as well in case the general page is loaded by a
  171. // different code path that does not also load this page.
  172. // The CnxPropertyPageCreate function has been safeguarded
  173. // to simply return if the required call has already been made.
  174. // CnxPropertyPageDestory() must be called from this page's
  175. // OnDestroy function.
  176. // unmarshal connmgr
  177. CnxPropertyPageCreate();
  178. CHMPropertyPage::OnInitDialog();
  179. // initialize the list view
  180. m_Properties.SetExtendedStyle(LVS_EX_CHECKBOXES);
  181. CString sColumnTitle;
  182. sColumnTitle.LoadString(IDS_STRING_NAME);
  183. m_Properties.InsertColumn(0,sColumnTitle);
  184. CWbemClassObject* pClassObject = GetObjectPtr()->GetClassObject();
  185. if( ! GfxCheckObjPtr(pClassObject,CWbemClassObject) )
  186. {
  187. return TRUE;
  188. }
  189. //-------------------------------------------------------------------------
  190. // v-marfin 59237 : Store original name in case this data collector is
  191. // just being created. When they save, we will modify the
  192. // name if they haven't.
  193. pClassObject->GetProperty(IDS_STRING_MOF_NAME,m_sOriginalName);
  194. //-------------------------------------------------------------------------
  195. pClassObject->GetProperty(IDS_STRING_MOF_TARGETNAMESPACE,m_sNamespace);
  196. bool bReset;
  197. pClassObject->GetProperty(IDS_STRING_MOF_REQUIRERESET,bReset);
  198. m_bRequireReset = bReset;
  199. pClassObject->GetProperty(IDS_STRING_MOF_QUERY,m_sQuery);
  200. CString sQuery = m_sQuery;
  201. _tcsupr(sQuery.GetBuffer(sQuery.GetLength()));
  202. sQuery.ReleaseBuffer();
  203. int iIndex = -1;
  204. if( (iIndex = sQuery.Find(_T("ISA"))) != -1 )
  205. {
  206. m_sClass = m_sQuery.Right(m_sQuery.GetLength()-iIndex-4);
  207. iIndex = m_sClass.Find(_T(" "));
  208. if( iIndex != -1 )
  209. {
  210. m_sClass = m_sClass.Left(iIndex);
  211. }
  212. m_sClass.TrimLeft(_T("\""));
  213. m_sClass.TrimRight(_T("\""));
  214. if( sQuery.Find(_T("__INSTANCECREATIONEVENT")) != -1 )
  215. {
  216. m_IntrinsicEventTypeBox.SetCurSel(0);
  217. }
  218. else if(sQuery.Find(_T("__INSTANCEDELETIONEVENT")) != -1 )
  219. {
  220. m_IntrinsicEventTypeBox.SetCurSel(1);
  221. }
  222. else if(sQuery.Find(_T("__INSTANCEMODIFICATIONEVENT")) != -1 )
  223. {
  224. m_IntrinsicEventTypeBox.SetCurSel(2);
  225. }
  226. else if(sQuery.Find(_T("__CLASSCREATIONEVENT")) != -1 )
  227. {
  228. m_IntrinsicEventTypeBox.SetCurSel(3);
  229. }
  230. else if(sQuery.Find(_T("__CLASSDELETIONEVENT")) != -1 )
  231. {
  232. m_IntrinsicEventTypeBox.SetCurSel(4);
  233. }
  234. else if(sQuery.Find(_T("__CLASSMODIFICATIONEVENT")) != -1 )
  235. {
  236. m_IntrinsicEventTypeBox.SetCurSel(5);
  237. }
  238. else if(sQuery.Find(_T("__NAMESPACECREATIONEVENT")) != -1 )
  239. {
  240. m_IntrinsicEventTypeBox.SetCurSel(6);
  241. }
  242. else if(sQuery.Find(_T("__NAMESPACEDELETIONEVENT")) != -1 )
  243. {
  244. m_IntrinsicEventTypeBox.SetCurSel(7);
  245. }
  246. else if(sQuery.Find(_T("__NAMESPACEMODIFICATIONEVENT")) != -1 )
  247. {
  248. m_IntrinsicEventTypeBox.SetCurSel(8);
  249. }
  250. m_iEventType = 0;
  251. }
  252. else
  253. {
  254. iIndex = sQuery.Find(_T("SELECT * FROM "));
  255. if( iIndex != -1 )
  256. {
  257. m_sClass = m_sQuery.Right(m_sQuery.GetLength()-iIndex-14);
  258. iIndex = m_sClass.Find(_T(" "));
  259. if( iIndex != -1 )
  260. {
  261. m_sClass = m_sClass.Left(iIndex);
  262. }
  263. }
  264. m_iEventType = 1;
  265. }
  266. UpdateProperties();
  267. CStringArray saProperties;
  268. pClassObject->GetProperty(IDS_STRING_MOF_STATISTICSPROPERTYNAMES,saProperties);
  269. for( int i=0; i < saProperties.GetSize(); i++ )
  270. {
  271. LVFINDINFO lvfi;
  272. ZeroMemory(&lvfi,sizeof(LVFINDINFO));
  273. lvfi.flags = LVFI_WRAP|LVFI_STRING;
  274. lvfi.psz = saProperties[i];
  275. int iListIndex = m_Properties.FindItem(&lvfi);
  276. if( iListIndex >= 0 )
  277. {
  278. m_Properties.SetCheck(iListIndex);
  279. }
  280. }
  281. delete pClassObject;
  282. UpdateData(FALSE);
  283. return TRUE; // return TRUE unless you set the focus to a control
  284. // EXCEPTION: OCX Property Pages should return FALSE
  285. }
  286. void CDPWmiQueryPage::OnDestroy()
  287. {
  288. // v-marfin 62585 : For this new data collector, set its Enabled property to TRUE, but
  289. // only if the user is not cancelling these property pages.
  290. if (m_bOnApplyUsed)
  291. {
  292. ClearStatistics(); // 62548
  293. CDataElement* pElement = (CDataElement*)GetObjectPtr();
  294. if (pElement && pElement->IsStateSetToEnabledOnOK())
  295. {
  296. TRACE(_T("CDPWmiQueryPage::OnDestroy - New Perfmon Collector: Setting to Enabled\n"));
  297. pElement->SetStateToEnabledOnOK(FALSE); // don't do this again
  298. CWbemClassObject* pClassObject = GetObjectPtr()->GetClassObject();
  299. if( ! GfxCheckObjPtr(pClassObject,CWbemClassObject) )
  300. {
  301. TRACE(_T("ERROR: CDPWmiQueryPage::OnDestroy - Failed to GetClassObject()\n"));
  302. return;
  303. }
  304. // Set the new collector to enabled.
  305. BOOL bEnabled=TRUE;
  306. HRESULT hr = pClassObject->GetProperty(IDS_STRING_MOF_ENABLE,bEnabled);
  307. hr = pClassObject->SetProperty(IDS_STRING_MOF_ENABLE,TRUE);
  308. if (!CHECKHRESULT(hr))
  309. {
  310. TRACE(_T("ERROR: CDPWmiQueryPage::OnDestroy - Failed to set ENABLED property on new collector\n"));
  311. }
  312. //-------------------------------------------------------------------
  313. // v-marfin 59237 : If the user has not changed the original default
  314. // name, do so for them. Compare against original
  315. // name we fetched during OnInitDialog.
  316. CString sName;
  317. pClassObject->GetProperty(IDS_STRING_MOF_NAME,sName);
  318. // Did the user change the default name?
  319. if (m_sOriginalName.CompareNoCase(sName)==0)
  320. {
  321. // No, so set the new name
  322. if (!m_sQuery.IsEmpty())
  323. {
  324. // Use parent to ensure name is unique
  325. //CDataGroup* pParent = (CDataGroup*) pElement->GetCollectorsParentClassObject();
  326. if(pElement->GetScopeItemCount())
  327. {
  328. CDataElementScopeItem* pItem = (CDataElementScopeItem*)pElement->GetScopeItem(0);
  329. if( pItem )
  330. {
  331. CDataGroupScopeItem* pDGItem = (CDataGroupScopeItem*)pItem->GetParent();
  332. sName = pDGItem->GetUniqueDisplayName(m_sQuery);
  333. }
  334. }
  335. // Set the local element's object data
  336. pElement->SetName(sName);
  337. // Set its WMI property
  338. pClassObject->SetProperty(IDS_STRING_MOF_NAME,sName);
  339. // Refresh to show the new name in the IU
  340. //pElement->Refresh(); // 63005
  341. pElement->UpdateStatus(); // 63005
  342. }
  343. }
  344. //-------------------------------------------------------------------
  345. pClassObject->SaveAllProperties();
  346. delete pClassObject;
  347. } // if (pElement && pElement->IsStateSetToEnabledOnOK())
  348. } // if (m_bOnApplyUsed)
  349. CHMPropertyPage::OnDestroy();
  350. // v-marfin : bug 59643 : CnxPropertyPageDestory() must be called from this page's
  351. // OnDestroy function.
  352. CnxPropertyPageDestroy();
  353. }
  354. void CDPWmiQueryPage::OnOK()
  355. {
  356. CHMPropertyPage::OnOK();
  357. }
  358. void CDPWmiQueryPage::OnButtonBrowseNamespace()
  359. {
  360. CWmiNamespaceBrowseDlg dlg;
  361. // set the dialog window title
  362. CString sItem;
  363. sItem.LoadString(IDS_STRING_NAMESPACES);
  364. dlg.m_sDlgTitle.Format(IDS_STRING_WMI_BROWSE_TITLE,sItem,GetObjectPtr()->GetSystemName());
  365. // create the namespace enumerator
  366. if( ! CHECKHRESULT(dlg.m_ClassObject.Create(GetObjectPtr()->GetSystemName())) )
  367. {
  368. return;
  369. }
  370. if( m_sNamespace.IsEmpty() )
  371. {
  372. m_sNamespace.Format(IDS_STRING_MOF_NAMESPACE_FORMAT,GetObjectPtr()->GetSystemName());
  373. }
  374. dlg.m_sTitle.Format(_T("\\\\%s\\%s"),GetObjectPtr()->GetSystemName(),m_sNamespace);
  375. dlg.m_ClassObject.SetNamespace(dlg.m_sTitle);
  376. // set the listbox title
  377. dlg.m_sTitle = m_sNamespace;
  378. // display dialog
  379. if( dlg.DoModal() == IDOK )
  380. {
  381. m_sNamespace = dlg.m_sSelectedItem;
  382. m_sClass.Empty();
  383. UpdateData(FALSE);
  384. UpdateProperties();
  385. SetModified();
  386. ConstructQuery();
  387. }
  388. }
  389. void CDPWmiQueryPage::OnButtonBrowseClass()
  390. {
  391. CWmiClassBrowseDlg dlg;
  392. // set the dialog window title
  393. CString sItem;
  394. sItem.LoadString(IDS_STRING_CLASSES);
  395. dlg.m_sDlgTitle.Format(IDS_STRING_WMI_BROWSE_TITLE,sItem,GetObjectPtr()->GetSystemName());
  396. // create the class enumerator
  397. if( ! CHECKHRESULT(dlg.m_ClassObject.Create(GetObjectPtr()->GetSystemName())) )
  398. {
  399. return;
  400. }
  401. CString sTemp;
  402. sTemp.Format(_T("\\\\%s\\%s"),GetObjectPtr()->GetSystemName(),m_sNamespace);
  403. dlg.m_ClassObject.SetNamespace(sTemp);
  404. if( ! CHECKHRESULT(dlg.m_ClassObject.CreateClassEnumerator(NULL)) )
  405. {
  406. return;
  407. }
  408. // set the listbox title
  409. dlg.m_sTitle = m_sNamespace;
  410. // display the dialog
  411. if( dlg.DoModal() == IDOK )
  412. {
  413. m_sClass = dlg.m_sSelectedItem;
  414. UpdateData(FALSE);
  415. UpdateProperties();
  416. SetModified();
  417. ConstructQuery();
  418. }
  419. }
  420. void CDPWmiQueryPage::OnChangeEditClass()
  421. {
  422. // TODO: If this is a RICHEDIT control, the control will not
  423. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  424. // function and call CRichEditCtrl().SetEventMask()
  425. // with the ENM_CHANGE flag ORed into the mask.
  426. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  427. {
  428. return;
  429. }
  430. UpdateData();
  431. SetModified();
  432. UpdateProperties();
  433. ConstructQuery();
  434. }
  435. void CDPWmiQueryPage::OnChangeEditNamespace()
  436. {
  437. // TODO: If this is a RICHEDIT control, the control will not
  438. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  439. // function and call CRichEditCtrl().SetEventMask()
  440. // with the ENM_CHANGE flag ORed into the mask.
  441. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  442. {
  443. return;
  444. }
  445. if( m_sNamespace.Find(_T("\\\\")) != -1 )
  446. {
  447. AfxMessageBox(IDS_STRING_NO_REMOTE_NAMESPACES);
  448. GetDlgItem(IDC_EDIT_NAMESPACE)->SetWindowText(_T(""));
  449. }
  450. GetDlgItem(IDC_EDIT_CLASS)->SetWindowText(_T(""));
  451. UpdateData();
  452. UpdateProperties();
  453. SetModified();
  454. ConstructQuery();
  455. }
  456. void CDPWmiQueryPage::OnChangeEditQuery()
  457. {
  458. // TODO: If this is a RICHEDIT control, the control will not
  459. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  460. // function and call CRichEditCtrl().SetEventMask()
  461. // with the ENM_CHANGE flag ORed into the mask.
  462. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  463. {
  464. return;
  465. }
  466. UpdateData();
  467. SetModified();
  468. }
  469. BOOL CDPWmiQueryPage::OnApply()
  470. {
  471. if( ! CHMPropertyPage::OnApply() )
  472. {
  473. return FALSE;
  474. }
  475. // v-marfin 62585 : So we can set the collector's state to enabled when OK pressed.
  476. m_bOnApplyUsed=TRUE;
  477. UpdateData();
  478. CStringArray saProperties;
  479. for( int i = 0; i < m_Properties.GetItemCount(); i++ )
  480. {
  481. if( m_Properties.GetCheck(i) )
  482. {
  483. saProperties.Add(m_Properties.GetItemText(i,0));
  484. }
  485. }
  486. // if( ! saProperties.GetSize() )
  487. // {
  488. // return FALSE;
  489. // }
  490. CWbemClassObject* pClassObject = GetObjectPtr()->GetClassObject();
  491. if( ! GfxCheckObjPtr(pClassObject,CWbemClassObject) )
  492. {
  493. return FALSE;
  494. }
  495. pClassObject->SetProperty(IDS_STRING_MOF_TARGETNAMESPACE,m_sNamespace);
  496. bool bReset = m_bRequireReset ? true : false;
  497. pClassObject->SetProperty(IDS_STRING_MOF_REQUIRERESET,bReset);
  498. pClassObject->SetProperty(IDS_STRING_MOF_STATISTICSPROPERTYNAMES,saProperties);
  499. pClassObject->SetProperty(IDS_STRING_MOF_QUERY,m_sQuery);
  500. pClassObject->SaveAllProperties();
  501. delete pClassObject;
  502. SetModified(FALSE);
  503. return TRUE;
  504. }
  505. void CDPWmiQueryPage::OnCheckRequireReset()
  506. {
  507. UpdateData();
  508. SetModified();
  509. }
  510. void CDPWmiQueryPage::OnChangeEditInstance()
  511. {
  512. // TODO: If this is a RICHEDIT control, the control will not
  513. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  514. // function and call CRichEditCtrl().SetEventMask()
  515. // with the ENM_CHANGE flag ORed into the mask.
  516. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  517. {
  518. return;
  519. }
  520. UpdateData();
  521. SetModified();
  522. }
  523. void CDPWmiQueryPage::OnEditchangeComboEventType()
  524. {
  525. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  526. {
  527. return;
  528. }
  529. UpdateData();
  530. SetModified();
  531. ConstructQuery();
  532. }
  533. void CDPWmiQueryPage::OnSelendokComboEventType()
  534. {
  535. UpdateData();
  536. SetModified();
  537. ConstructQuery();
  538. }
  539. void CDPWmiQueryPage::OnRadio1()
  540. {
  541. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  542. {
  543. return;
  544. }
  545. UpdateData();
  546. SetModified();
  547. ConstructQuery();
  548. }
  549. void CDPWmiQueryPage::OnRadio2()
  550. {
  551. if( ! m_IntrinsicEventTypeBox.GetSafeHwnd() )
  552. {
  553. return;
  554. }
  555. UpdateData();
  556. SetModified();
  557. ConstructQuery();
  558. }
  559. void CDPWmiQueryPage::OnClickListProperties(NMHDR* pNMHDR, LRESULT* pResult)
  560. {
  561. SetModified();
  562. *pResult = 0;
  563. }