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.

154 lines
5.4 KiB

  1. /*
  2. * COMMON.H
  3. *
  4. * Structures and definitions applicable to all OLE 2.0 UI dialogs.
  5. *
  6. * Copyright (c)1992 Microsoft Corporation, All Right Reserved
  7. */
  8. #ifndef _COMMON_H_
  9. #define _COMMON_H_
  10. // Macros to handle control message packing between Win16 and Win32
  11. #ifndef COMMANDPARAMS
  12. #define COMMANDPARAMS(wID, wCode, hWndMsg) \
  13. WORD wID = LOWORD(wParam); \
  14. WORD wCode = HIWORD(wParam); \
  15. HWND hWndMsg = (HWND)lParam;
  16. #endif
  17. #ifndef SendCommand
  18. #define SendCommand(hWnd, wID, wCode, hControl) \
  19. SendMessage(hWnd, WM_COMMAND, MAKELONG(wID, wCode) \
  20. , (LPARAM)hControl)
  21. #endif
  22. // Property labels used to store dialog structures and fonts
  23. #define STRUCTUREPROP TEXT("Structure")
  24. #define FONTPROP TEXT("Font")
  25. #ifndef WM_HELP
  26. // WM_HELP is new Windows 95 help message
  27. #define WM_HELP 0x0053
  28. // WM_CONTEXTMENU is new Windows 95 right button menus
  29. #define WM_CONTEXTMENU 0x007B
  30. typedef struct tagHELPINFO /* Structure pointed to by lParam of WM_HELP */
  31. {
  32. UINT cbSize; /* Size in bytes of this struct */
  33. int iContextType; /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */
  34. int iCtrlId; /* Control Id or a Menu item Id. */
  35. HANDLE hItemHandle; /* hWnd of control or hMenu. */
  36. DWORD dwContextId; /* Context Id associated with this item */
  37. POINT MousePos; /* Mouse Position in screen co-ordinates */
  38. } HELPINFO, FAR *LPHELPINFO;
  39. #define HELP_CONTEXTMENU 0x000a
  40. #define HELP_WM_HELP 0x000c
  41. #endif //!WM_HELP
  42. #ifndef WS_EX_CONTEXTHELP
  43. #define WS_EX_CONTEXTHELP 0x0400L
  44. #endif
  45. #ifndef OFN_EXPLORER
  46. #define OFN_EXPLORER 0x00080000
  47. #endif
  48. #ifndef WS_EX_CLIENTEDGE
  49. #define WS_EX_CLIENTEDGE 0x200
  50. #endif
  51. /*
  52. * Standard structure for all dialogs. This commonality lets us make
  53. * a single piece of code that will validate this entire structure and
  54. * perform any necessary initialization.
  55. */
  56. typedef struct tagOLEUISTANDARD
  57. {
  58. // These IN fields are standard across all OLEUI dialog functions.
  59. DWORD cbStruct; // Structure Size
  60. DWORD dwFlags; // IN-OUT: Flags
  61. HWND hWndOwner; // Owning window
  62. LPCTSTR lpszCaption; // Dialog caption bar contents
  63. LPFNOLEUIHOOK lpfnHook; // Hook callback
  64. LPARAM lCustData; // Custom data to pass to hook
  65. HINSTANCE hInstance; // Instance for customized template name
  66. LPCTSTR lpszTemplate; // Customized template name
  67. HRSRC hResource; // Customized template handle
  68. } OLEUISTANDARD, *POLEUISTANDARD, FAR *LPOLEUISTANDARD;
  69. // Function prototypes
  70. // COMMON.CPP
  71. UINT WINAPI UStandardValidation(LPOLEUISTANDARD, const UINT, HGLOBAL*);
  72. UINT WINAPI UStandardInvocation(DLGPROC, LPOLEUISTANDARD, HGLOBAL, LPTSTR);
  73. LPVOID WINAPI LpvStandardInit(HWND, UINT, HFONT* = NULL);
  74. LPVOID WINAPI LpvStandardEntry(HWND, UINT, WPARAM, LPARAM, UINT FAR *);
  75. UINT WINAPI UStandardHook(LPVOID, HWND, UINT, WPARAM, LPARAM);
  76. void WINAPI StandardCleanup(LPVOID, HWND);
  77. void WINAPI StandardShowDlgItem(HWND hDlg, int idControl, int nCmdShow);
  78. void WINAPI StandardEnableDlgItem(HWND hDlg, int idControl, BOOL bEnable);
  79. BOOL WINAPI StandardResizeDlgY(HWND hDlg);
  80. void WINAPI StandardHelp(HWND, UINT);
  81. void WINAPI StandardContextMenu(WPARAM, LPARAM, UINT nIDD);
  82. UINT InternalObjectProperties(LPOLEUIOBJECTPROPS lpOP, BOOL fWide);
  83. int WINAPI StandardPropertySheet(LPPROPSHEETHEADER lpPS, BOOL fWide);
  84. int WINAPI StandardInitCommonControls();
  85. HICON StandardExtractIcon(HINSTANCE hInst, LPCTSTR lpszExeFileName, UINT nIconIndex);
  86. BOOL StandardGetOpenFileName(LPOPENFILENAME lpofn);
  87. short StandardGetFileTitle(LPCTSTR lpszFile, LPTSTR lpszTitle, WORD cbBuf);
  88. // shared globals: registered messages
  89. extern UINT uMsgHelp;
  90. extern UINT uMsgEndDialog;
  91. extern UINT uMsgBrowse;
  92. extern UINT uMsgChangeIcon;
  93. extern UINT uMsgFileOKString;
  94. extern UINT uMsgCloseBusyDlg;
  95. extern UINT uMsgConvert;
  96. extern UINT uMsgChangeSource;
  97. extern UINT uMsgAddControl;
  98. extern UINT uMsgBrowseOFN;
  99. typedef struct tagTASKDATA
  100. {
  101. HINSTANCE hInstCommCtrl;
  102. HINSTANCE hInstShell;
  103. HINSTANCE hInstComDlg;
  104. } TASKDATA;
  105. STDAPI_(TASKDATA*) GetTaskData(); // returns TASKDATA for current process
  106. extern BOOL bWin4; // TRUE if running Win4 or greater
  107. extern BOOL bSharedData; // TRUE if runing Win32s
  108. /////////////////////////////////////////////////////////////////////////////
  109. // Maximum buffer sizes
  110. // Maximum key size we read from the RegDB.
  111. #define OLEUI_CCHKEYMAX 256 // same in geticon.c too
  112. #define OLEUI_CCHKEYMAX_SIZE OLEUI_CCHKEYMAX*sizeof(TCHAR)
  113. // Maximum length of Object menu
  114. #define OLEUI_OBJECTMENUMAX 256
  115. // Maximim length of a path in BYTEs
  116. #define MAX_PATH_SIZE (MAX_PATH*sizeof(TCHAR))
  117. // Icon label length
  118. #define OLEUI_CCHLABELMAX 80 // same in geticon.c too (doubled)
  119. #define OLEUI_CCHLABELMAX_SIZE OLEUI_CCHLABELMAX*sizeof(TCHAR)
  120. // Length of the CLSID string
  121. #define OLEUI_CCHCLSIDSTRING 39
  122. #define OLEUI_CCHCLSIDSTRING_SIZE OLEUI_CCHCLSIDSTRING*sizeof(TCHAR)
  123. #endif //_COMMON_H_