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.

82 lines
2.2 KiB

  1. // C$$ClassType$$PS.cpp : Implementation of C$$ClassType$$PS
  2. #include "stdafx.h"
  3. #include "$$root$$.h"
  4. #include "$$ClassType$$PS.h"
  5. BOOL CALLBACK C$$ClassType$$PS_DlgProc(HWND hwnd, UINT uMsg,
  6. WPARAM wParam, LPARAM lParam)
  7. {
  8. BOOL bRet = FALSE;
  9. static C$$ClassType$$PS* ppse = NULL;
  10. switch(uMsg)
  11. {
  12. case WM_INITDIALOG:
  13. ppse = (CPS*)lParam;
  14. bRet = TRUE;
  15. break;
  16. case WM_NOTIFY:
  17. switch(((NMHDR*)lParam)->code)
  18. {
  19. case PSN_APPLY:
  20. // TODO: Add code to apply changes in the dialog
  21. SetWindowLong(hwnd, DWL_MSGRESULT, TRUE);
  22. bRet = TRUE;
  23. break;
  24. case PSN_KILLACTIVE:
  25. // page is being deactivated either by another page being
  26. // activated, or user chose OK.
  27. SetWindowLong(hwnd, DWL_MSGRESULT, FALSE);
  28. bRet = TRUE;
  29. break;
  30. case PSN_RESET:
  31. // TODO: Add any cleanup code
  32. SetWindowLong(hwnd, DWL_MSGRESULT, FALSE);
  33. bRet = TRUE;
  34. break;
  35. }
  36. }
  37. return bRet;
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // C$$ClassType$$PS
  41. STDMETHODIMP C$$ClassType$$PS::Initialize (LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj,
  42. HKEY hkeyProgID)
  43. {
  44. return NOERROR;
  45. }
  46. STDMETHODIMP C$$ClassType$$PS::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage,
  47. LPARAM lParam)
  48. {
  49. PROPSHEETPAGE psp;
  50. HPROPSHEETPAGE hpage;
  51. psp.dwSize = sizeof(psp); // no extra data
  52. psp.dwFlags = PSP_USEREFPARENT;
  53. psp.hInstance = _Module.GetModuleInstance();
  54. psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE);
  55. psp.pfnDlgProc = C$$ClassType$$PS_DlgProc;
  56. psp.pcRefParent = (UINT*)&_Module.m_nLockCnt;
  57. psp.lParam = (LPARAM)this;
  58. hpage = CreatePropertySheetPage(&psp);
  59. if (hpage)
  60. {
  61. if (!lpfnAddPage(hpage, lParam))
  62. DestroyPropertySheetPage(hpage);
  63. }
  64. return NOERROR;
  65. }
  66. STDMETHODIMP C$$ClassType$$PS::ReplacePage(UINT uPageID,
  67. LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
  68. {
  69. // TODO: Implement this method if you want to replace a
  70. // Property page in a control panel
  71. return S_FALSE;
  72. }