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.

215 lines
6.2 KiB

  1. #ifndef _CABINET_H
  2. #define _CABINET_H
  3. #include <w4warn.h>
  4. /*
  5. * Level 4 warnings to be turned on.
  6. * Do not disable any more level 4 warnings.
  7. */
  8. #pragma warning(disable:4127) // conditional expression is constant
  9. #pragma warning(disable:4189) // 'fIoctlSuccess' : local variable is initialized but not referenced
  10. #pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
  11. #pragma warning(disable:4245) // conversion signed/unsigned mismatch
  12. #pragma warning(disable:4509) // nonstandard extension used: 'GetUserAssist' uses SEH and 'debug_crit' has destructor
  13. #pragma warning(disable:4701) // local variable 'hfontOld' may be used without having been initialized
  14. #pragma warning(disable:4706) // assignment within conditional expression
  15. #pragma warning(disable:4328) // indirection alignment of formal parameter 1(4) is greater than the actual argument alignment (1)
  16. #define _WINMM_ // for DECLSPEC_IMPORT
  17. #define STRICT
  18. #define OEMRESOURCE
  19. #define OVERRIDE_SHLWAPI_PATH_FUNCTIONS // see comment in shsemip.h
  20. #ifdef WINNT
  21. #include <nt.h> // Some of the NT specific code calls Rtl functions
  22. #include <ntrtl.h> // which requires all of these header files...
  23. #include <nturtl.h>
  24. #endif
  25. #include <windows.h>
  26. #include <commctrl.h>
  27. #include <shfusion.h>
  28. #include <msginaexports.h>
  29. // if you include atlstuff.h, you don't get windowsx.h. so we define needed functions here
  30. __inline HBRUSH SelectBrush(HDC hdc, HBRUSH hbr) { return (HBRUSH)SelectObject(hdc, (HGDIOBJ)(HBRUSH)hbr); }
  31. __inline HFONT SelectFont(HDC hdc, HFONT hfont) { return (HFONT)SelectObject(hdc, (HGDIOBJ)(HFONT)hfont); }
  32. __inline HBITMAP SelectBitmap(HDC hdc, HBITMAP hbm) { return (HBITMAP)SelectObject(hdc, (HGDIOBJ)(HBITMAP)hbm); }
  33. __inline WNDPROC SubclassWindow(HWND hwnd, WNDPROC lpfn) { return (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LPARAM)lpfn); }
  34. #include <windowsx.h>
  35. #include <ole2.h>
  36. #include <wininet.h>
  37. #include <shlobj.h> // Includes <fcext.h>
  38. #include <shsemip.h>
  39. #include <shellapi.h>
  40. #include <cpl.h>
  41. #include <ddeml.h>
  42. #include <cfgmgr32.h>
  43. #ifdef UNICODE
  44. #define CP_WINNATURAL CP_WINUNICODE
  45. #else
  46. #define CP_WINNATURAL CP_WINANSI
  47. #endif
  48. #define DISALLOW_Assert
  49. #include <debug.h> // our version of Assert etc.
  50. #include <port32.h>
  51. #include <heapaloc.h>
  52. #include <shellp.h>
  53. #include <ccstock.h>
  54. #include <shlobjp.h>
  55. #include <shlwapi.h>
  56. #include "dbt.h"
  57. #include "trayp.h"
  58. #include <shdocvw.h>
  59. #include <uxtheme.h>
  60. #include <tmschema.h>
  61. #include <runonce.h>
  62. #include "shguidp.h"
  63. #include "ieguidp.h"
  64. #include "shdguid.h"
  65. #include "uastrfnc.h"
  66. #include "vdate.h" // buffer validation (debug only)
  67. #include <desktopp.h>
  68. //
  69. // Trace/dump/break flags specific to explorer.
  70. // (Standard flags defined in shellp.h)
  71. //
  72. // Trace flags
  73. #define TF_DDE 0x00000100 // DDE traces
  74. #define TF_TARGETFRAME 0x00000200 // Target frame
  75. #define TF_TRAYDOCK 0x00000400 // Tray dock
  76. #define TF_TRAY 0x00000800 // Tray
  77. // "Olde names"
  78. #define DM_DDETRACE TF_DDE
  79. #define DM_TARGETFRAME TF_TARGETFRAME
  80. #define DM_TRAYDOCK TF_TRAYDOCK
  81. // Function trace flags
  82. #define FTF_DDE 0x00000001 // DDE functions
  83. #define FTF_TARGETFRAME 0x00000002 // Target frame methods
  84. // Dump flags
  85. #define DF_DDE 0x00000001 // DDE package
  86. #define DF_DELAYLOADDLL 0x00000002 // Delay load
  87. #ifdef __cplusplus
  88. extern "C" { /* Assume C declarations for C++ */
  89. #endif /* __cplusplus */
  90. //---------------------------------------------------------------------------
  91. // Globals
  92. extern HINSTANCE hinstCabinet; // Instance handle of the app.
  93. extern HWND v_hwndDesktop;
  94. extern HKEY g_hkeyExplorer;
  95. //
  96. // Is Mirroring APIs enabled (BiDi Memphis and NT5 only)
  97. //
  98. extern BOOL g_bMirroredOS;
  99. // Global System metrics. the desktop wnd proc will be responsible
  100. // for watching wininichanges and keeping these up to date.
  101. extern int g_fCleanBoot;
  102. extern BOOL g_fFakeShutdown;
  103. extern int g_fDragFullWindows;
  104. extern int g_cxEdge;
  105. extern int g_cyEdge;
  106. extern int g_cySize;
  107. extern int g_cyTabSpace;
  108. extern int g_cxTabSpace;
  109. extern int g_cxBorder;
  110. extern int g_cyBorder;
  111. extern int g_cxPrimaryDisplay;
  112. extern int g_cyPrimaryDisplay;
  113. extern int g_cxDlgFrame;
  114. extern int g_cyDlgFrame;
  115. extern int g_cxFrame;
  116. extern int g_cyFrame;
  117. extern int g_cxMinimized;
  118. extern int g_cxVScroll;
  119. extern int g_cyHScroll;
  120. extern BOOL g_fNoDesktop;
  121. extern UINT g_uDoubleClick;
  122. extern HWND v_hwndTray;
  123. extern HWND v_hwndStartPane;
  124. extern BOOL g_fDesktopRaised;
  125. extern const WCHAR c_wzTaskbarTheme[];
  126. // the order of these is IMPORTANT for move-tracking and profile stuff
  127. // also for the STUCK_HORIZONTAL macro
  128. #define STICK_FIRST ABE_LEFT
  129. #define STICK_LEFT ABE_LEFT
  130. #define STICK_TOP ABE_TOP
  131. #define STICK_RIGHT ABE_RIGHT
  132. #define STICK_BOTTOM ABE_BOTTOM
  133. #define STICK_LAST ABE_BOTTOM
  134. #define STICK_MAX ABE_MAX
  135. #define STUCK_HORIZONTAL(x) (x & 0x1)
  136. #if STUCK_HORIZONTAL(STICK_LEFT) || STUCK_HORIZONTAL(STICK_RIGHT) || \
  137. !STUCK_HORIZONTAL(STICK_TOP) || !STUCK_HORIZONTAL(STICK_BOTTOM)
  138. #error Invalid STICK_* constants
  139. #endif
  140. #define IsValidSTUCKPLACE(stick) IsInRange(stick, STICK_FIRST, STICK_LAST)
  141. // initcab.cpp
  142. HKEY GetSessionKey(REGSAM samDesired);
  143. void RunStartupApps();
  144. void WriteCleanShutdown(DWORD dwValue);
  145. //
  146. // Debug helper functions
  147. //
  148. void InvokeURLDebugDlg(HWND hwnd);
  149. void Cabinet_InitGlobalMetrics(WPARAM, LPTSTR);
  150. #define REGSTR_PATH_ADVANCED REGSTR_PATH_EXPLORER TEXT("\\Advanced")
  151. #define REGSTR_PATH_SMADVANCED REGSTR_PATH_EXPLORER TEXT("\\StartMenu")
  152. #define REGSTR_PATH_RUN_POLICY REGSTR_PATH_POLICIES TEXT("\\Explorer\\Run")
  153. #define REGSTR_EXPLORER_ADVANCED REGSTR_PATH_ADVANCED
  154. #define REGSTR_POLICIES_EXPLORER TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer")
  155. #undef WinHelp
  156. #define WinHelp SHWinHelp
  157. #ifdef __cplusplus
  158. }; /* End of extern "C" { */
  159. #endif // __cplusplus
  160. #define PERF_ENABLESETMARK
  161. #ifdef PERF_ENABLESETMARK
  162. void DoSetMark(LPCSTR pszMark, ULONG cbSz);
  163. #define PERFSETMARK(text) DoSetMark(text, sizeof(text))
  164. #else
  165. #define PERFSETMARK(text)
  166. #endif // PERF_ENABLESETMARK
  167. #endif // _CABINET_H