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.

131 lines
3.3 KiB

  1. /****************************************************************************\
  2. WIZARD.H / OPK Wizard (OPKWIZ.EXE)
  3. Microsoft Confidential
  4. Copyright (c) Microsoft Corporation 1999
  5. All rights reserved
  6. Wizard header file for the OPK Wizard. Contains the functions for
  7. creating the wizard.
  8. 3/99 - Jason Cohen (JCOHEN)
  9. Added this new header file for the OPK Wizard as part of the
  10. Millennium rewrite.
  11. 09/2000 - Stephen Lodwick (STELO)
  12. Ported OPK Wizard to Whistler
  13. \****************************************************************************/
  14. #ifndef _WIZARD_H_
  15. #define _WIZARD_H_
  16. //
  17. // Include File(s):
  18. //
  19. #include <htmlhelp.h>
  20. #include <commctrl.h>
  21. #include "jcohen.h"
  22. //
  23. // External Macros:
  24. //
  25. #define WIZ_RESULT(hwnd, result) \
  26. SetWindowLongPtr(hwnd, DWLP_MSGRESULT, result)
  27. #define WIZ_SKIP(hwnd) \
  28. WIZ_RESULT(hwnd, -1)
  29. #define WIZ_FAIL(hwnd) \
  30. WIZ_SKIP(hwnd)
  31. #define WIZ_BUTTONS(hwnd, lparam) \
  32. SetWizardButtons(hwnd, lparam)
  33. #define WIZ_CANCEL(hwnd) \
  34. ( ( (GET_FLAG(OPK_EXIT)) || (MsgBox(GetParent(hwnd), IDS_WARN_CANCEL_WIZARD, IDS_WIZARD_TITLE, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) == IDYES) ) ? \
  35. ( (WIZ_RESULT(hwnd, 0)) ? TRUE : TRUE ) : \
  36. ( (WIZ_RESULT(hwnd, -1)) ? FALSE : FALSE ) )
  37. #define WIZ_PRESS(hwnd, msg) \
  38. PostMessage(GetParent(hwnd), PSM_PRESSBUTTON, msg, 0L)
  39. #define WIZ_EXIT(hwnd) \
  40. { \
  41. SET_FLAG(OPK_EXIT, TRUE); \
  42. WIZ_PRESS(hwnd, PSBTN_CANCEL); \
  43. }
  44. #define WIZ_HELP() \
  45. g_App.hwndHelp = HtmlHelp(NULL, g_App.szHelpFile, HH_HELP_CONTEXT, GET_FLAG(OPK_OEM) ? g_App.dwCurrentHelp+200 : g_App.dwCurrentHelp)
  46. #define WIZ_NEXTONAUTO(hwnd, msg) \
  47. { \
  48. if(GET_FLAG(OPK_AUTORUN))\
  49. {\
  50. WIZ_PRESS(hwnd, msg);\
  51. }\
  52. }
  53. #define DEFAULT_PAGE_FLAGS ( PSP_DEFAULT | \
  54. PSP_HASHELP | \
  55. PSP_USEHEADERTITLE | \
  56. PSP_USEHEADERSUBTITLE )
  57. //
  58. // Type definitions
  59. //
  60. // Structure needed for Tree Dilogs
  61. //
  62. typedef struct _TREEDLG
  63. {
  64. DWORD dwResource;
  65. DLGPROC dlgWindowProc;
  66. DWORD dwTitle;
  67. DWORD dwSubTitle;
  68. HWND hWindow;
  69. HTREEITEM hItem;
  70. BOOL bVisible;
  71. } TREEDLG, *PTREEDLG, *LPTREEDLG;
  72. // Structure needed for Wizard Dilogs
  73. //
  74. typedef struct _WIZDLG
  75. {
  76. DWORD dwResource;
  77. DLGPROC dlgWindowProc;
  78. DWORD dwTitle;
  79. DWORD dwSubTitle;
  80. DWORD dwFlags;
  81. } WIZDLG, *PWIZDLG, *LPWIZDLG;
  82. // Structure needed for Wizard Dilogs
  83. //
  84. typedef struct _SPLASHDLG
  85. {
  86. DWORD dwResource;
  87. DLGPROC dlgWindowProc;
  88. HWND hWindow;
  89. } SPLASHDLG, *PSPLASHDLG, *LPSPLASHDLG;
  90. //
  91. // External Function Prototype(s):
  92. //
  93. int CreateWizard(HINSTANCE, HWND);
  94. int CreateMaintenanceWizard(HINSTANCE, HWND);
  95. int CALLBACK WizardCallbackProc(HWND, UINT, LPARAM);
  96. LONG CALLBACK WizardSubWndProc(HWND , UINT , WPARAM , LPARAM );
  97. LRESULT CALLBACK MaintDlgProc(HWND, UINT, WPARAM, LPARAM);
  98. static HTREEITEM TreeAddItem(HWND, HTREEITEM, LPTSTR);
  99. void SetWizardButtons(HWND hwnd, DWORD dwButtons);
  100. #endif // _WIZARD_H_