Leaked source code of windows server 2003
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.

631 lines
21 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: PPATTACH.CPP
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 10/26/2000
  12. *
  13. * DESCRIPTION:
  14. *
  15. *******************************************************************************/
  16. #include "precomp.h"
  17. #pragma hdrstop
  18. #include "ppattach.h"
  19. #include "psutil.h"
  20. #include "resource.h"
  21. #include "wiacsh.h"
  22. #include "simrect.h"
  23. #include "wiaffmt.h"
  24. #include "itranhlp.h"
  25. #include "wiadevdp.h"
  26. #include "textdlg.h"
  27. //
  28. // We use this instead of GetSystemMetrics(SM_CXSMICON)/GetSystemMetrics(SM_CYSMICON) because
  29. // large "small" icons wreak havoc with dialog layout
  30. //
  31. #define SMALL_ICON_SIZE 16
  32. //
  33. // Context Help IDs
  34. //
  35. static const DWORD g_HelpIDs[] =
  36. {
  37. IDOK, IDH_OK,
  38. IDCANCEL, IDH_CANCEL,
  39. 0, 0
  40. };
  41. extern HINSTANCE g_hInstance;
  42. //
  43. // The only constructor
  44. //
  45. CAttachmentCommonPropertyPage::CAttachmentCommonPropertyPage( HWND hWnd )
  46. : m_hWnd(hWnd)
  47. {
  48. }
  49. CAttachmentCommonPropertyPage::~CAttachmentCommonPropertyPage(void)
  50. {
  51. if (m_hDefAttachmentIcon)
  52. {
  53. DestroyIcon(m_hDefAttachmentIcon);
  54. m_hDefAttachmentIcon = NULL;
  55. }
  56. m_hWnd = NULL;
  57. }
  58. LRESULT CAttachmentCommonPropertyPage::OnKillActive( WPARAM , LPARAM )
  59. {
  60. return FALSE;
  61. }
  62. LRESULT CAttachmentCommonPropertyPage::OnSetActive( WPARAM , LPARAM )
  63. {
  64. //
  65. // Don't allow activation unless we have an item
  66. //
  67. if (!m_pWiaItem)
  68. {
  69. return -1;
  70. }
  71. CWaitCursor wc;
  72. Initialize();
  73. return 0;
  74. }
  75. LRESULT CAttachmentCommonPropertyPage::OnApply( WPARAM , LPARAM )
  76. {
  77. return 0;
  78. }
  79. void CAttachmentCommonPropertyPage::AddAnnotation( HWND hwndList, const CAnnotation &Annotation )
  80. {
  81. WIA_PUSH_FUNCTION((TEXT("CAttachmentCommonPropertyPage::AddAnnotation")));
  82. WIA_ASSERT(hwndList != NULL);
  83. if (hwndList)
  84. {
  85. HIMAGELIST hImageList = ListView_GetImageList( hwndList, LVSIL_SMALL );
  86. if (hImageList)
  87. {
  88. WIA_TRACE((TEXT("Annotation.FileFormat().Icon(): %p"), Annotation.FileFormat().Icon() ));
  89. int nIconIndex = ImageList_AddIcon( hImageList, Annotation.FileFormat().Icon() );
  90. if (nIconIndex != -1)
  91. {
  92. WIA_TRACE((TEXT("nIconIndex: %d"), nIconIndex ));
  93. CAnnotation *pAnnotation = new CAnnotation(Annotation);
  94. if (pAnnotation)
  95. {
  96. //
  97. // Prepare Column 0, Name
  98. //
  99. LVITEM LvItem;
  100. CSimpleString strText;
  101. ZeroMemory(&LvItem,sizeof(LvItem));
  102. strText = pAnnotation->Name();
  103. LvItem.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT | LVIF_STATE;
  104. LvItem.iItem = ListView_GetItemCount(hwndList);
  105. LvItem.iSubItem = 0;
  106. LvItem.pszText = const_cast<LPTSTR>(strText.String());
  107. LvItem.iImage = nIconIndex;
  108. LvItem.lParam = reinterpret_cast<LPARAM>(pAnnotation);
  109. LvItem.state = ListView_GetItemCount(hwndList) ? 0 : LVIS_FOCUSED | LVIS_SELECTED;
  110. LvItem.stateMask = LVIS_FOCUSED | LVIS_SELECTED;
  111. //
  112. // Insert the item
  113. //
  114. int nItemIndex = ListView_InsertItem( hwndList, &LvItem );
  115. if (nItemIndex != -1)
  116. {
  117. //
  118. // Prepare the description
  119. //
  120. ZeroMemory(&LvItem,sizeof(LvItem));
  121. strText = pAnnotation->FileFormat().Description();
  122. LvItem.mask = LVIF_TEXT;
  123. LvItem.iItem = nItemIndex;
  124. LvItem.iSubItem = 1;
  125. LvItem.pszText = const_cast<LPTSTR>(strText.String());
  126. //
  127. // Set the subitem
  128. //
  129. ListView_SetItem( hwndList, &LvItem );
  130. //
  131. // Prepare the description
  132. //
  133. ZeroMemory(&LvItem,sizeof(LvItem));
  134. TCHAR szSize[MAX_PATH] = {0};
  135. StrFormatByteSize( pAnnotation->Size(), szSize, ARRAYSIZE(szSize) );
  136. LvItem.mask = LVIF_TEXT;
  137. LvItem.iItem = nItemIndex;
  138. LvItem.iSubItem = 2;
  139. LvItem.pszText = szSize;
  140. //
  141. // Set the subitem
  142. //
  143. ListView_SetItem( hwndList, &LvItem );
  144. }
  145. else
  146. {
  147. WIA_ERROR((TEXT("Couldn't insert the item")));
  148. }
  149. }
  150. else
  151. {
  152. WIA_ERROR((TEXT("Couldn't create the annotation")));
  153. }
  154. }
  155. else
  156. {
  157. WIA_ERROR((TEXT("Couldn't add the icon")));
  158. }
  159. }
  160. else
  161. {
  162. WIA_ERROR((TEXT("Couldn't get the image list")));
  163. }
  164. }
  165. else
  166. {
  167. WIA_ERROR((TEXT("Couldn't get the window")));
  168. }
  169. }
  170. void CAttachmentCommonPropertyPage::Initialize()
  171. {
  172. WIA_PUSH_FUNCTION((TEXT("CAttachmentCommonPropertyPage::Initialize")));
  173. //
  174. // Get the listview
  175. //
  176. HWND hwndList = GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST );
  177. if (hwndList)
  178. {
  179. //
  180. // Remove all of the items from the list
  181. //
  182. ListView_DeleteAllItems(hwndList);
  183. //
  184. // Get the current image list
  185. //
  186. HIMAGELIST hImageList = ListView_GetImageList( hwndList, LVSIL_SMALL );
  187. WIA_ASSERT(hImageList != NULL);
  188. if (hImageList)
  189. {
  190. //
  191. // Remove all of the icons from the current image list
  192. //
  193. ImageList_RemoveAll(hImageList);
  194. //
  195. // Get the item type so we can see if this item has attachments
  196. //
  197. LONG nItemType = 0;
  198. if (SUCCEEDED(m_pWiaItem->GetItemType(&nItemType)))
  199. {
  200. //
  201. // If this item has attachments, enumerate and add them
  202. //
  203. if (nItemType & WiaItemTypeHasAttachments)
  204. {
  205. //
  206. // Enumerate the child items
  207. //
  208. CComPtr<IEnumWiaItem> pEnumWiaItem;
  209. if (SUCCEEDED(m_pWiaItem->EnumChildItems( &pEnumWiaItem )))
  210. {
  211. //
  212. // Get the next item
  213. //
  214. CComPtr<IWiaItem> pWiaItem;
  215. while (S_OK == pEnumWiaItem->Next(1,&pWiaItem,NULL))
  216. {
  217. //
  218. // Create an annotation and try to get all its info
  219. //
  220. CAnnotation Annotation(pWiaItem);
  221. if (SUCCEEDED(Annotation.InitializeFileFormat( m_hDefAttachmentIcon, m_strDefaultUnknownDescription, m_strEmptyDescriptionMask, m_strDefUnknownExtension )))
  222. {
  223. //
  224. // Add the annotation
  225. //
  226. AddAnnotation(hwndList,Annotation);
  227. }
  228. else
  229. {
  230. WIA_ERROR((TEXT("InitializeFileFormat failed")));
  231. }
  232. //
  233. // Free this item
  234. //
  235. pWiaItem = NULL;
  236. }
  237. }
  238. else
  239. {
  240. WIA_ERROR((TEXT("EnumChildItems failed")));
  241. }
  242. }
  243. else
  244. {
  245. CAnnotation Annotation(m_pWiaItem);
  246. if (SUCCEEDED(Annotation.InitializeFileFormat( m_hDefAttachmentIcon, m_strDefaultUnknownDescription, m_strEmptyDescriptionMask, m_strDefUnknownExtension )))
  247. {
  248. //
  249. // Add the annotation
  250. //
  251. AddAnnotation(hwndList,Annotation);
  252. }
  253. }
  254. }
  255. }
  256. }
  257. else
  258. {
  259. WIA_ERROR((TEXT("Can't get the listview window")));
  260. }
  261. UpdateControls();
  262. }
  263. LRESULT CAttachmentCommonPropertyPage::OnInitDialog( WPARAM, LPARAM lParam )
  264. {
  265. //
  266. // Get the WIA item
  267. //
  268. PROPSHEETPAGE *pPropSheetPage = reinterpret_cast<PROPSHEETPAGE*>(lParam);
  269. if (pPropSheetPage)
  270. {
  271. m_pWiaItem = reinterpret_cast<IWiaItem*>(pPropSheetPage->lParam);
  272. }
  273. if (!m_pWiaItem)
  274. {
  275. return -1;
  276. }
  277. CSimpleRect rcClient( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST ) );
  278. CSimpleString strColumnTitle;
  279. LVCOLUMN LvColumn = {0};
  280. //
  281. // Set up the various columns
  282. //
  283. ZeroMemory( &LvColumn, sizeof(LvColumn) );
  284. strColumnTitle.LoadString( IDS_ATTACHMENTS_COLTITLE_NAME, g_hInstance );
  285. LvColumn.pszText = const_cast<LPTSTR>(strColumnTitle.String());
  286. LvColumn.iSubItem = 0;
  287. LvColumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
  288. LvColumn.cx = rcClient.Width() / 3;
  289. LvColumn.fmt = LVCFMT_LEFT;
  290. ListView_InsertColumn( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST ), 0, &LvColumn );
  291. ZeroMemory( &LvColumn, sizeof(LvColumn) );
  292. strColumnTitle.LoadString( IDS_ATTACHMENTS_COLTITLE_TYPE, g_hInstance );
  293. LvColumn.pszText = const_cast<LPTSTR>(strColumnTitle.String());
  294. LvColumn.iSubItem = 1;
  295. LvColumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
  296. LvColumn.cx = rcClient.Width() / 3;
  297. LvColumn.fmt = LVCFMT_LEFT;
  298. ListView_InsertColumn( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST ), 1, &LvColumn );
  299. ZeroMemory( &LvColumn, sizeof(LvColumn) );
  300. strColumnTitle.LoadString( IDS_ATTACHMENTS_COLTITLE_SIZE, g_hInstance );
  301. LvColumn.pszText = const_cast<LPTSTR>(strColumnTitle.String());
  302. LvColumn.iSubItem = 2;
  303. LvColumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
  304. LvColumn.cx = rcClient.Width() - (rcClient.Width() / 3 * 2);
  305. LvColumn.fmt = LVCFMT_RIGHT;
  306. ListView_InsertColumn( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST ), 2, &LvColumn );
  307. //
  308. // Create an image list for the icons
  309. //
  310. HIMAGELIST hImageList = ImageList_Create( SMALL_ICON_SIZE, SMALL_ICON_SIZE, ILC_MASK|PrintScanUtil::CalculateImageListColorDepth(), 5, 5 );
  311. if (hImageList)
  312. {
  313. //
  314. // Set the image list
  315. //
  316. ListView_SetImageList( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST ), hImageList, LVSIL_SMALL );
  317. }
  318. //
  319. // Get the default strings used for information we can't derive from the item itself
  320. //
  321. m_hDefAttachmentIcon = reinterpret_cast<HICON>(LoadImage( g_hInstance, MAKEINTRESOURCE(IDI_ATTACHMENTSDLG_DEFICON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR ) );
  322. m_strDefaultUnknownDescription.LoadString( IDS_ATTACHMENTSDLG_UNKNOWNDESCRIPTION, g_hInstance );
  323. m_strEmptyDescriptionMask.LoadString( IDS_ATTACHMENTSDLG_EMPTYDESCRIPTIONMASK, g_hInstance );
  324. m_strDefUnknownExtension.LoadString( IDS_ATTACHMENTSDLG_UNKNOWNEXTENSION, g_hInstance );
  325. return TRUE;
  326. }
  327. LRESULT CAttachmentCommonPropertyPage::OnHelp( WPARAM wParam, LPARAM lParam )
  328. {
  329. return WiaHelp::HandleWmHelp( wParam, lParam, g_HelpIDs );
  330. }
  331. LRESULT CAttachmentCommonPropertyPage::OnContextMenu( WPARAM wParam, LPARAM lParam )
  332. {
  333. return WiaHelp::HandleWmContextMenu( wParam, lParam, g_HelpIDs );
  334. }
  335. LRESULT CAttachmentCommonPropertyPage::OnListDeleteItem( WPARAM, LPARAM lParam )
  336. {
  337. //
  338. // Delete the CAnnotation stored in each lParam as it the listview item is deleted
  339. //
  340. NMLISTVIEW *pNmListView = reinterpret_cast<NMLISTVIEW*>(lParam);
  341. if (pNmListView)
  342. {
  343. CAnnotation *pAnnotation = reinterpret_cast<CAnnotation*>(pNmListView->lParam);
  344. if (pAnnotation)
  345. {
  346. delete pAnnotation;
  347. }
  348. }
  349. return 0;
  350. }
  351. bool CAttachmentCommonPropertyPage::IsPlaySupported( const GUID &guidFormat )
  352. {
  353. //
  354. // For now we can only play WAV files
  355. //
  356. return ((guidFormat == WiaAudFmt_WAV) != 0 || (guidFormat == WiaImgFmt_TXT) != 0);
  357. }
  358. //
  359. // Update the status of dependent controls when the selection changes
  360. //
  361. LRESULT CAttachmentCommonPropertyPage::OnListItemChanged( WPARAM, LPARAM lParam )
  362. {
  363. NMLISTVIEW *pNmListView = reinterpret_cast<NMLISTVIEW*>(lParam);
  364. if (pNmListView)
  365. {
  366. if (pNmListView->uChanged & LVIF_STATE)
  367. {
  368. UpdateControls();
  369. }
  370. }
  371. return 0;
  372. }
  373. LRESULT CAttachmentCommonPropertyPage::OnListDblClk( WPARAM, LPARAM lParam )
  374. {
  375. NMITEMACTIVATE *pNmItemActivate = reinterpret_cast<NMITEMACTIVATE*>(lParam);
  376. if (pNmItemActivate)
  377. {
  378. PlayItem(pNmItemActivate->iItem);
  379. }
  380. return 0;
  381. }
  382. //
  383. // Update the dependent controls
  384. //
  385. void CAttachmentCommonPropertyPage::UpdateControls(void)
  386. {
  387. //
  388. // If the current item is not playable, disable the play button
  389. //
  390. CAnnotation *pAnnotation = GetAttachment(GetCurrentSelection());
  391. BOOL bEnablePlay = FALSE;
  392. if (pAnnotation)
  393. {
  394. if (IsPlaySupported(pAnnotation->FileFormat().Format()))
  395. {
  396. bEnablePlay = TRUE;
  397. }
  398. }
  399. EnableWindow( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_PLAY ), bEnablePlay );
  400. }
  401. //
  402. // Find the currently selected item, if there is one
  403. //
  404. int CAttachmentCommonPropertyPage::GetCurrentSelection(void)
  405. {
  406. int nResult = -1;
  407. HWND hWnd = GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST );
  408. if (hWnd)
  409. {
  410. int nCount = ListView_GetItemCount(hWnd);
  411. for (int i=0;i<nCount;i++)
  412. {
  413. if (ListView_GetItemState(hWnd,i,LVIS_SELECTED) & LVIS_SELECTED)
  414. {
  415. nResult = i;
  416. break;
  417. }
  418. }
  419. }
  420. return nResult;
  421. }
  422. //
  423. // Get the CAttachment* from the lParam for the nIndex'th item
  424. //
  425. CAnnotation *CAttachmentCommonPropertyPage::GetAttachment( int nIndex )
  426. {
  427. CAnnotation *pResult = NULL;
  428. HWND hWnd = GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_ATTACHMENTLIST );
  429. if (hWnd)
  430. {
  431. LV_ITEM lvItem = {0};
  432. lvItem.mask = LVIF_PARAM;
  433. lvItem.iItem = nIndex;
  434. if (ListView_GetItem( hWnd, &lvItem ))
  435. {
  436. pResult = reinterpret_cast<CAnnotation*>(lvItem.lParam);
  437. }
  438. }
  439. return pResult;
  440. }
  441. void CAttachmentCommonPropertyPage::PlayItem( int nIndex )
  442. {
  443. WIA_PUSH_FUNCTION((TEXT("CAttachmentCommonPropertyPage::PlayItem( %d )"), nIndex ));
  444. //
  445. // This will take a while
  446. //
  447. CWaitCursor wc;
  448. //
  449. // Get the attachement data for this item
  450. //
  451. CAnnotation *pAnnotation = GetAttachment(nIndex);
  452. if (pAnnotation)
  453. {
  454. //
  455. // Make sure we can play this format before we go to the trouble of getting the data
  456. //
  457. if (IsPlaySupported(pAnnotation->FileFormat().Format()))
  458. {
  459. //
  460. // Get the window that has the initial focus, so we can reset it after we enable the play button
  461. //
  462. HWND hWndFocus = GetFocus();
  463. //
  464. // Disable the play button so the user can't click on it a million times
  465. //
  466. EnableWindow( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_PLAY ), FALSE );
  467. //
  468. // Create an annotation helper to transfer the data
  469. //
  470. CComPtr<IWiaAnnotationHelpers> pWiaAnnotationHelpers;
  471. HRESULT hr = CoCreateInstance( CLSID_WiaDefaultUi, NULL, CLSCTX_INPROC_SERVER, IID_IWiaAnnotationHelpers, (void**)&pWiaAnnotationHelpers );
  472. if (SUCCEEDED(hr))
  473. {
  474. //
  475. // Transfer the data and make sure it is valid
  476. //
  477. PBYTE pBuffer = NULL;
  478. DWORD dwLength = 0;
  479. hr = pWiaAnnotationHelpers->TransferAttachmentToMemory( pAnnotation->WiaItem(), pAnnotation->FileFormat().Format(), m_hWnd, &pBuffer, &dwLength );
  480. if (SUCCEEDED(hr) && pBuffer && dwLength)
  481. {
  482. CWaitCursor wc;
  483. UpdateWindow(m_hWnd);
  484. //
  485. // If this is a WAV file, play it using PlaySound. It can't be async, because we are going to
  486. // delete the buffer right after we call it.
  487. //
  488. if (WiaAudFmt_WAV == pAnnotation->FileFormat().Format())
  489. {
  490. if (!PlaySound( reinterpret_cast<LPCTSTR>(pBuffer), NULL, SND_MEMORY ))
  491. {
  492. WIA_TRACE((TEXT("PlaySound returned FALSE")));
  493. }
  494. }
  495. if (WiaImgFmt_TXT == pAnnotation->FileFormat().Format())
  496. {
  497. //
  498. // We need to copy the text to a new buffer so we can NULL terminate it,
  499. // so allocate a dwLength+1 char bufferr
  500. //
  501. LPSTR pszTemp = new CHAR[dwLength+1];
  502. if (pszTemp)
  503. {
  504. //
  505. // Copy the buffer and null terminate it
  506. //
  507. CopyMemory( pszTemp, pBuffer, dwLength );
  508. pszTemp[dwLength] = '\0';
  509. //
  510. // Prepare the data and display the dialog
  511. //
  512. CTextDialog::CData Data( CSimpleStringConvert::WideString(CSimpleStringAnsi(reinterpret_cast<LPCSTR>(pszTemp))), true );
  513. DialogBoxParam( g_hInstance, MAKEINTRESOURCE(IDD_TEXT), m_hWnd, CTextDialog::DialogProc, reinterpret_cast<LPARAM>(&Data) );
  514. //
  515. // Release the temp buffer
  516. //
  517. delete[] pszTemp;
  518. }
  519. }
  520. //
  521. // Free the data
  522. //
  523. CoTaskMemFree(pBuffer);
  524. }
  525. }
  526. //
  527. // Re-enable the play button
  528. //
  529. EnableWindow( GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_PLAY ), TRUE );
  530. //
  531. // Restore the focus
  532. //
  533. SetFocus( hWndFocus ? hWndFocus : GetDlgItem( m_hWnd, IDC_ATTACHMENTSDLG_PLAY ) );
  534. }
  535. }
  536. }
  537. void CAttachmentCommonPropertyPage::OnPlay( WPARAM, LPARAM )
  538. {
  539. WIA_PUSH_FUNCTION((TEXT("CAttachmentCommonPropertyPage::OnPlay")));
  540. PlayItem(GetCurrentSelection());
  541. }
  542. LRESULT CAttachmentCommonPropertyPage::OnNotify( WPARAM wParam, LPARAM lParam )
  543. {
  544. SC_BEGIN_NOTIFY_MESSAGE_HANDLERS()
  545. {
  546. SC_HANDLE_NOTIFY_MESSAGE_CODE(PSN_APPLY, OnApply);
  547. SC_HANDLE_NOTIFY_MESSAGE_CODE(PSN_KILLACTIVE,OnKillActive);
  548. SC_HANDLE_NOTIFY_MESSAGE_CODE(PSN_SETACTIVE,OnSetActive);
  549. SC_HANDLE_NOTIFY_MESSAGE_CONTROL(LVN_DELETEITEM,IDC_ATTACHMENTSDLG_ATTACHMENTLIST,OnListDeleteItem);
  550. SC_HANDLE_NOTIFY_MESSAGE_CONTROL(LVN_ITEMCHANGED,IDC_ATTACHMENTSDLG_ATTACHMENTLIST,OnListItemChanged);
  551. SC_HANDLE_NOTIFY_MESSAGE_CONTROL(NM_DBLCLK,IDC_ATTACHMENTSDLG_ATTACHMENTLIST,OnListDblClk);
  552. }
  553. SC_END_NOTIFY_MESSAGE_HANDLERS();
  554. }
  555. LRESULT CAttachmentCommonPropertyPage::OnCommand( WPARAM wParam, LPARAM lParam )
  556. {
  557. SC_BEGIN_COMMAND_HANDLERS()
  558. {
  559. SC_HANDLE_COMMAND( IDC_ATTACHMENTSDLG_PLAY, OnPlay );
  560. }
  561. SC_END_COMMAND_HANDLERS();
  562. }
  563. INT_PTR CALLBACK CAttachmentCommonPropertyPage::DialogProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
  564. {
  565. SC_BEGIN_DIALOG_MESSAGE_HANDLERS(CAttachmentCommonPropertyPage)
  566. {
  567. SC_HANDLE_DIALOG_MESSAGE( WM_INITDIALOG, OnInitDialog );
  568. SC_HANDLE_DIALOG_MESSAGE( WM_NOTIFY, OnNotify );
  569. SC_HANDLE_DIALOG_MESSAGE( WM_COMMAND, OnCommand );
  570. SC_HANDLE_DIALOG_MESSAGE( WM_HELP, OnHelp );
  571. SC_HANDLE_DIALOG_MESSAGE( WM_CONTEXTMENU, OnContextMenu );
  572. }
  573. SC_END_DIALOG_MESSAGE_HANDLERS();
  574. }