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.

169 lines
5.0 KiB

  1. ////////////////////////////////////////////////////////////////
  2. //
  3. // this file is for global macros and global variables
  4. // macros in the first section, variables (and macros associated with those variabls in the second
  5. // (look for BEGIN GLOBALS
  6. //
  7. ////////////////////////////////////////////////////////////////
  8. // Map KERNEL32 unicode string functions to SHLWAPI
  9. #define lstrcmpW StrCmpW
  10. #define lstrcmpiW StrCmpIW
  11. #define lstrcpyW StrCpyW
  12. #define lstrcpynW StrCpyNW
  13. #define lstrcatW StrCatW
  14. #define c_szNULL TEXT("")
  15. #define c_szHelpFile TEXT("iexplore.hlp")
  16. #define MAX_TOOLTIP_STRING 80
  17. // status bar pane numbers actually used to create the controls - in left-to-right order
  18. #define STATUS_PANES 6
  19. #define STATUS_PANE_NAVIGATION 0
  20. #define STATUS_PANE_PROGRESS 1
  21. #define STATUS_PANE_OFFLINE 2
  22. #define STATUS_PANE_PRINTER 2 // printer and offline share a spot
  23. #define STATUS_PANE_PRIVACY 3
  24. #define STATUS_PANE_SSL 4
  25. #define STATUS_PANE_ZONE 5
  26. #define ZONES_PANE_WIDTH 220
  27. // logical defines for grfKeyState bits
  28. #define FORCE_COPY (MK_CONTROL | MK_LBUTTON) // means copy
  29. #define FORCE_LINK (MK_LBUTTON | MK_CONTROL | MK_SHIFT) // means link
  30. // the only place ITB_MAX is really used is to make sure we don't have
  31. // one of the distinguished values (e.g. ITB_VIEW, for both correctness
  32. // and perf). technically that means we can have ITB_MAX = (INT_MAX - 1),
  33. // but 32000 ought to be plenty big enough and it's probably a bit safer
  34. // in terms of collisions w/ ITB_VIEW.
  35. #define ITB_MAX 32000 // max #
  36. #define ITB_CSTATIC 2 // statically allocated guys
  37. #define ITB_CGROW 2 // dynamic guys chunk size
  38. // CASSERT(ITB_CSTATIC % ITB_CGROW == 0);
  39. #define ISVISIBLE(hwnd) ((GetWindowStyle(hwnd) & WS_VISIBLE) == WS_VISIBLE)
  40. // this is for the file menus recently visited list.
  41. // it represents the count of entries both back and forward
  42. // that should be on the menu.
  43. #define CRECENTMENU_MAXEACH 5
  44. // shorthand
  45. #ifndef ATOMICRELEASE
  46. #ifdef __cplusplus
  47. #define ATOMICRELEASET(p, type) { if(p) { type* punkT=p; p=NULL; punkT->Release();} }
  48. #else
  49. #define ATOMICRELEASET(p, type) { if(p) { type* punkT=p; p=NULL; punkT->lpVtbl->Release(punkT);} }
  50. #endif
  51. // doing this as a function instead of inline seems to be a size win.
  52. //
  53. #ifdef NOATOMICRELESEFUNC
  54. #define ATOMICRELEASE(p) ATOMICRELEASET(p, IUnknown)
  55. #else
  56. # ifdef __cplusplus
  57. # define ATOMICRELEASE(p) IUnknown_SafeReleaseAndNullPtr(p)
  58. # else
  59. # define ATOMICRELEASE(p) IUnknown_AtomicRelease((LPVOID*)&p)
  60. # endif
  61. #endif
  62. #endif //ATOMICRELEASE
  63. #ifdef SAFERELEASE
  64. #undef SAFERELEASE
  65. #endif
  66. #define SAFERELEASE(p) ATOMICRELEASE(p)
  67. #ifdef UNICODE
  68. typedef WCHAR TUCHAR, *PTUCHAR;
  69. #else /* UNICODE */
  70. typedef unsigned char TUCHAR, *PTUCHAR;
  71. #endif /* UNICODE */
  72. #define LoadMenuPopup(id) SHLoadMenuPopup(MLGetHinst(), id)
  73. #define PropagateMessage SHPropagateMessage
  74. #define MenuIndexFromID SHMenuIndexFromID
  75. #define Menu_RemoveAllSubMenus SHRemoveAllSubMenus
  76. #define _EnableMenuItem SHEnableMenuItem
  77. #define _CheckMenuItem SHCheckMenuItem
  78. #define REGSTR_PATH_EXPLORERA "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
  79. #define REGSTR_KEY_STREAMMRUA REGSTR_PATH_EXPLORERA "\\StreamMRU"
  80. #ifdef UNICODE
  81. #define REGSTR_KEY_STREAMMRU TEXT(REGSTR_PATH_EXPLORERA) TEXT("\\StreamMRU")
  82. #else // UNICODE
  83. #define REGSTR_KEY_STREAMMRU REGSTR_KEY_STREAMMRUA
  84. #endif // UNICODE
  85. ///////////////////////////////////////////////////////////////////////////////
  86. ///// BEGIN GLOBALS
  87. #ifdef __cplusplus
  88. extern "C" { /* Assume C declarations for C++. */
  89. #endif /* __cplusplus */
  90. extern HINSTANCE g_hinst;
  91. #define HINST_THISDLL g_hinst
  92. extern BOOL g_fRunningOnNT;
  93. extern BOOL g_bRunOnNT5;
  94. extern BOOL g_bRunOnMemphis;
  95. extern BOOL g_fRunOnFE;
  96. extern BOOL g_fRunOnWhistler;
  97. extern BOOL g_fIE;
  98. //
  99. // Is Mirroring APIs enabled (BiDi Memphis and NT5 only)
  100. //
  101. extern BOOL g_bMirroredOS;
  102. extern HINSTANCE g_hinst;
  103. #define HINST_THISDLL g_hinst
  104. #define SID_SDropBlocker CLSID_SearchBand
  105. #define FillExecInfo(_info, _hwnd, _verb, _file, _params, _dir, _show) \
  106. (_info).hwnd = _hwnd; \
  107. (_info).lpVerb = _verb; \
  108. (_info).lpFile = _file; \
  109. (_info).lpParameters = _params; \
  110. (_info).lpDirectory = _dir; \
  111. (_info).nShow = _show; \
  112. (_info).fMask = 0; \
  113. (_info).cbSize = sizeof(SHELLEXECUTEINFO);
  114. extern LCID g_lcidLocale;
  115. //
  116. // Globals (per-process)
  117. //
  118. extern LONG g_cThreads;
  119. extern LONG g_cModelessDlg;
  120. extern UINT g_tidParking; // parking thread
  121. extern HWND g_hDlgActive;
  122. extern UINT g_msgMSWheel;
  123. extern BOOL g_fShowCompColor;
  124. extern COLORREF g_crAltColor;
  125. extern HPALETTE g_hpalHalftone;
  126. extern const GUID CGID_PrivCITCommands;
  127. #ifdef __cplusplus
  128. }; /* End of extern "C" {. */
  129. #endif /* __cplusplus */