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.

2815 lines
91 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winuserp.h
  5. Abstract:
  6. Private
  7. Procedure declarations, constant definitions and macros for the User
  8. component.
  9. --*/
  10. #ifndef _WINUSERP_
  11. #define _WINUSERP_
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif /* __cplusplus */
  15. #ifdef STRICT
  16. #else /* !STRICT */
  17. #endif /* !STRICT */
  18. #ifdef STRICT
  19. #else /* !STRICT */
  20. #endif /* !STRICT */
  21. #ifdef UNICODE
  22. #else /* !UNICODE */
  23. #endif /* UNICODE */
  24. #define RT_MENUEX MAKEINTRESOURCE(13) // RT_MENU subtype
  25. #define RT_NAMETABLE MAKEINTRESOURCE(15) // removed in 3.1
  26. #define RT_DIALOGEX MAKEINTRESOURCE(18) // RT_DIALOG subtype
  27. #define RT_LAST MAKEINTRESOURCE(24)
  28. #define RT_AFXFIRST MAKEINTRESOURCE(0xF0) // reserved: AFX
  29. #define RT_AFXLAST MAKEINTRESOURCE(0xFF) // reserved: AFX
  30. /* Max number of characters. Doesn't include termination character */
  31. #define WSPRINTF_LIMIT 1024
  32. #define SETWALLPAPER_METRICS ((LPWSTR)-2)
  33. #define SB_MAX 3
  34. #define SB_CMD_MAX 8
  35. #define AW_VALID (AW_HOR_POSITIVE |\
  36. AW_HOR_NEGATIVE |\
  37. AW_VER_POSITIVE |\
  38. AW_VER_NEGATIVE |\
  39. AW_CENTER |\
  40. AW_HIDE |\
  41. AW_ACTIVATE |\
  42. AW_BLEND |\
  43. AW_SLIDE)
  44. /*
  45. * GetAppCompatFlags2 flags
  46. */
  47. #define GACF2_ANIMATIONOFF 0x00000001 // do not animate menus and listboxes
  48. #define GACF2_KCOFF 0x00000002 // do not send Keyboard Cues messages
  49. #define GACF2_NO50EXSTYLEBITS 0x00000004 // mask out post-4.0 extended style bits for SetWindowLong
  50. #define GACF2_NODRAWPATRECT 0x00000008 // disable DRAWPATTERNRECT accel via ExtEscape()
  51. #define GACF2_MSSHELLDLG 0x00000010 // if there is a request for MS Shell Dlg (which
  52. // usually maps to MS Sans Serif (bitmap) on NT 4 and
  53. // Microsoft Sans Serif (TrueType) on NT 5), then
  54. // behave as though we are using the bitmap
  55. // font (MS Sans Serif).
  56. #define GACF2_NODDETRKDYING 0x00000020 // Be like Win9x: don't post WM_DDE_TERMINATE if
  57. // the window is destroyed while in a conversation
  58. #define GACF2_GIVEUPFOREGROUND 0x00000040 // In W2k, we have changed foreground semantics to stop
  59. // foreground focus stealing by one app if another app
  60. // is active. However, this has caused a few app compat
  61. // bugs. This appcompat flag is used to enable the old foreground
  62. // focus behaviour for these bugs.
  63. #define GACF2_ACTIVEMENUS 0x00000080 // In W2k, we set the inactive look on menus that belong
  64. // to non-rofeground windows. Some applications get in trouble
  65. // see #58227
  66. #define GACF2_EDITNOMOUSEHIDE 0x00000100 // Typing in edit controls hides the cursor.
  67. // Some apps are surprised by that: #307615
  68. #define GACF2_NOBATCHING 0X00000200 // Turn GDI batching off
  69. #define GACF2_FONTSUB 0X00000400 // Only for Notes R5
  70. #define GACF2_NO50EXSTYLEBITSCW 0x00000800 // mask out post-4.0 extended style bits for CreateWindow
  71. #define GACF2_NOCUSTOMPAPERSIZES 0x00001000 // PostScript driver bit for Harvard Graphics
  72. #define GACF2_DDE 0x00002000 // all the DDE hacks
  73. #define GACF2_DEFAULTCHARSET 0x00004000 // LOGFONT bit for QuickBook OCR-A font
  74. #define GACF2_NOCHAR_DEADKEY 0x00008000 // No character composition on dead key on dead key (NT4 behavior)
  75. #define GACF2_NO_TRYEXCEPT_CALLWNDPROC \
  76. 0x00010000 // No try ~ except clause around WndProc call, let the app's handler
  77. // handle it even though it skips some API stacks.
  78. // See #359866
  79. #define GACF2_NO_INIT_ECFLAGS_ON_SETFOCUS \
  80. 0x00020000 // Do not initialize insert & replace flags (Korean specific)
  81. // in PED on WM_SETFOCUS, if this appcompat flag is set.
  82. // To workaround a bogus app bug who send input messages before setting
  83. // the focus to the edit control. See NtRaid #411686.
  84. #define GACF2_DDENOSYNC 0x00040000 // Do not reject sent dde messages even if there is
  85. // an unprocessed message in the queue.
  86. // see WhistlerRaid #95367 (Check COMPATFLAGS2_FORWOW
  87. // below also)
  88. #define GACF2_FORCEFUSION 0x00800000 // Set this flag to enable fusion in 16bit apps
  89. /*
  90. * zzzInitTask masks out pti->dwCompatFlags2
  91. * If you need to add bits for 16bit apps include
  92. * that bit in this mask
  93. *
  94. */
  95. #define COMPATFLAGS2_FORWOW GACF2_DDENOSYNC | GACF2_GIVEUPFOREGROUND | GACF2_FORCEFUSION
  96. #define GACF2_NOGHOST 0x00080000 // No window ghosting for this application. See bug #268100.
  97. #define GACF2_DDENOASYNCREG 0x00100000 // Use Sendmessage instead of PostMessage in DDE RegisterService(). See bug# 156088.
  98. #define GACF2_STRICTLLHOOK 0x00200000 // Apply strict timeout rule for LL hook. See WindowsBug 307738.
  99. #define GACF2_NOSHADOW 0x00400000 // don't apply window shadow. see bug# 364717
  100. #define GACF2_NOTIMERCBPROTECTION 0x01000000 // don't protect from unregistered WM_TIMER with lParam (callback pfn).
  101. /*
  102. * Version macros
  103. */
  104. #define VERMAX 0x9900 // ignore the version
  105. #define VER51 0x0501
  106. #define VER50 0x0500
  107. #define VER40 0x0400
  108. #define VER31 0x030A
  109. #define VER30 0x0300
  110. #define Is510Compat(dwExpWinVer) (LOWORD(dwExpWinVer) >= VER51)
  111. #define Is500Compat(dwExpWinVer) (LOWORD(dwExpWinVer) >= VER50)
  112. #define Is400Compat(dwExpWinVer) (LOWORD(dwExpWinVer) >= VER40)
  113. #define Is310Compat(dwExpWinVer) (LOWORD(dwExpWinVer) >= VER31)
  114. #define Is300Compat(dwExpWinVer) (LOWORD(dwExpWinVer) >= VER30)
  115. #define VK_NONE 0x00
  116. /*
  117. * NEC PC-9800 Series definitions
  118. */
  119. #define VK_OEM_NEC_SEPARATE 0x6C
  120. #define VK_APPCOMMAND_FIRST 0xA6
  121. #define VK_APPCOMMAND_LAST 0xB7
  122. /*
  123. * Fujitsu/OASYS definitions - clash with SpeedRacer etc.
  124. */
  125. #define VK_OEM_OAS_1 0xB4
  126. #define VK_OEM_OAS_2 0xB5
  127. #define VK_OEM_OAS_3 0xB6
  128. #define VK_OEM_OAS_4 0xB7
  129. #define VK_OEM_OAS_5 0xB8
  130. #define VK_OEM_OAS_6 0xB9
  131. #define VK_OEM_OAS_7 0xC1
  132. #define VK_OEM_OAS_8 0xC2
  133. #define VK_OEM_OAS_9 0xC3
  134. #define VK_OEM_OAS_10 0xC4
  135. #define VK_OEM_OAS_11 0xC5
  136. #define VK_OEM_OAS_12 0xC6
  137. #define VK_OEM_OAS_13 0xC7
  138. #define VK_OEM_OAS_14 0xC8
  139. #define VK_OEM_OAS_15 0xC9
  140. #define VK_OEM_OAS_16 0xCA
  141. #define VK_OEM_OAS_17 0xCB
  142. #define VK_OEM_OAS_18 0xCC
  143. #define VK_OEM_OAS_19 0xCD
  144. #define VK_OEM_OAS_20 0xCE
  145. #define VK_OEM_OAS_21 0xCF
  146. #define VK_OEM_OAS_22 0xD0
  147. #define VK_OEM_OAS_23 0xD1
  148. #define VK_OEM_OAS_24 0xD2
  149. #define VK_OEM_OAS_25 0xD3
  150. #define VK_OEM_OAS_26 0xD4
  151. #define VK_OEM_OAS_27 0xD5
  152. #define VK_OEM_OAS_28 0xD6
  153. #define VK_OEM_OAS_29 0xD7
  154. #define VK_OEM_FJ_DUMMY 0xEF
  155. #define VK_UNKNOWN 0xFF
  156. /*
  157. * Additional modifier keys.
  158. * Used for ISO9995 "Information technology - Keyboard layouts for text and
  159. * office systems" (French Canadian keyboard,
  160. */
  161. #define VK_GROUPSHIFT 0xE5
  162. #define VK_RGROUPSHIFT 0xE6
  163. #if !defined(_WIN32_WINDOWS)
  164. #define WH_HARDWARE 8
  165. #endif
  166. #ifdef REDIRECTION
  167. #define WH_HITTEST 15
  168. #endif // REDIRECTION
  169. #define WH_CHOOKS (WH_MAXHOOK - WH_MINHOOK + 1)
  170. #ifdef REDIRECTION
  171. #define HCBT_GETCURSORPOS 10
  172. #endif // REDIRECTION
  173. #define MSGF_MOVE 3
  174. #define MSGF_SIZE 4
  175. #define MSGF_CBTHOSEBAGSUSEDTHIS 7
  176. #define MSGF_MAINLOOP 8
  177. #define APPCOMMAND_FIRST 1
  178. #define APPCOMMAND_LAST 52
  179. #ifdef REDIRECTION
  180. typedef struct tagHTHOOKSTRUCT {
  181. POINT pt;
  182. HWND hwndHit;
  183. } HTHOOKSTRUCT, FAR *LPHTHOOKSTRUCT, *PHTHOOKSTRUCT;
  184. #endif // REDIRECTION
  185. #define KLF_UNLOADPREVIOUS 0x00000004
  186. #define KLF_FAILSAFE 0x00000200
  187. /*
  188. * Keyboard Layout Attributes
  189. * These are specified in the layout DLL itself, or in the registry under
  190. * MACHINE\System\CurrentControlSet\Control\Keyboard Layouts\*\Attributes
  191. * as KLF_ values between 0x00010000 and 0x00800000. Any attributes specified
  192. * by the layout DLL are ORed with the attributes obtained from the registry.
  193. */
  194. #define KLF_LRM_RLM 0x00020000
  195. #define KLF_ATTRIBUTE2 0x00040000
  196. #define KLF_ATTRIBUTE3 0x00080000
  197. #define KLF_ATTRIBUTE4 0x00100000
  198. #define KLF_ATTRIBUTE5 0x00200000
  199. #define KLF_ATTRIBUTE6 0x00400000
  200. #define KLF_ATTRIBUTE7 0x00800000
  201. #define KLF_ATTRMASK 0x00FF0000
  202. #define KLF_INITTIME 0x80000000
  203. #define KLF_VALID 0xC000039F | KLF_ATTRMASK
  204. WINUSERAPI
  205. HKL
  206. WINAPI
  207. LoadKeyboardLayoutEx(
  208. IN HKL hkl,
  209. IN LPCWSTR pwszKLID,
  210. IN UINT Flags);
  211. #ifdef REDIRECTION
  212. #define DESKTOP_QUERY_INFORMATION 0x0101L
  213. #define DESKTOP_REDIRECT 0x0102L
  214. #endif // REDIRECTION
  215. #ifndef NOWINDOWSTATION
  216. #endif /* !NOWINDOWSTATION */
  217. WINUSERAPI
  218. DWORD
  219. WINAPI
  220. CreateSystemThreads(
  221. IN LPVOID pUnused);
  222. BOOL WowWaitForMsgAndEvent(IN HANDLE hevent);
  223. WINUSERAPI VOID WINAPI RegisterSystemThread(IN DWORD flags, IN DWORD reserved);
  224. #define RST_DONTATTACHQUEUE 0x00000001
  225. #define RST_DONTJOURNALATTACH 0x00000002
  226. #define RST_ALWAYSFOREGROUNDABLE 0x00000004
  227. #define RST_FAULTTHREAD 0x00000008
  228. #define GWL_WOWWORDS (-1)
  229. #ifdef _WIN64
  230. #undef GWL_WOWWORDS
  231. #endif /* _WIN64 */
  232. #define GWLP_WOWWORDS (-1)
  233. #define GCL_WOWWORDS (-27)
  234. #define GCL_WOWMENUNAME (-29)
  235. #ifdef _WIN64
  236. #undef GCL_WOWWORDS
  237. #endif /* _WIN64 */
  238. #define GCLP_WOWWORDS (-27)
  239. #define WM_SIZEWAIT 0x0004
  240. #define WM_SETVISIBLE 0x0009
  241. #define WM_SYSTEMERROR 0x0017
  242. /*
  243. * This is used by DefWindowProc() and DefDlgProc(), it's the 16-bit version
  244. * of the WM_CTLCOLORBTN, WM_CTLCOLORDLG, ... messages.
  245. */
  246. #define WM_CTLCOLOR 0x0019
  247. #define WM_LOGOFF 0x0025
  248. #define WM_ALTTABACTIVE 0x0029
  249. #define WM_FILESYSCHANGE 0x0034
  250. #define WM_SHELLNOTIFY 0x0034
  251. #define SHELLNOTIFY_DISKFULL 0x0001
  252. #define SHELLNOTIFY_OLELOADED 0x0002
  253. #define SHELLNOTIFY_OLEUNLOADED 0x0003
  254. #define SHELLNOTIFY_WALLPAPERCHANGED 0x0004
  255. #define WM_ISACTIVEICON 0x0035
  256. #define WM_QUERYPARKICON 0x0036
  257. #define WM_WINHELP 0x0038
  258. #define WM_FULLSCREEN 0x003A
  259. #define WM_CLIENTSHUTDOWN 0x003B
  260. #define WM_DDEMLEVENT 0x003C
  261. #define MM_CALCSCROLL 0x003F
  262. #define WM_TESTING 0x0040
  263. #define WM_OTHERWINDOWCREATED 0x0042
  264. #define WM_OTHERWINDOWDESTROYED 0x0043
  265. #define WM_COPYGLOBALDATA 0x0049
  266. #define WM_LOGONNOTIFY 0x004C
  267. #define WM_KEYF1 0x004D
  268. #define WM_ACCESS_WINDOW 0x004F
  269. #define WM_FINALDESTROY 0x0070 /* really destroy (window not locked) */
  270. #define WM_MEASUREITEM_CLIENTDATA 0x0071 /* WM_MEASUREITEM bug clientdata thunked already */
  271. #define WM_SYNCTASK 0x0089
  272. #define WM_KLUDGEMINRECT 0x008B
  273. #define WM_LPKDRAWSWITCHWND 0x008C
  274. #define WM_NCMOUSEFIRST 0x00A0
  275. /*
  276. * Skip value 0x00AA, which would correspond to the non-client
  277. * mouse wheel message if there were such a message.
  278. * We do that in order to maintain a constant value for
  279. * the difference between the client and nonclient version of
  280. * a mouse message, e.g.
  281. * WM_LBUTTONDOWN - WM_NCLBUTTONDOWN == WM_XBUTTONDOWN - WM_NCXBUTTONDOWN
  282. */
  283. #define WM_NCXBUTTONFIRST 0x00AB
  284. #define WM_NCXBUTTONLAST 0X00AD
  285. #define WM_NCMOUSELAST 0x00AD
  286. #if(_WIN32_WINNT >= 0x0501)
  287. #define WM_NCUAHDRAWCAPTION 0x00AE
  288. #define WM_NCUAHDRAWFRAME 0x00AF
  289. #endif /* _WIN32_WINNT >= 0x0501 */
  290. #define WM_CONVERTREQUESTEX 0x0108
  291. #define WM_YOMICHAR 0x0108
  292. #define WM_CONVERTREQUEST 0x010A
  293. #define WM_CONVERTRESULT 0x010B
  294. #define WM_INTERIM 0x010C
  295. #define WM_SYSTIMER 0x0118
  296. #define UIS_LASTVALID UIS_INITIALIZE
  297. #define UISF_VALID (UISF_HIDEFOCUS | \
  298. UISF_HIDEACCEL | \
  299. UISF_ACTIVE)
  300. #define WM_LBTRACKPOINT 0x0131
  301. #define WM_CTLCOLORFIRST 0x0132
  302. #define WM_CTLCOLORLAST 0x0138
  303. #define MN_FIRST 0x01E0
  304. #define MN_SETHMENU (MN_FIRST + 0)
  305. // We need to expose this message for compliance.
  306. // Make sure this remains equal to (MN_FIRST + 1)
  307. #define MN_SIZEWINDOW (MN_FIRST + 2)
  308. #define MN_OPENHIERARCHY (MN_FIRST + 3)
  309. #define MN_CLOSEHIERARCHY (MN_FIRST + 4)
  310. #define MN_SELECTITEM (MN_FIRST + 5)
  311. #define MN_CANCELMENUS (MN_FIRST + 6)
  312. #define MN_SELECTFIRSTVALIDITEM (MN_FIRST + 7)
  313. #define MN_GETPPOPUPMENU (MN_FIRST + 10)
  314. #define MN_FINDMENUWINDOWFROMPOINT (MN_FIRST + 11)
  315. #define MN_SHOWPOPUPWINDOW (MN_FIRST + 12)
  316. #define MN_BUTTONDOWN (MN_FIRST + 13)
  317. #define MN_MOUSEMOVE (MN_FIRST + 14)
  318. #define MN_BUTTONUP (MN_FIRST + 15)
  319. #define MN_SETTIMERTOOPENHIERARCHY (MN_FIRST + 16)
  320. #define MN_DBLCLK (MN_FIRST + 17)
  321. #define MN_ACTIVATEPOPUP (MN_FIRST + 18)
  322. #define MN_ENDMENU (MN_FIRST + 19)
  323. #define MN_DODRAGDROP (MN_FIRST + 20)
  324. #define MN_LASTPOSSIBLE (MN_FIRST + 31)
  325. #define WM_XBUTTONFIRST 0x020B
  326. #define WM_XBUTTONLAST 0X020D
  327. #define XBUTTON_MASK (XBUTTON1 | XBUTTON2)
  328. #define WM_DROPOBJECT 0x022A
  329. #define WM_QUERYDROPOBJECT 0x022B
  330. #define WM_BEGINDRAG 0x022C
  331. #define WM_DRAGLOOP 0x022D
  332. #define WM_DRAGSELECT 0x022E
  333. #define WM_DRAGMOVE 0x022F
  334. #define WM_KANJIFIRST 0x0280
  335. #define WM_IME_SYSTEM 0x0287
  336. #define WM_KANJILAST 0x029F
  337. #define WM_TRACKMOUSEEVENT_FIRST 0x02A0
  338. #define WM_TRACKMOUSEEVENT_LAST 0x02AF
  339. #define WM_PALETTEGONNACHANGE 0x0310
  340. #define WM_CHANGEPALETTE 0x0311
  341. #define WM_SYSMENU 0x0313
  342. #define WM_HOOKMSG 0x0314
  343. #define WM_EXITPROCESS 0x0315
  344. #define WM_WAKETHREAD 0x0316
  345. #define WM_UAHINIT 0x031B
  346. #define WM_DESKTOPNOTIFY 0x031C
  347. #define WM_NOTIFYWOW 0x0340
  348. #define WM_COALESCE_FIRST 0x0390
  349. #define WM_COALESCE_LAST 0x039F
  350. #define WM_INTERNAL_DDE_FIRST 0x03E0
  351. #define WM_INTERNAL_DDE_LAST 0x03EF
  352. #define WM_COALESCE_FIRST 0x0390
  353. #define WM_COALESCE_LAST 0x039F
  354. #define WM_MM_RESERVED_FIRST 0x03A0
  355. #define WM_MM_RESERVED_LAST 0x03DF
  356. #define WM_CBT_RESERVED_FIRST 0x03F0
  357. #define WM_CBT_RESERVED_LAST 0x03FF
  358. /* wParam for WM_NOTIFYWOW message */
  359. #define WMNW_UPDATEFINDREPLACE 0
  360. #define WMSZ_KEYSIZE 0
  361. #define WMSZ_MOVE 9
  362. #define WMSZ_KEYMOVE 10
  363. #define WMSZ_SIZEFIRST WMSZ_LEFT
  364. #define HTLAMEBUTTON 22
  365. /*
  366. * The prototype of the function to call when the user clicks
  367. * on the Lame button in the caption
  368. */
  369. typedef VOID (*PLAMEBTNPROC)(HWND, PVOID);
  370. #define SMTO_BROADCAST 0x0004
  371. #define SMTO_VALID 0x000F
  372. #define ICON_RECREATE 3
  373. #define WVR_MINVALID WVR_ALIGNTOP
  374. #define WVR_MAXVALID WVR_VALIDRECTS
  375. #if(WINVER >= 0x0500)
  376. #define TME_VALID (TME_HOVER | TME_LEAVE | TME_NONCLIENT | TME_QUERY | TME_CANCEL)
  377. #else
  378. #define TME_VALID (TME_HOVER | TME_LEAVE | TME_QUERY | TME_CANCEL)
  379. #endif
  380. #define WS_VALID (WS_OVERLAPPED | \
  381. WS_POPUP | \
  382. WS_CHILD | \
  383. WS_MINIMIZE | \
  384. WS_VISIBLE | \
  385. WS_DISABLED | \
  386. WS_CLIPSIBLINGS | \
  387. WS_CLIPCHILDREN | \
  388. WS_MAXIMIZE | \
  389. WS_CAPTION | \
  390. WS_BORDER | \
  391. WS_DLGFRAME | \
  392. WS_VSCROLL | \
  393. WS_HSCROLL | \
  394. WS_SYSMENU | \
  395. WS_THICKFRAME | \
  396. WS_GROUP | \
  397. WS_TABSTOP | \
  398. WS_MINIMIZEBOX | \
  399. WS_MAXIMIZEBOX)
  400. #define WS_EX_DRAGOBJECT 0x00000002L
  401. #if(WINVER >= 0x0501)
  402. #define WS_EXP_GHOSTMAKEVISIBLE 0x00000800L
  403. #endif /* WINVER >= 0x0501 */
  404. #define WS_EX_ANSICREATOR 0x80000000L
  405. #ifdef REDIRECTION
  406. #define WS_EX_EXTREDIRECTED 0x01000000L
  407. #endif // REDIRECTION
  408. /*
  409. * These are not extended styles but rather state bits.
  410. * We use these bit positions to delay the addition of a new
  411. * state DWORD in the window structure.
  412. */
  413. #define WS_EXP_UIFOCUSHIDDEN 0x80000000
  414. #define WS_EXP_UIACCELHIDDEN 0x40000000
  415. #define WS_EXP_REDIRECTED 0x20000000
  416. #define WS_EXP_COMPOSITING 0x10000000
  417. #define WS_EXP_UIACTIVE 0x04000000L
  418. #define WS_EXP_UIVALID (WS_EXP_UIFOCUSHIDDEN | \
  419. WS_EXP_UIACCELHIDDEN | \
  420. WS_EXP_UIACTIVE)
  421. #define WS_EXP_PRIVATE (WS_EXP_UIFOCUSHIDDEN | \
  422. WS_EXP_UIACCELHIDDEN | \
  423. WS_EXP_REDIRECTED | \
  424. WS_EXP_COMPOSITING | \
  425. WS_EXP_UIACTIVE | \
  426. WS_EXP_GHOSTMAKEVISIBLE)
  427. /*
  428. * RTL Mirroring Extended Styles (RTL_MIRRORING)
  429. */
  430. #define WS_EX_LAYOUTVBHRESERVED 0x00200000L
  431. #define WS_EX_LAYOUTBTTRESERVED 0x00800000L
  432. #define WS_EX_ALLEXSTYLES (WS_EX_TRANSPARENT | WS_EX_DLGMODALFRAME | WS_EX_DRAGOBJECT | WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST | WS_EX_ACCEPTFILES)
  433. #define WS_EX_VALID (WS_EX_DLGMODALFRAME | \
  434. WS_EX_DRAGOBJECT | \
  435. WS_EX_NOPARENTNOTIFY | \
  436. WS_EX_TOPMOST | \
  437. WS_EX_ACCEPTFILES | \
  438. WS_EX_TRANSPARENT | \
  439. WS_EX_ALLEXSTYLES)
  440. #define WS_EX_VALID40 (WS_EX_VALID | \
  441. WS_EX_MDICHILD | \
  442. WS_EX_WINDOWEDGE | \
  443. WS_EX_CLIENTEDGE | \
  444. WS_EX_CONTEXTHELP | \
  445. WS_EX_TOOLWINDOW | \
  446. WS_EX_RIGHT | \
  447. WS_EX_LEFT | \
  448. WS_EX_RTLREADING | \
  449. WS_EX_LEFTSCROLLBAR | \
  450. WS_EX_CONTROLPARENT | \
  451. WS_EX_STATICEDGE | \
  452. WS_EX_APPWINDOW)
  453. #define WS_EX_VALID50 (WS_EX_VALID40 | \
  454. WS_EX_LAYERED | \
  455. WS_EX_NOINHERITLAYOUT| \
  456. WS_EX_LAYOUTRTL | \
  457. WS_EX_NOACTIVATE)
  458. #ifdef REDIRECTION
  459. #define WS_EX_VALID51 (WS_EX_VALID50 | \
  460. WS_EX_COMPOSITED | \
  461. WS_EX_EXTREDIRECTED)
  462. #else
  463. #define WS_EX_VALID51 (WS_EX_VALID50 | \
  464. WS_EX_COMPOSITED)
  465. #endif // REDIRECTION
  466. #define WS_EX_INTERNAL (WS_EX_DRAGOBJECT | \
  467. WS_EX_ANSICREATOR)
  468. /*
  469. * We currently return to applications only the valid Ex_Style bits.
  470. * If declaring another macro i.e. WS_EX_VALID60, make sure to change WS_EX_ALLVALID
  471. */
  472. #define WS_EX_ALLVALID WS_EX_VALID51
  473. #define WF_DIALOG_WINDOW 0x00010000 // used in WOW32 -- this is a state flag, not a style flag
  474. #define CS_KEYCVTWINDOW 0x0004
  475. #define CS_OEMCHARS 0x0010 /* reserved (see user\server\usersrv.h) */
  476. #define CS_NOKEYCVT 0x0100
  477. #define CS_LVB 0x0400
  478. #define CS_SYSTEM 0x8000
  479. #define CS_VALID (CS_VREDRAW | \
  480. CS_HREDRAW | \
  481. CS_KEYCVTWINDOW | \
  482. CS_DBLCLKS | \
  483. CS_OEMCHARS | \
  484. CS_OWNDC | \
  485. CS_CLASSDC | \
  486. CS_PARENTDC | \
  487. CS_NOKEYCVT | \
  488. CS_NOCLOSE | \
  489. CS_SAVEBITS | \
  490. CS_BYTEALIGNCLIENT | \
  491. CS_BYTEALIGNWINDOW | \
  492. CS_GLOBALCLASS | \
  493. CS_DROPSHADOW | \
  494. CS_IME)
  495. #define CS_VALID31 0x0800ffef
  496. #define CS_VALID40 0x0803feeb
  497. #define BDR_VALID 0x000F
  498. #define BF_VALID (BF_MIDDLE | \
  499. BF_SOFT | \
  500. BF_ADJUST | \
  501. BF_FLAT | \
  502. BF_MONO | \
  503. BF_LEFT | \
  504. BF_TOP | \
  505. BF_RIGHT | \
  506. BF_BOTTOM | \
  507. BF_DIAGONAL)
  508. #define DFC_CACHE 0xFFFF
  509. #define DFCS_CAPTIONALL 0x000F
  510. #define DFCS_INMENU 0x0040
  511. #define DFCS_INSMALL 0x0080
  512. #define DFCS_MENUARROWUP 0x0008
  513. #define DFCS_MENUARROWDOWN 0x0010
  514. #define DFCS_SCROLLMIN 0x0000
  515. #define DFCS_SCROLLVERT 0x0000
  516. #define DFCS_SCROLLMAX 0x0001
  517. #define DFCS_SCROLLHORZ 0x0002
  518. #define DFCS_SCROLLLINE 0x0004
  519. #define DFCS_CACHEICON 0x0000
  520. #define DFCS_CACHEBUTTONS 0x0001
  521. #if(_WIN32_WINNT >= 0x0501)
  522. typedef BOOL (CALLBACK* DRAWFRAMECONTROLPROC)(
  523. IN HDC,
  524. IN OUT LPRECT,
  525. IN UINT,
  526. IN UINT);
  527. #endif /* _WIN32_WINNT >= 0x0501 */
  528. #define DC_LAMEBUTTON 0x0400
  529. #define DC_NOVISIBLE 0x0800
  530. #define DC_NOSENDMSG 0x2000
  531. #define DC_CENTER 0x4000
  532. #define DC_FRAME 0x8000
  533. #define DC_CAPTION (DC_ICON | DC_TEXT | DC_BUTTONS)
  534. #define DC_NC (DC_CAPTION | DC_FRAME)
  535. /* flags for WM_NCUAHDRAWFRAME */
  536. #if(_WIN32_WINNT >= 0x0501)
  537. #define DF_ACTIVE 0x0001
  538. #define DF_HUNGREDRAW 0x2000
  539. #endif /* _WIN32_WINNT >= 0x0501 */
  540. #if(_WIN32_WINNT >= 0x0501)
  541. typedef BOOL (CALLBACK* DRAWCAPTIONPROC)(
  542. IN HWND,
  543. IN HDC,
  544. IN CONST RECT *,
  545. IN UINT);
  546. #endif /* _WIN32_WINNT >= 0x0501 */
  547. WINUSERAPI
  548. BOOL
  549. WINAPI
  550. DrawCaptionTempA(
  551. IN HWND,
  552. IN HDC,
  553. IN LPCRECT,
  554. IN HFONT,
  555. IN HICON,
  556. IN LPCSTR,
  557. IN UINT);
  558. WINUSERAPI
  559. BOOL
  560. WINAPI
  561. DrawCaptionTempW(
  562. IN HWND,
  563. IN HDC,
  564. IN LPCRECT,
  565. IN HFONT,
  566. IN HICON,
  567. IN LPCWSTR,
  568. IN UINT);
  569. #ifdef UNICODE
  570. #define DrawCaptionTemp DrawCaptionTempW
  571. #else
  572. #define DrawCaptionTemp DrawCaptionTempA
  573. #endif // !UNICODE
  574. #define IDANI_CLOSE 2
  575. #define CF_FIRST 0
  576. #define WPF_VALID (WPF_SETMINPOSITION | \
  577. WPF_RESTORETOMAXIMIZED)
  578. /*
  579. * MEASUREITEMSTRUCT_EX for ownerdraw
  580. * used when server initiates a WM_MEASUREITEM and adds the additional info
  581. * of whether the itemData needs to be thunked when the message is sent to
  582. * the client (see also WM_MEASUREITEM_CLIENTDATA
  583. */
  584. typedef struct tagMEASUREITEMSTRUCT_EX {
  585. UINT CtlType;
  586. UINT CtlID;
  587. UINT itemID;
  588. UINT itemWidth;
  589. UINT itemHeight;
  590. ULONG_PTR itemData;
  591. BOOL bThunkClientData;
  592. } MEASUREITEMSTRUCT_EX, NEAR *PMEASUREITEMSTRUCT_EX, FAR *LPMEASUREITEMSTRUCT_EX;
  593. typedef BOOL (CALLBACK* INTERNALGETMESSAGEPROC)(OUT LPMSG lpMsg, IN HWND hwnd,
  594. IN UINT wMsgFilterMin, IN UINT wMsgFilterMax, IN UINT flags, IN BOOL fGetMessage);
  595. #define PM_VALID (PM_NOREMOVE | \
  596. PM_REMOVE | \
  597. PM_NOYIELD | \
  598. PM_QS_INPUT | \
  599. PM_QS_POSTMESSAGE | \
  600. PM_QS_PAINT | \
  601. PM_QS_SENDMESSAGE)
  602. #define MOD_SAS 0x8000
  603. #define MOD_VALID (MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_WIN|MOD_SAS)
  604. #define EW_RESTARTWINDOWS 0x0042L
  605. #define EW_REBOOTSYSTEM 0x0043L
  606. #define EWX_REALLYLOGOFF ENDSESSION_LOGOFF
  607. #define EWX_CANCELED 0x00000080
  608. #define EWX_SYSTEM_CALLER 0x00000100
  609. #define EWX_WINLOGON_CALLER 0x00000200
  610. #define EWX_WINLOGON_OLD_SYSTEM 0x00000400
  611. #define EWX_WINLOGON_OLD_SHUTDOWN 0x00000800
  612. #define EWX_WINLOGON_OLD_REBOOT 0x00001000
  613. #define EWX_WINLOGON_API_SHUTDOWN 0x00002000
  614. #define EWX_WINLOGON_OLD_POWEROFF 0x00004000
  615. #define EWX_NOTIFY 0x00008000
  616. #define EWX_NONOTIFY 0x00010000
  617. #define EWX_WINLOGON_INITIATED 0x00020000
  618. #define EWX_TERMSRV_INITIATED 0x00040000
  619. #define EWX_VALID (EWX_LOGOFF | \
  620. EWX_SHUTDOWN | \
  621. EWX_REBOOT | \
  622. EWX_FORCE | \
  623. EWX_POWEROFF | \
  624. EWX_FORCEIFHUNG | \
  625. EWX_NOTIFY | \
  626. EWX_TERMSRV_INITIATED)
  627. #define SHUTDOWN_FLAGS (EWX_SHUTDOWN | EWX_REBOOT | EWX_POWEROFF | \
  628. EWX_WINLOGON_OLD_SHUTDOWN | EWX_WINLOGON_OLD_REBOOT | \
  629. EWX_WINLOGON_OLD_POWEROFF)
  630. /*
  631. * Shutdown logging stuff
  632. */
  633. #define SR_EVENT_INITIATE_CLEAN 1
  634. #define SR_EVENT_INITIATE_CLEAN_ABORT 2
  635. #define SR_EVENT_EXITWINDOWS 3
  636. #define SR_EVENT_DIRTY 4
  637. typedef struct _SHUTDOWN_REASON
  638. {
  639. UINT cbSize; /* Set to sizeof(SHUTDOWN_REASON) */
  640. UINT uFlags; /* Shutdown flags; e.g., EWX_SHUTDOWN */
  641. DWORD dwReasonCode; /* Optional field */
  642. DWORD dwEventType; /* See #defines above */
  643. BOOL fShutdownCancelled; /* Optional field */
  644. LPWSTR lpszComment; /* Optional field */
  645. } SHUTDOWN_REASON, *PSHUTDOWN_REASON;
  646. WINUSERAPI
  647. BOOL
  648. WINAPI
  649. RecordShutdownReason(
  650. PSHUTDOWN_REASON psr);
  651. WINUSERAPI
  652. BOOL
  653. WINAPI
  654. DisplayExitWindowsWarnings(
  655. UINT uExitWindowsFlags);
  656. #define BSM_COMPONENTS 0x0000000F
  657. #define BSM_VALID 0x0000001F
  658. #define BSF_QUEUENOTIFYMESSAGE 0x20000000
  659. #define BSF_SYSTEMSHUTDOWN 0x40000000
  660. #define BSF_MSGSRV32OK 0x80000000
  661. #define BSF_VALID 0x000007FF
  662. #define BSF_ASYNC (BSF_POSTMESSAGE | BSF_SENDNOTIFYMESSAGE)
  663. //
  664. // NOTE: Completion port-based notification is not implemented in Win2K,
  665. // nor is it planned for Whistler.
  666. //
  667. #define DEVICE_NOTIFY_COMPLETION_HANDLE 0x00000002
  668. WINUSERAPI
  669. ULONG
  670. WINAPI
  671. DeviceEventWorker(
  672. IN HWND hWnd,
  673. IN WPARAM wParam,
  674. IN LPARAM lParam,
  675. IN DWORD dwFlags,
  676. OUT PDWORD pdwResult
  677. );
  678. typedef BOOL (CALLBACK* WAITMESSAGEEXPROC)(UINT fsWakeMask, DWORD dwTimeout);
  679. #define PW_VALID (PW_CLIENTONLY)
  680. #define LWA_VALID (LWA_COLORKEY | \
  681. LWA_ALPHA)
  682. #define ULW_VALID (ULW_COLORKEY | \
  683. ULW_ALPHA | \
  684. ULW_OPAQUE)
  685. #define FLASHW_FLASHNOFG 0x00000008
  686. #define FLASHW_TIMERCALL 0x00000400
  687. #define FLASHW_DONE 0x00000800
  688. #define FLASHW_STARTON 0x00001000
  689. #define FLASHW_COUNTING 0x00002000
  690. #define FLASHW_KILLTIMER 0x00004000
  691. #define FLASHW_ON 0x00008000
  692. #define FLASHW_VALID (FLASHW_ALL | FLASHW_TIMERNOFG)
  693. #define FLASHW_COUNTMASK 0xFFFF0000
  694. #define FLASHW_CALLERBITS (FLASHW_VALID | FLASHW_COUNTMASK)
  695. #define SWP_STATECHANGE 0x8000 /* force size, move messages */
  696. #define SWP_NOCLIENTSIZE 0x0800 /* Client didn't resize */
  697. #define SWP_NOCLIENTMOVE 0x1000 /* Client didn't move */
  698. #define SWP_DEFERDRAWING 0x2000
  699. #define SWP_CREATESPB 0x4000
  700. #define SWP_CHANGEMASK (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_HIDEWINDOW | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
  701. #define SWP_NOCHANGE (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
  702. #define SWP_VALID1 (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_FRAMECHANGED)
  703. #define SWP_VALID2 (SWP_SHOWWINDOW | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOSENDCHANGING | SWP_ASYNCWINDOWPOS | SWP_DEFERDRAWING | SWP_CREATESPB)
  704. #define SWP_VALID (SWP_VALID1 | SWP_VALID2)
  705. #define SWP_NOTIFYCREATE 0x10000000
  706. #define SWP_NOTIFYDESTROY 0x20000000
  707. #define SWP_NOTIFYACTIVATE 0x40000000
  708. #define SWP_NOTIFYFS 0x80000000
  709. #define SWP_NOTIFYALL (SWP_NOTIFYCREATE | SWP_NOTIFYDESTROY | SWP_NOTIFYACTIVATE | SWP_NOTIFYFS)
  710. #undef SWP_VALID
  711. #define SWP_VALID (SWP_DEFERERASE | \
  712. SWP_ASYNCWINDOWPOS | \
  713. SWP_NOCOPYBITS | \
  714. SWP_NOOWNERZORDER | \
  715. SWP_NOSENDCHANGING | \
  716. SWP_NOSIZE | \
  717. SWP_NOMOVE | \
  718. SWP_NOZORDER | \
  719. SWP_NOREDRAW | \
  720. SWP_NOACTIVATE | \
  721. SWP_FRAMECHANGED | \
  722. SWP_SHOWWINDOW | \
  723. SWP_HIDEWINDOW)
  724. #define HWND_GROUPTOTOP HWND_TOPMOST
  725. /*
  726. * WARNING:
  727. * The following structures must NOT be DWORD padded because they are
  728. * followed by strings, etc that do not have to be DWORD aligned.
  729. */
  730. #include <pshpack2.h>
  731. /*
  732. * Chicago dialog template
  733. */
  734. typedef struct {
  735. WORD wDlgVer;
  736. WORD wSignature;
  737. DWORD dwHelpID;
  738. DWORD dwExStyle;
  739. DWORD style;
  740. WORD cDlgItems;
  741. short x;
  742. short y;
  743. short cx;
  744. short cy;
  745. } DLGTEMPLATE2;
  746. typedef DLGTEMPLATE2 *LPDLGTEMPLATE2A;
  747. typedef DLGTEMPLATE2 *LPDLGTEMPLATE2W;
  748. #ifdef UNICODE
  749. typedef LPDLGTEMPLATE2W LPDLGTEMPLATE2;
  750. #else
  751. typedef LPDLGTEMPLATE2A LPDLGTEMPLATE2;
  752. #endif // UNICODE
  753. typedef CONST DLGTEMPLATE2 *LPCDLGTEMPLATE2A;
  754. typedef CONST DLGTEMPLATE2 *LPCDLGTEMPLATE2W;
  755. #ifdef UNICODE
  756. typedef LPCDLGTEMPLATE2W LPCDLGTEMPLATE2;
  757. #else
  758. typedef LPCDLGTEMPLATE2A LPCDLGTEMPLATE2;
  759. #endif // UNICODE
  760. /*
  761. * Dialog item template for NT 1.0a/Chicago (dit2)
  762. */
  763. typedef struct {
  764. DWORD dwHelpID;
  765. DWORD dwExStyle;
  766. DWORD style;
  767. short x;
  768. short y;
  769. short cx;
  770. short cy;
  771. DWORD dwID;
  772. } DLGITEMTEMPLATE2;
  773. typedef DLGITEMTEMPLATE2 *PDLGITEMTEMPLATE2A;
  774. typedef DLGITEMTEMPLATE2 *PDLGITEMTEMPLATE2W;
  775. #ifdef UNICODE
  776. typedef PDLGITEMTEMPLATE2W PDLGITEMTEMPLATE2;
  777. #else
  778. typedef PDLGITEMTEMPLATE2A PDLGITEMTEMPLATE2;
  779. #endif // UNICODE
  780. typedef DLGITEMTEMPLATE2 *LPDLGITEMTEMPLATE2A;
  781. typedef DLGITEMTEMPLATE2 *LPDLGITEMTEMPLATE2W;
  782. #ifdef UNICODE
  783. typedef LPDLGITEMTEMPLATE2W LPDLGITEMTEMPLATE2;
  784. #else
  785. typedef LPDLGITEMTEMPLATE2A LPDLGITEMTEMPLATE2;
  786. #endif // UNICODE
  787. #include <poppack.h> /* Resume normal packing */
  788. /*
  789. * The driver flags corresponding to these mouse events are
  790. * shifted to the right by one, e.g.
  791. * MOUSEEVENTF_LEFTDOWN >> 1 == MOUSE_LEFT_BUTTON_DOWN
  792. *
  793. * The mouse driver sends the fourth and fifth buttons corresponding
  794. * as button flags, so we define MOUSEEVENTF_ flags INTERNALLY for
  795. * mimicking the input sent by the driver.
  796. */
  797. #define MOUSEEVENTF_DRIVER_X1DOWN 0x0080 /* x1 button down */
  798. #define MOUSEEVENTF_DRIVER_X1UP 0x0100 /* x1 button up */
  799. #define MOUSEEVENTF_DRIVER_X2DOWN 0x0200 /* x2 button down */
  800. #define MOUSEEVENTF_DRIVER_X2UP 0x0400 /* x2 button up */
  801. /* Legal MOUSEEVENTF_ flags that indicate a button has been pressed or the wheel moved */
  802. #define MOUSEEVENTF_BUTTONMASK \
  803. (MOUSEEVENTF_LEFTDOWN | \
  804. MOUSEEVENTF_LEFTUP | \
  805. MOUSEEVENTF_RIGHTDOWN | \
  806. MOUSEEVENTF_RIGHTUP | \
  807. MOUSEEVENTF_MIDDLEDOWN | \
  808. MOUSEEVENTF_MIDDLEUP | \
  809. MOUSEEVENTF_XDOWN | \
  810. MOUSEEVENTF_XUP | \
  811. MOUSEEVENTF_WHEEL)
  812. /* MOUSEEVENTF_ flags that indicate useful data in the mouseData field */
  813. #define MOUSEEVENTF_MOUSEDATAMASK \
  814. (MOUSEEVENTF_XDOWN | \
  815. MOUSEEVENTF_XUP | \
  816. MOUSEEVENTF_WHEEL)
  817. typedef DWORD (CALLBACK* GETQUEUESTATUSPROC)(IN UINT flags);
  818. typedef DWORD (CALLBACK* MSGWAITFORMULTIPLEOBJECTSEXPROC)(IN DWORD nCount, IN CONST HANDLE *pHandles, IN DWORD dwMilliseconds, IN DWORD dwWakeMask, IN DWORD dwFlags);
  819. #define MWMO_VALID 0x0007
  820. #define QS_SMSREPLY 0x0200
  821. #define QS_THREADATTACHED 0x0800
  822. #define QS_EXCLUSIVE 0x1000 // wait for these events only!!
  823. #define QS_EVENT 0x2000 // signifies event message
  824. #define QS_TRANSFER 0x4000 // Input was transfered from another thread
  825. // 0x8000 // unused, but should not be used for external API.
  826. // Win9x has used this for SMSREPLY
  827. #define QS_VALID (QS_KEY | \
  828. QS_MOUSEMOVE | \
  829. QS_MOUSEBUTTON | \
  830. QS_POSTMESSAGE | \
  831. QS_TIMER | \
  832. QS_PAINT | \
  833. QS_SENDMESSAGE | \
  834. QS_TRANSFER | \
  835. QS_HOTKEY | \
  836. QS_ALLPOSTMESSAGE| \
  837. QS_RAWINPUT)
  838. /*
  839. * QS_EVENT is used to clear the QS_EVENT bit, QS_EVENTSET is used to
  840. * set the bit.
  841. *
  842. * Include QS_SENDMESSAGE because the queue events
  843. * match what a win3.1 app would see as the QS_SENDMESSAGE bit. Plus 16 bit
  844. * apps don't even know about QS_EVENT.
  845. */
  846. #define QS_EVENTSET (QS_EVENT | QS_SENDMESSAGE)
  847. /*
  848. * When you add a system metric, be sure to
  849. * add it to userexts.c in the function Idsi.
  850. */
  851. #define SM_UNUSED_64 64
  852. #define SM_UNUSED_65 65
  853. #define SM_UNUSED_66 66
  854. #define SM_BOOLEANS 85
  855. /*
  856. * Add system metrics that don't take space in gpsi->aiSysMet here.
  857. */
  858. /*
  859. * To add a BOOLEAN system metric increment SM_ENDBOOLRANGE by 1 and make your
  860. * SM_XXXX constant that new value.
  861. */
  862. #define SM_STARTBOOLRANGE 0x2000
  863. #define SM_ENDBOOLRANGE 0x2000
  864. /*
  865. * When you add a system metric, be sure to
  866. * add it to userexts.c in the function Idsi.
  867. */
  868. #if(_WIN32_WINNT >= 0x0501)
  869. typedef int (CALLBACK* GETSYSTEMMETRICSPROC)(IN int nIndex);
  870. #endif /* _WIN32_WINNT >= 0x0501 */
  871. #define PMB_VALID PMB_ACTIVE
  872. WINUSERAPI
  873. UINT
  874. WINAPI
  875. PaintMenuBar(
  876. IN HWND hwnd,
  877. IN HDC hdc,
  878. IN int iLeftOffset,
  879. IN int iRightOffset,
  880. IN int iTopOffset,
  881. IN DWORD dwFlags);
  882. WINUSERAPI
  883. UINT
  884. WINAPI
  885. CalcMenuBar(
  886. IN HWND hwnd,
  887. IN int iLeftOffset,
  888. IN int iRightOffset,
  889. IN int iTopOffset,
  890. IN LPCRECT prcWnd);
  891. WINUSERAPI
  892. int
  893. WINAPI
  894. DrawMenuBarTemp(
  895. IN HWND,
  896. IN HDC,
  897. IN LPCRECT,
  898. IN HMENU,
  899. IN HFONT);
  900. WINUSERAPI BOOL WINAPI SetSystemMenu( IN HWND, IN HMENU);
  901. /*
  902. * MNS_ values are stored in pMenu->fFlags.
  903. * Low order bits are used for internal MF* flags defined in user.h
  904. */
  905. #define MNS_LAST 0x04000000
  906. #define MNS_VALID 0xFC000000
  907. #define MIM_MASK 0x8000001F
  908. #define MNGOF_GAP 0x00000003
  909. #define MNGOF_CROSSBOUNDARY 0x00000004
  910. #define MIIM_MASK 0x000001FF
  911. #define HBMMENU_MIN ((HBITMAP) 0)
  912. #define HBMMENU_MBARFIRST ((HBITMAP) 2)
  913. #define HBMMENU_UNUSED ((HBITMAP) 4)
  914. #define HBMMENU_MBARLAST ((HBITMAP) 7)
  915. #define HBMMENU_POPUPFIRST ((HBITMAP) 8)
  916. #define HBMMENU_POPUPLAST ((HBITMAP) 11)
  917. #define HBMMENU_MAX ((HBITMAP) 12)
  918. /*
  919. * Make sure to keep this in synch with the MENUITEMINFO structure. It should
  920. * be equal to the size of the structure pre NT5.
  921. */
  922. #define SIZEOFMENUITEMINFO95 FIELD_OFFSET(MENUITEMINFO, hbmpItem)
  923. #define TPM_SYSMENU 0x0200L
  924. #define TPM_FIRSTANIBITPOS 10
  925. #define TPM_ANIMATIONBITS 0x3C00L
  926. #define TPM_VALID (TPM_LEFTBUTTON | \
  927. TPM_RIGHTBUTTON | \
  928. TPM_LEFTALIGN | \
  929. TPM_CENTERALIGN | \
  930. TPM_RIGHTALIGN | \
  931. TPM_TOPALIGN | \
  932. TPM_VCENTERALIGN | \
  933. TPM_BOTTOMALIGN | \
  934. TPM_HORIZONTAL | \
  935. TPM_VERTICAL | \
  936. TPM_NONOTIFY | \
  937. TPM_RECURSE | \
  938. TPM_RETURNCMD | \
  939. TPM_HORPOSANIMATION | \
  940. TPM_HORNEGANIMATION | \
  941. TPM_VERPOSANIMATION | \
  942. TPM_VERNEGANIMATION | \
  943. TPM_NOANIMATION |\
  944. TPM_LAYOUTRTL)
  945. typedef struct _dropfilestruct {
  946. DWORD pFiles; // offset of file list
  947. POINT pt; // drop point
  948. BOOL fNC; // is it on NonClient area
  949. BOOL fWide; // WIDE character switch
  950. } DROPFILESTRUCT, FAR * LPDROPFILESTRUCT;
  951. #define DT_VALID 0x0007ffff /* union of all others */
  952. #undef DT_VALID
  953. #define DT_VALID (DT_CENTER | \
  954. DT_RIGHT | \
  955. DT_VCENTER | \
  956. DT_BOTTOM | \
  957. DT_WORDBREAK | \
  958. DT_SINGLELINE | \
  959. DT_EXPANDTABS | \
  960. DT_TABSTOP | \
  961. DT_NOCLIP | \
  962. DT_EXTERNALLEADING | \
  963. DT_CALCRECT | \
  964. DT_NOPREFIX | \
  965. DT_INTERNAL | \
  966. DT_EDITCONTROL | \
  967. DT_PATH_ELLIPSIS | \
  968. DT_END_ELLIPSIS | \
  969. DT_MODIFYSTRING | \
  970. DT_RTLREADING | \
  971. DT_WORD_ELLIPSIS | \
  972. DT_NOFULLWIDTHCHARBREAK |\
  973. DT_HIDEPREFIX | \
  974. DT_PREFIXONLY )
  975. #define DST_TEXTMAX 0x0002
  976. #define DST_GLYPH 0x0005
  977. #define DST_TYPEMASK 0x0007
  978. #define DST_GRAYSTRING 0x0008
  979. #define DSS_DEFAULT 0x0040
  980. #define DSS_INACTIVE 0x0100
  981. #define DCX_INVALID 0x00000800L
  982. #define DCX_INUSE 0x00001000L
  983. #define DCX_SAVEDRGNINVALID 0x00002000L
  984. #define DCX_REDIRECTED 0x00004000L
  985. #define DCX_OWNDC 0x00008000L
  986. #define DCX_USESTYLE 0x00010000L
  987. #define DCX_NEEDFONT 0x00020000L
  988. #define DCX_NODELETERGN 0x00040000L
  989. #define DCX_NOCLIPCHILDREN 0x00080000L
  990. #define DCX_NORECOMPUTE 0x00100000L
  991. #define DCX_DESTROYTHIS 0x00400000L
  992. #define DCX_CREATEDC 0x00800000L
  993. #define DCX_REDIRECTEDBITMAP 0x08000000L
  994. #define DCX_PWNDORGINVISIBLE 0x10000000L
  995. #define DCX_NOMIRROR 0x40000000L // Don't RTL Mirror DC (RTL_MIRRORING)
  996. #define DCX_DONTRIPONDESTROY 0x80000000L
  997. #define DCX_MATCHMASK (DCX_WINDOW | \
  998. DCX_CACHE | \
  999. DCX_REDIRECTED | \
  1000. DCX_CLIPCHILDREN | \
  1001. DCX_CLIPSIBLINGS | \
  1002. DCX_NORESETATTRS | \
  1003. DCX_LOCKWINDOWUPDATE | \
  1004. DCX_CREATEDC)
  1005. #define DCX_VALID (DCX_WINDOW | \
  1006. DCX_CACHE | \
  1007. DCX_NORESETATTRS | \
  1008. DCX_CLIPCHILDREN | \
  1009. DCX_CLIPSIBLINGS | \
  1010. DCX_PARENTCLIP | \
  1011. DCX_EXCLUDERGN | \
  1012. DCX_INTERSECTRGN | \
  1013. DCX_EXCLUDEUPDATE | \
  1014. DCX_INTERSECTUPDATE | \
  1015. DCX_LOCKWINDOWUPDATE | \
  1016. DCX_INVALID | \
  1017. DCX_INUSE | \
  1018. DCX_SAVEDRGNINVALID | \
  1019. DCX_OWNDC | \
  1020. DCX_USESTYLE | \
  1021. DCX_NEEDFONT | \
  1022. DCX_NODELETERGN | \
  1023. DCX_NOCLIPCHILDREN | \
  1024. DCX_NORECOMPUTE | \
  1025. DCX_VALIDATE | \
  1026. DCX_DESTROYTHIS | \
  1027. DCX_CREATEDC)
  1028. WINUSERAPI
  1029. BOOL
  1030. WINAPI
  1031. AlignRects(
  1032. IN OUT LPRECT arc,
  1033. IN DWORD cCount,
  1034. IN DWORD iPrimary,
  1035. IN DWORD dwFlags);
  1036. //
  1037. // AlignRects flags
  1038. //
  1039. #define CUDR_NORMAL 0x0000
  1040. #define CUDR_NOSNAPTOGRID 0x0001
  1041. #define CUDR_NORESOLVEPOSITIONS 0x0002
  1042. #define CUDR_NOCLOSEGAPS 0x0004
  1043. #define CUDR_NOPRIMARY 0x0010
  1044. #if(_WIN32_WINNT >= 0x0501)
  1045. typedef int (CALLBACK* SETWINDOWRGNPROC)(IN HWND hWnd, IN HRGN hRgn, IN BOOL bRedraw);
  1046. #endif /* _WIN32_WINNT >= 0x0501 */
  1047. #define RDW_REDRAWWINDOW 0x1000 /* Called from RedrawWindow()*/
  1048. #define RDW_SUBTRACTSELF 0x2000 /* Subtract self from hrgn */
  1049. #define RDW_COPYRGN 0x4000 /* Copy the passed-in region */
  1050. #define RDW_IGNOREUPDATEDIRTY 0x8000 /* Ignore WFUPDATEDIRTY */
  1051. #define RDW_INVALIDATELAYERS 0x00010000 /* Allow layered windows invalidation */
  1052. #define RDW_VALIDMASK (RDW_INVALIDATE | \
  1053. RDW_INTERNALPAINT | \
  1054. RDW_ERASE | \
  1055. RDW_VALIDATE | \
  1056. RDW_NOINTERNALPAINT | \
  1057. RDW_NOERASE | \
  1058. RDW_NOCHILDREN | \
  1059. RDW_ALLCHILDREN | \
  1060. RDW_UPDATENOW | \
  1061. RDW_ERASENOW | \
  1062. RDW_FRAME | \
  1063. RDW_NOFRAME)
  1064. #define SW_EXACTTIME 0x0020
  1065. #define SW_SCROLLWINDOW 0x8000 /* Called from ScrollWindow() */
  1066. #define SW_VALIDFLAGS (SW_SCROLLWINDOW | \
  1067. SW_SCROLLCHILDREN | \
  1068. SW_INVALIDATE | \
  1069. SW_SMOOTHSCROLL | \
  1070. SW_EXACTTIME | \
  1071. SW_ERASE)
  1072. #if(_WIN32_WINNT >= 0x0501)
  1073. typedef BOOL (CALLBACK* ENABLESCROLLBARPROC)(IN HWND hWnd, IN UINT wSBflags, IN UINT wArrows);
  1074. #endif /* _WIN32_WINNT >= 0x0501 */
  1075. #define ESB_MAX 0x0003
  1076. #define SB_DISABLE_MASK ESB_DISABLE_BOTH
  1077. #if(_WIN32_WINNT >= 0x0501)
  1078. typedef BOOL (CALLBACK* ADJUSTWINDOWRECTEXPROC)(IN OUT LPRECT lpRect, IN DWORD dwStyle,
  1079. IN BOOL bMenu, IN DWORD dwExStyle);
  1080. #endif /* _WIN32_WINNT >= 0x0501 */
  1081. /*
  1082. * Help Engine stuff
  1083. *
  1084. * Note: for Chicago this is in winhelp.h and called WINHLP
  1085. */
  1086. typedef struct {
  1087. WORD cbData; /* Size of data */
  1088. WORD usCommand; /* Command to execute */
  1089. ULONG_PTR ulTopic; /* Topic/context number (if needed) */
  1090. DWORD ulReserved; /* Reserved (internal use) */
  1091. WORD offszHelpFile; /* Offset to help file in block */
  1092. WORD offabData; /* Offset to other data in block */
  1093. } HLP, *LPHLP;
  1094. #if(WINVER >= 0x0500)
  1095. #define MB_LASTVALIDTYPE MB_CANCELTRYCONTINUE
  1096. #else
  1097. #define MB_LASTVALIDTYPE MB_RETRYCANCEL
  1098. #endif
  1099. #define MBEX_VALIDL 0xf3f7
  1100. #define MBEX_VALIDH 1
  1101. WINUSERAPI
  1102. int
  1103. WINAPI
  1104. MessageBoxTimeoutA(
  1105. IN HWND hWnd,
  1106. IN LPCSTR lpText,
  1107. IN LPCSTR lpCaption,
  1108. IN UINT uType,
  1109. IN WORD wLanguageId,
  1110. IN DWORD dwTimeout);
  1111. WINUSERAPI
  1112. int
  1113. WINAPI
  1114. MessageBoxTimeoutW(
  1115. IN HWND hWnd,
  1116. IN LPCWSTR lpText,
  1117. IN LPCWSTR lpCaption,
  1118. IN UINT uType,
  1119. IN WORD wLanguageId,
  1120. IN DWORD dwTimeout);
  1121. #ifdef UNICODE
  1122. #define MessageBoxTimeout MessageBoxTimeoutW
  1123. #else
  1124. #define MessageBoxTimeout MessageBoxTimeoutA
  1125. #endif // !UNICODE
  1126. #define MB_VALID (MB_OK | \
  1127. MB_OKCANCEL | \
  1128. MB_ABORTRETRYIGNORE | \
  1129. MB_YESNOCANCEL | \
  1130. MB_YESNO | \
  1131. MB_RETRYCANCEL | \
  1132. MB_ICONHAND | \
  1133. MB_ICONQUESTION | \
  1134. MB_ICONEXCLAMATION | \
  1135. MB_ICONASTERISK | \
  1136. MB_DEFBUTTON1 | \
  1137. MB_DEFBUTTON2 | \
  1138. MB_DEFBUTTON3 | \
  1139. MB_DEFBUTTON4 | \
  1140. MB_APPLMODAL | \
  1141. MB_SYSTEMMODAL | \
  1142. MB_TASKMODAL | \
  1143. MB_HELP | \
  1144. MB_TOPMOST | \
  1145. MB_RIGHT | \
  1146. MB_RTLREADING | \
  1147. MB_NOFOCUS | \
  1148. MB_SETFOREGROUND | \
  1149. MB_DEFAULT_DESKTOP_ONLY | \
  1150. MB_SERVICE_NOTIFICATION | \
  1151. MB_TYPEMASK | \
  1152. MB_USERICON | \
  1153. MB_ICONMASK | \
  1154. MB_DEFMASK | \
  1155. MB_MODEMASK | \
  1156. MB_MISCMASK)
  1157. #define CWP_VALID (CWP_SKIPINVISIBLE | CWP_SKIPDISABLED | CWP_SKIPTRANSPARENT)
  1158. #define COLOR_3DALTFACE 25
  1159. #if(WINVER >= 0x0501)
  1160. #define COLOR_ENDCOLORS COLOR_MENUBAR
  1161. #else
  1162. #define COLOR_ENDCOLORS COLOR_INFOBK
  1163. #endif /* WINVER >= 0x0501 */
  1164. #define COLOR_MAX (COLOR_ENDCOLORS+1)
  1165. WINUSERAPI
  1166. HANDLE
  1167. WINAPI
  1168. SetSysColorsTemp(
  1169. IN CONST COLORREF *,
  1170. IN CONST HBRUSH *,
  1171. IN UINT_PTR wCnt);
  1172. /*
  1173. * RTL Mirroring APIs (RTL_MIRRORING)
  1174. */
  1175. WINUSERAPI
  1176. BOOL
  1177. WINAPI
  1178. SetDeskWallpaper(
  1179. IN LPCSTR lpString);
  1180. WINUSERAPI
  1181. HWND
  1182. WINAPI
  1183. CreateDialogIndirectParamAorW(
  1184. IN HANDLE hmod,
  1185. IN LPCDLGTEMPLATE lpDlgTemplate,
  1186. IN HWND hwndOwner,
  1187. IN DLGPROC lpDialogFunc,
  1188. IN LPARAM dwInitParam,
  1189. IN UINT fAnsi);
  1190. WINUSERAPI
  1191. INT_PTR
  1192. WINAPI
  1193. DialogBoxIndirectParamAorW(
  1194. IN HINSTANCE hmod,
  1195. IN LPCDLGTEMPLATEW lpDlgTemplate,
  1196. IN HWND hwndOwner,
  1197. IN DLGPROC lpDialogFunc,
  1198. IN LPARAM dwInitParam,
  1199. IN UINT fAnsiFlags);
  1200. WINUSERAPI
  1201. void
  1202. WINAPI
  1203. LoadLocalFonts(void);
  1204. WINUSERAPI
  1205. UINT
  1206. WINAPI
  1207. UserRealizePalette(IN HDC hdc);
  1208. WINUSERAPI BOOL WINAPI SetShellWindow( IN HWND);
  1209. WINUSERAPI BOOL WINAPI SetShellWindowEx( IN HWND, IN HWND);
  1210. WINUSERAPI HWND WINAPI GetProgmanWindow(void);
  1211. WINUSERAPI BOOL WINAPI SetProgmanWindow( IN HWND);
  1212. WINUSERAPI HWND WINAPI GetTaskmanWindow(void);
  1213. WINUSERAPI BOOL WINAPI SetTaskmanWindow( IN HWND);
  1214. WINUSERAPI
  1215. BOOL
  1216. WINAPI
  1217. IsWindowInDestroy(IN HWND hwnd);
  1218. WINUSERAPI
  1219. BOOL
  1220. WINAPI
  1221. IsServerSideWindow(IN HWND hwnd);
  1222. WINUSERAPI HWND WINAPI GetNextQueueWindow ( IN HWND hWnd, IN INT nCmd);
  1223. #define MF_CHANGE_VALID (MF_INSERT | \
  1224. MF_CHANGE | \
  1225. MF_APPEND | \
  1226. MF_DELETE | \
  1227. MF_REMOVE | \
  1228. MF_BYCOMMAND | \
  1229. MF_BYPOSITION | \
  1230. MF_SEPARATOR | \
  1231. MF_ENABLED | \
  1232. MF_GRAYED | \
  1233. MF_DISABLED | \
  1234. MF_UNCHECKED | \
  1235. MF_CHECKED | \
  1236. MF_USECHECKBITMAPS | \
  1237. MF_STRING | \
  1238. MF_BITMAP | \
  1239. MF_OWNERDRAW | \
  1240. MF_POPUP | \
  1241. MF_MENUBARBREAK | \
  1242. MF_MENUBREAK | \
  1243. MF_UNHILITE | \
  1244. MF_HILITE | \
  1245. MF_SYSMENU)
  1246. #define MF_VALID (MF_CHANGE_VALID | \
  1247. MF_HELP | \
  1248. MF_MOUSESELECT)
  1249. #define MFT_MASK 0x00036B64L
  1250. #define MFS_HOTTRACK MF_APPEND
  1251. #define MFS_MASK 0x0000108BL
  1252. #define MFS_HOTTRACKDRAWN 0x10000000L
  1253. #define MFS_CACHEDBMP 0x20000000L
  1254. #define MFS_BOTTOMGAPDROP 0x40000000L
  1255. #define MFS_TOPGAPDROP 0x80000000L
  1256. #define MFS_GAPDROP 0xC0000000L
  1257. #define MFR_POPUP 0x01
  1258. #define MFR_END 0x80
  1259. #define MFT_OLDAPI_MASK 0x00006B64L
  1260. #define MFS_OLDAPI_MASK 0x0000008BL
  1261. #define MFT_NONSTRING 0x00000904L
  1262. #define MFT_BREAK 0x00000060L
  1263. typedef struct { // version 1
  1264. DWORD dwHelpID;
  1265. DWORD fType;
  1266. DWORD fState;
  1267. DWORD menuId;
  1268. WORD wResInfo;
  1269. WCHAR mtString[1];
  1270. } MENUITEMTEMPLATE2, *PMENUITEMTEMPLATE2;
  1271. #define SC_LAMEBUTTON 0xF190
  1272. #define IDC_NWPEN MAKEINTRESOURCE(32531)
  1273. #define IDC_HUNG MAKEINTRESOURCE(32632)
  1274. WINUSERAPI UINT PrivateExtractIconExA(
  1275. IN LPCSTR szFileName,
  1276. IN int nIconIndex,
  1277. OUT HICON *phiconLarge,
  1278. OUT HICON *phiconSmall,
  1279. IN UINT nIcons);
  1280. WINUSERAPI UINT PrivateExtractIconExW(
  1281. IN LPCWSTR szFileName,
  1282. IN int nIconIndex,
  1283. OUT HICON *phiconLarge,
  1284. OUT HICON *phiconSmall,
  1285. IN UINT nIcons);
  1286. #ifdef UNICODE
  1287. #define PrivateExtractIconEx PrivateExtractIconExW
  1288. #else
  1289. #define PrivateExtractIconEx PrivateExtractIconExA
  1290. #endif // !UNICODE
  1291. #define LR_GLOBAL 0x0100
  1292. #define LR_ENVSUBST 0x0200
  1293. #define LR_ACONFRAME 0x0400
  1294. #define LR_CREATEREALDIB 0x0800
  1295. #define LR_VALID 0xF8FF
  1296. #define DI_VALID (DI_MASK | DI_IMAGE | DI_COMPAT | DI_DEFAULTSIZE | DI_NOMIRROR)
  1297. #define OBM_STARTUP 32733
  1298. #define OBM_TRUETYPE 32732
  1299. #define OBM_HELP 32731
  1300. #define OBM_HELPD 32730
  1301. #define OBM_RDRVERT 32559
  1302. #define OBM_RDRHORZ 32660
  1303. #define OBM_RDR2DIM 32661
  1304. #define OCR_NWPEN 32631
  1305. #define OCR_HELP 32651
  1306. #define OCR_RDRVERT 32652
  1307. #define OCR_RDRHORZ 32653
  1308. #define OCR_RDR2DIM 32654
  1309. #define OCR_RDRNORTH 32655
  1310. #define OCR_RDRSOUTH 32656
  1311. #define OCR_RDRWEST 32657
  1312. #define OCR_RDREAST 32658
  1313. #define OCR_RDRNORTHWEST 32659
  1314. #define OCR_RDRNORTHEAST 32660
  1315. #define OCR_RDRSOUTHWEST 32661
  1316. #define OCR_RDRSOUTHEAST 32662
  1317. #define OCR_AUTORUN 32663
  1318. /*
  1319. * Default Cursor IDs to get original image from User
  1320. */
  1321. #define OCR_FIRST_DEFAULT 100
  1322. #define OCR_ARROW_DEFAULT 100
  1323. #define OCR_IBEAM_DEFAULT 101
  1324. #define OCR_WAIT_DEFAULT 102
  1325. #define OCR_CROSS_DEFAULT 103
  1326. #define OCR_UPARROW_DEFAULT 104
  1327. #define OCR_SIZENWSE_DEFAULT 105
  1328. #define OCR_SIZENESW_DEFAULT 106
  1329. #define OCR_SIZEWE_DEFAULT 107
  1330. #define OCR_SIZENS_DEFAULT 108
  1331. #define OCR_SIZEALL_DEFAULT 109
  1332. #define OCR_NO_DEFAULT 110
  1333. #define OCR_APPSTARTING_DEFAULT 111
  1334. #define OCR_HELP_DEFAULT 112
  1335. #define OCR_NWPEN_DEFAULT 113
  1336. #define OCR_HAND_DEFAULT 114
  1337. #define OCR_ICON_DEFAULT 115
  1338. #define OCR_AUTORUN_DEFAULT 116
  1339. #define COCR_CONFIGURABLE (OCR_AUTORUN_DEFAULT - OCR_FIRST_DEFAULT + 1)
  1340. /* Default IDs for original User images */
  1341. #define OIC_FIRST_DEFAULT 100
  1342. #define OIC_APPLICATION_DEFAULT 100
  1343. #define OIC_HAND_DEFAULT 101
  1344. #define OIC_WARNING_DEFAULT 101
  1345. #define OIC_QUESTION_DEFAULT 102
  1346. #define OIC_EXCLAMATION_DEFAULT 103
  1347. #define OIC_ERROR_DEFAULT 103
  1348. #define OIC_ASTERISK_DEFAULT 104
  1349. #define OIC_INFORMATION_DEFAULT 104
  1350. #define OIC_WINLOGO_DEFAULT 105
  1351. #define COIC_CONFIGURABLE (OIC_WINLOGO_DEFAULT - OIC_FIRST_DEFAULT + 1)
  1352. #define IDUSERICON 20
  1353. #define ES_FMTMASK 0x0003L
  1354. #define ES_COMBOBOX 0x0200L
  1355. #define EM_SETFONT 0x00C3 /* no longer suported */
  1356. #define EM_SETWORDBREAK 0x00CA /* no longer suported */
  1357. #define EM_MSGMAX 0x00DA
  1358. #define BS_IMAGEMASK 0x000000C0L
  1359. #define BS_HORZMASK 0x00000300L
  1360. #define BS_VERTMASK 0x00000C00L
  1361. #define BS_ALIGNMASK 0x00000F00L
  1362. #define SS_TEXTMAX0 0x00000002L
  1363. #define SS_TEXTMIN1 0x0000000BL
  1364. #define SS_TEXTMAX1 0x0000000DL
  1365. #define ISSSTEXTOROD(bType) (((bType) <= SS_TEXTMAX0) \
  1366. || (((bType) >= SS_TEXTMIN1) && ((bType) <= SS_TEXTMAX1)))
  1367. #define DDL_NOFILES 0x1000
  1368. #define DDL_VALID (DDL_READWRITE | \
  1369. DDL_READONLY | \
  1370. DDL_HIDDEN | \
  1371. DDL_SYSTEM | \
  1372. DDL_DIRECTORY | \
  1373. DDL_ARCHIVE | \
  1374. DDL_POSTMSGS | \
  1375. DDL_DRIVES | \
  1376. DDL_EXCLUSIVE)
  1377. /*
  1378. * Valid dialog style bits for Chicago compatibility.
  1379. */
  1380. //#define DS_VALID_FLAGS (DS_ABSALIGN|DS_SYSMODAL|DS_LOCALEDIT|DS_SETFONT|DS_MODALFRAME|DS_NOIDLEMSG | DS_SETFOREGROUND)
  1381. #define DS_VALID_FLAGS 0x1FFF
  1382. #define SCDLG_CLIENT 0x0001
  1383. #define SCDLG_ANSI 0x0002
  1384. #define SCDLG_NOREVALIDATE 0x0004
  1385. #define SCDLG_16BIT 0x0008 // Created for a 16 bit thread; common dialogs
  1386. #define DS_VALID31 0x01e3L
  1387. #define DS_VALID40 0x7FFFL
  1388. #define DS_RECURSE DS_CONTROL /* BOGUS GOING AWAY */
  1389. #define DS_COMMONDIALOG 0x4000L
  1390. #define DS_NONBOLD DS_3DLOOK /* BOGUS GOING AWAY */
  1391. #define LBCB_CARETON 0x01A3
  1392. #define LBCB_CARETOFF 0x01A4
  1393. #define LB_INSERTSTRINGUPPER 0x01AA
  1394. #define LB_INSERTSTRINGLOWER 0x01AB
  1395. #define LB_ADDSTRINGUPPER 0x01AC
  1396. #define LB_ADDSTRINGLOWER 0x01AD
  1397. #define LBCB_STARTTRACK 0x01AE
  1398. #define LBCB_ENDTRACK 0x01AF
  1399. #define CBEC_SETCOMBOFOCUS (CB_MSGMAX+1)
  1400. #define CBEC_KILLCOMBOFOCUS (CB_MSGMAX+2)
  1401. #define SIF_RETURNOLDPOS 0x1000
  1402. #define SIF_NOSCROLL 0x2000
  1403. #define SIF_MASK 0x701F
  1404. #if(_WIN32_WINNT >= 0x0501)
  1405. typedef BOOL (CALLBACK* GETSCROLLINFOPROC)(IN HWND, IN int, IN OUT LPSCROLLINFO);
  1406. typedef int (CALLBACK* SETSCROLLINFOPROC)(IN HWND, IN int, IN LPCSCROLLINFO, IN BOOL);
  1407. #endif /* _WIN32_WINNT >= 0x0501 */
  1408. #define HELP_HB_NORMAL 0x0000L
  1409. #define HELP_HB_STRING 0x0100L
  1410. #define HELP_HB_STRUCT 0x0200L
  1411. #define GR_MAXOBJECT 1
  1412. #if(_WIN32_WINNT >= 0x0500)
  1413. /*
  1414. * Query win32k statistics -internal
  1415. * QUERYUSER_CS Query critical section usage
  1416. * QUERYUSER_HANDLES Query user per-process user handle count
  1417. */
  1418. #define QUC_PID_TOTAL 0xffffffff
  1419. #define QUERYUSER_HANDLES 0x1
  1420. #if defined (USER_PERFORMANCE)
  1421. #define QUERYUSER_CS 0x2
  1422. /*
  1423. * The counters in CSSTATISTICS refer to the USER critical section:
  1424. * cExclusive counts how many times the CS was aquired exclusive
  1425. * cShared counts how many times the CS was aquired shared
  1426. * i64TimeExclusive counts the time (NtQueryPerformanceCounter() units)
  1427. * spent in the resource since the last query.
  1428. */
  1429. typedef struct _tagCSStatistics {
  1430. DWORD cExclusive;
  1431. DWORD cShared;
  1432. __int64 i64TimeExclusive;
  1433. } CSSTATISTICS;
  1434. #endif // USER_PERFORMANCE
  1435. BOOL
  1436. WINAPI
  1437. QueryUserCounters(
  1438. IN DWORD dwQueryType,
  1439. IN LPVOID pvIn,
  1440. IN DWORD dwInSize,
  1441. OUT LPVOID pvResult,
  1442. IN DWORD dwOutSize
  1443. );
  1444. #endif /* _WIN32_WINNT >= 0x0500 */
  1445. #define SPI_TIMEOUTS 0x0007
  1446. #define SPI_KANJIMENU 0x0008
  1447. #define SPI_UNUSED39 0x0027
  1448. #define SPI_UNUSED40 0x0028
  1449. #define SPI_UNUSED108 0x006C
  1450. #define SPI_UNUSED109 0x006D
  1451. #define SPI_MAX 0x0074
  1452. /*
  1453. * ADDING NEW SPI_* VALUES
  1454. * If the value is a BOOL, it should be added after SPI_STARTBOOLRANGE
  1455. * If the value is a DWORD, it should be added after SPI_STARTDWORDRANGE
  1456. * If the value is a structure or a string, go ahead and setup SPI_START*RANGE....
  1457. */
  1458. /*
  1459. * If adding a new SPI value in the following ranges:
  1460. * -You must define both SPI_GET* and SPI_SET* using consecutive numbers
  1461. * -The low order bit of SPI_GET* must be 0
  1462. * -The low order bit of SPI_SET* must be 1
  1463. * -Properly update SPI_MAX*RANGE
  1464. * -Add the default value to kernel\globals.c in the proper *CPUserPreferences* variable
  1465. * -Add the default value to the proper registry hives.
  1466. * -If your value requires some special validation, do so in kernel\ntstubs.c
  1467. * -If you find something wrong in this documentation, FIX IT!.
  1468. */
  1469. #define SPIF_SET 0x0001
  1470. #define SPIF_BOOL 0x1000
  1471. #define SPIF_DWORD 0x2000
  1472. #define SPIF_RANGETYPEMASK 0x3000
  1473. /*
  1474. * BOOLeans range.
  1475. * For GET, pvParam is a pointer to a BOOL
  1476. * For SET, pvParam is the value
  1477. */
  1478. #define SPI_STARTBOOLRANGE 0x1000
  1479. #define SPI_UNUSED1010 0x1010
  1480. #define SPI_UNUSED1011 0x1011
  1481. /*
  1482. * All SPI_s for UI effects must be < SPI_GETUIEFFECTS
  1483. */
  1484. #define SPI_MAXBOOLRANGE 0x1040
  1485. #define SPI_BOOLRANGECOUNT ((SPI_MAXBOOLRANGE - SPI_STARTBOOLRANGE) / 2)
  1486. #define SPI_BOOLMASKDWORDSIZE (((SPI_BOOLRANGECOUNT - 1) / 32) + 1)
  1487. /*
  1488. * DWORDs range.
  1489. * For GET, pvParam is a pointer to a DWORD
  1490. * For SET, pvParam is the value
  1491. */
  1492. #define SPI_STARTDWORDRANGE 0x2000
  1493. #define FE_FONTSMOOTHINGTYPE_VALID (FE_FONTSMOOTHINGSTANDARD | FE_FONTSMOOTHINGCLEARTYPE | FE_FONTSMOOTHINGDOCKING)
  1494. #define FE_FONTSMOOTHINGORIENTATION_VALID (FE_FONTSMOOTHINGORIENTATIONRGB)
  1495. #define SPI_MAXDWORDRANGE 0x2014
  1496. #define SPI_DWORDRANGECOUNT ((SPI_MAXDWORDRANGE - SPI_STARTDWORDRANGE) / 2)
  1497. #define SPIF_VALID (SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)
  1498. #define ARW_VALID 0x000FL
  1499. #define MAX_SCHEME_NAME_SIZE 128
  1500. #define CDS_RAWMODE 0x00000040
  1501. #define CDS_TRYCLOSEST 0x00000080
  1502. #define CDS_EXCLUSIVE 0x80000000
  1503. #define CDS_VALID 0xD00000FF
  1504. #define EDS_SHOW_DUPLICATES 0x00000001
  1505. #define EDS_SHOW_MONITOR_NOT_CAPABLE 0x00000002
  1506. void LoadRemoteFonts(void);
  1507. #if(_WIN32_WINNT >= 0x0501)
  1508. typedef BOOL (CALLBACK* SYSTEMPARAMETERSINFO) (
  1509. IN UINT,
  1510. IN UINT,
  1511. IN OUT PVOID,
  1512. IN UINT);
  1513. #endif /* _WIN32_WINNT >= 0x0501 */
  1514. #define FKF_VALID 0x0000007F
  1515. #define SKF_VALID 0x000001FF
  1516. #define SKF_STATEINFO 0xffff0000
  1517. #define MKF_VALID 0x000000FF
  1518. #define MKF_STATEINFO 0xB3000000
  1519. #define ATF_VALID 0x00000003
  1520. #define SSF_VALID 0x00000007
  1521. #define TKF_VALID 0x0000003F
  1522. WINUSERAPI VOID WINAPI RegisterNetworkCapabilities( IN DWORD dwBitsToSet, IN DWORD dwValues);
  1523. #define RNC_NETWORKS 0x00000001
  1524. #define RNC_LOGON 0x00000002
  1525. #if !defined(WINNT) // Win95 version of EndTask
  1526. WINUSERAPI DWORD WINAPI EndTask( IN HWND hwnd, IN DWORD idProcess, IN LPSTR lpszCaption, IN DWORD dwFlags);
  1527. #define ET_ALLOWFORWAIT 0x00000001
  1528. #define ET_TRYTOKILLNICELY 0x00000002
  1529. #define ET_NOUI 0x00000004
  1530. #define ET_NOWAIT 0x00000008
  1531. #define ET_VALID (ET_ALLOWFORWAIT | ET_TRYTOKILLNICELY | ET_NOUI | ET_NOWAIT)
  1532. #endif
  1533. #define LOGON_LOGOFF 0
  1534. #define LOGON_INPUT_TIMEOUT 1
  1535. #define LOGON_RESTARTSHELL 2
  1536. #if (_WIN32_WINNT >= 0x0500)
  1537. #define LOGON_ACCESSNOTIFY 3
  1538. #define LOGON_POWERSTATE 4
  1539. #define LOGON_LOCKWORKSTATION 5
  1540. #define SESSION_RECONNECTED 6
  1541. #define SESSION_DISCONNECTED 7
  1542. #define SESSION_LOGOFF 8
  1543. #define LOGON_PLAYEVENTSOUND 9
  1544. #if(_WIN32_WINNT >= 0x0501)
  1545. #define LOGON_POWEREVENT 10
  1546. #endif /* _WIN32_WINNT >= 0x0501 */
  1547. #define LOGON_LOGOFFCANCELED 11
  1548. #if(_WIN32_WINNT >= 0x0501)
  1549. #define LOGON_SHOW_POWER_MESSAGE 12
  1550. #define LOGON_REMOVE_POWER_MESSAGE 13
  1551. #define SESSION_PRERECONNECT 14
  1552. #define SESSION_DISABLESCRNSAVER 15
  1553. #define SESSION_ENABLESCRNSAVER 16
  1554. #define SESSION_PRERECONNECTDESKTOPSWITCH 17
  1555. #define SESSION_HELPASSISTANTSHADOWSTART 18
  1556. #define SESSION_HELPASSISTANTSHADOWFINISH 19
  1557. #define SESSION_DISCONNECTPIPE 20
  1558. #define LOCK_NORMAL 0
  1559. #define LOCK_RESUMEHIBERNATE 1
  1560. #endif /* _WIN32_WINNT >= 0x0501 */
  1561. /*
  1562. * Notification codes for WM_DESKTOPNOTIFY
  1563. */
  1564. #define DESKTOP_RELOADWALLPAPER 0
  1565. #define ACCESS_STICKYKEYS 0x0001
  1566. #define ACCESS_FILTERKEYS 0x0002
  1567. #define ACCESS_MOUSEKEYS 0x0003
  1568. #define ACCESS_TOGGLEKEYS 0x0004
  1569. #define ACCESS_HIGHCONTRAST 0x0005 // notification dlg
  1570. #define ACCESS_UTILITYMANAGER 0x0006
  1571. #define ACCESS_HIGHCONTRASTON 0x0008
  1572. #define ACCESS_HIGHCONTRASTOFF 0x0009
  1573. #define ACCESS_HIGHCONTRASTCHANGE 0x000A
  1574. #define ACCESS_HIGHCONTRASTONNOREG 0x000C
  1575. #define ACCESS_HIGHCONTRASTOFFNOREG 0x000D
  1576. #define ACCESS_HIGHCONTRASTCHANGENOREG 0x000E
  1577. #define ACCESS_HIGHCONTRASTNOREG 0x0004
  1578. #define USER_SOUND_DEFAULT 0 // default MB sound
  1579. #define USER_SOUND_SYSTEMHAND 1 // MB_ICONHAND shifted
  1580. #define USER_SOUND_SYSTEMQUESTION 2 // MB_ICONQUESTION shifted
  1581. #define USER_SOUND_SYSTEMEXCLAMATION 3 // MB_ICONEXCLAMATION shifted
  1582. #define USER_SOUND_SYSTEMASTERISK 4 // MB_ICONASTERISK shifted
  1583. #define USER_SOUND_MENUPOPUP 5
  1584. #define USER_SOUND_MENUCOMMAND 6
  1585. #define USER_SOUND_OPEN 7
  1586. #define USER_SOUND_CLOSE 8
  1587. #define USER_SOUND_RESTOREUP 9
  1588. #define USER_SOUND_RESTOREDOWN 10
  1589. #define USER_SOUND_MINIMIZE 11
  1590. #define USER_SOUND_MAXIMIZE 12
  1591. #define USER_SOUND_SNAPSHOT 13
  1592. #define USER_SOUND_MAX 14
  1593. #ifdef _NTPOAPI_
  1594. typedef struct tagPOWERSTATEPARAMS {
  1595. POWER_ACTION SystemAction;
  1596. SYSTEM_POWER_STATE MinSystemState;
  1597. ULONG Flags;
  1598. BOOL FullScreenMode;
  1599. } POWERSTATEPARAMS, *PPOWERSTATEPARAMS;
  1600. #endif
  1601. #endif
  1602. #define LOGON_FLG_MASK 0xF0000000
  1603. #define LOGON_FLG_SHIFT 28
  1604. #define STARTF_DESKTOPINHERIT 0x40000000
  1605. #define STARTF_SCREENSAVER 0x80000000
  1606. #define WSS_ERROR 0
  1607. #define WSS_BUSY 1
  1608. #define WSS_IDLE 2
  1609. #define DTF_CENTER 0x00 /* Center the bitmap (default) */
  1610. #define DTF_TILE 0x01 /* Tile the bitmap */
  1611. #define DTF_STRETCH 0x02 /* Stretch bitmap to cover screen. */
  1612. #if 0 /* the following have not been used anywhere in NT since at least 1992 */
  1613. #define DTF_NOPALETTE 0x04 /* Realize palette, otherwise match to default. */
  1614. #define DTF_RETAIN 0x08 /* Retain bitmap, ignore win.ini changes */
  1615. #define DTF_FIT 0x10 /* Fit the bitmap to the screen (scaled). */
  1616. #endif
  1617. #ifdef _INC_DDEMLH
  1618. BOOL DdeIsDataHandleReadOnly(
  1619. IN HDDEDATA hData);
  1620. int DdeGetDataHandleFormat(
  1621. IN HDDEDATA hData);
  1622. DWORD DdeGetCallbackInstance(VOID);
  1623. #endif /* defined _INC_DDEMLH */
  1624. #define LPK_TABBED_TEXT_OUT 0
  1625. #define LPK_PSM_TEXT_OUT 1
  1626. #define LPK_DRAW_TEXT_EX 2
  1627. #define LPK_EDIT_CONTROL 3
  1628. VOID
  1629. WINAPI
  1630. InitializeLpkHooks(
  1631. IN CONST FARPROC *lpfpLpkHooks
  1632. );
  1633. WINUSERAPI
  1634. HWND
  1635. WINAPI
  1636. WOWFindWindow(
  1637. IN LPCSTR lpClassName,
  1638. IN LPCSTR lpWindowName);
  1639. int
  1640. WINAPI
  1641. InternalDoEndTaskDlg(
  1642. IN TCHAR* pszTitle);
  1643. DWORD
  1644. WINAPI
  1645. InternalWaitCancel(
  1646. IN HANDLE handle,
  1647. IN DWORD dwMilliseconds);
  1648. HANDLE
  1649. WINAPI
  1650. InternalCreateCallbackThread(
  1651. IN HANDLE hProcess,
  1652. IN ULONG_PTR lpfn,
  1653. IN ULONG_PTR dwData);
  1654. WINUSERAPI
  1655. UINT
  1656. WINAPI
  1657. GetInternalWindowPos(
  1658. IN HWND hWnd,
  1659. OUT LPRECT lpRect,
  1660. IN LPPOINT lpPoint);
  1661. WINUSERAPI
  1662. BOOL
  1663. WINAPI
  1664. SetInternalWindowPos(
  1665. IN HWND hWnd,
  1666. IN UINT cmdShow,
  1667. IN LPRECT lpRect,
  1668. IN LPPOINT lpPoint);
  1669. WINUSERAPI
  1670. BOOL
  1671. WINAPI
  1672. CalcChildScroll(
  1673. IN HWND hWnd,
  1674. IN UINT sb);
  1675. WINUSERAPI
  1676. BOOL
  1677. WINAPI
  1678. RegisterTasklist(
  1679. IN HWND hWndTasklist);
  1680. WINUSERAPI
  1681. BOOL
  1682. WINAPI
  1683. CascadeChildWindows(
  1684. IN HWND hWndParent,
  1685. IN UINT flags);
  1686. WINUSERAPI
  1687. BOOL
  1688. WINAPI
  1689. TileChildWindows(
  1690. IN HWND hWndParent,
  1691. IN UINT flags);
  1692. /*
  1693. * Services support routines
  1694. */
  1695. WINUSERAPI
  1696. BOOL
  1697. WINAPI
  1698. RegisterServicesProcess(
  1699. IN DWORD dwProcessId);
  1700. /*
  1701. * Logon support routines
  1702. */
  1703. WINUSERAPI
  1704. BOOL
  1705. WINAPI
  1706. RegisterLogonProcess(
  1707. IN DWORD dwProcessId,
  1708. IN BOOL fSecure);
  1709. WINUSERAPI
  1710. UINT
  1711. WINAPI
  1712. LockWindowStation(
  1713. IN HWINSTA hWindowStation);
  1714. WINUSERAPI
  1715. BOOL
  1716. WINAPI
  1717. UnlockWindowStation(
  1718. IN HWINSTA hWindowStation);
  1719. WINUSERAPI
  1720. BOOL
  1721. WINAPI
  1722. SetWindowStationUser(
  1723. IN HWINSTA hWindowStation,
  1724. IN PLUID pLuidUser,
  1725. IN PSID pSidUser,
  1726. IN DWORD cbSidUser);
  1727. WINUSERAPI
  1728. BOOL
  1729. WINAPI
  1730. SetDesktopBitmap(
  1731. IN HDESK hdesk,
  1732. IN HBITMAP hbmWallpaper,
  1733. IN DWORD dwStyle);
  1734. WINUSERAPI
  1735. BOOL
  1736. WINAPI
  1737. SetLogonNotifyWindow(
  1738. IN HWND hWndNotify);
  1739. WINUSERAPI
  1740. UINT
  1741. WINAPI
  1742. GetIconId(
  1743. IN HANDLE hRes,
  1744. IN LPSTR lpszType);
  1745. WINUSERAPI
  1746. int
  1747. WINAPI
  1748. CriticalNullCall(
  1749. VOID);
  1750. WINUSERAPI
  1751. int
  1752. WINAPI
  1753. NullCall(
  1754. VOID);
  1755. WINUSERAPI
  1756. VOID
  1757. WINAPI
  1758. UserNotifyConsoleApplication(
  1759. IN DWORD dwProcessId);
  1760. WINUSERAPI
  1761. BOOL
  1762. WINAPI
  1763. EnterReaderModeHelper(
  1764. HWND hwnd);
  1765. /*
  1766. * Reserved console space.
  1767. *
  1768. * This was moved from the console code so that we can localize it
  1769. * in one place. This was necessary for dealing with the background
  1770. * color, which we need to have for the hungapp drawing. These are
  1771. * stored in the extra-window-bytes of each console.
  1772. */
  1773. #define GWL_CONSOLE_WNDALLOC (3 * sizeof(DWORD))
  1774. #define GWL_CONSOLE_PID 0
  1775. #define GWL_CONSOLE_TID 4
  1776. #define GWL_CONSOLE_BKCOLOR 8
  1777. VOID vFontSweep();
  1778. VOID vLoadLocalT1Fonts();
  1779. VOID vLoadRemoteT1Fonts();
  1780. #ifndef NOMSG
  1781. #define TM_INMENUMODE 0x0001
  1782. #define TM_POSTCHARBREAKS 0x0002
  1783. WINUSERAPI
  1784. BOOL
  1785. WINAPI
  1786. TranslateMessageEx(
  1787. IN CONST MSG *lpMsg,
  1788. IN UINT flags);
  1789. #endif /* !NOMSG */
  1790. /*
  1791. * Those values can be specified as nAnsiChar for MBToWCSEx
  1792. * USER_AWCONV_COUNTSTRING: Count the length of the string including trailing \0
  1793. * USER_AWCONV_COUNTSTRINGSZ: Count the length of the string excluding trailing \0
  1794. *
  1795. * Note: The result includes trailing \0 if USER_AWCONV_COUNTSTRING is specified.
  1796. * USER_AWCONV_COUNTSTRINGSZ will not null-terminate the restult string. It may return
  1797. * 0 if the source strlen() == 0.
  1798. */
  1799. #define USER_AWCONV_COUNTSTRING (-1)
  1800. #define USER_AWCONV_COUNTSTRINGSZ (-2)
  1801. WINUSERAPI
  1802. int
  1803. WINAPI
  1804. WCSToMBEx(
  1805. IN WORD wCodePage,
  1806. IN LPCWSTR pUnicodeString,
  1807. IN int cbUnicodeChar,
  1808. OUT LPSTR *ppAnsiString,
  1809. IN int nAnsiChar,
  1810. IN BOOL bAllocateMem);
  1811. WINUSERAPI
  1812. int
  1813. WINAPI
  1814. MBToWCSEx(
  1815. IN WORD wCodePage,
  1816. IN LPCSTR pAnsiString,
  1817. IN int nAnsiChar,
  1818. OUT LPWSTR *ppUnicodeString,
  1819. IN int cbUnicodeChar,
  1820. IN BOOL bAllocateMem);
  1821. #define UPUSP_USERLOGGEDON 0x00000001
  1822. #define UPUSP_POLICYCHANGE 0x00000002
  1823. #define UPUSP_REMOTESETTINGS 0x00000004
  1824. #define UPUSP_USERLOGGEDON 0x00000001
  1825. #define UPUSP_POLICYCHANGE 0x00000002
  1826. #define UPUSP_REMOTESETTINGS 0x00000004
  1827. WINUSERAPI
  1828. BOOL
  1829. WINAPI
  1830. UpdatePerUserSystemParameters(
  1831. IN HANDLE hToken,
  1832. IN DWORD dwFlags);
  1833. typedef VOID (APIENTRY *PFNW32ET)(VOID);
  1834. WINUSERAPI
  1835. BOOL
  1836. WINAPI
  1837. RegisterUserHungAppHandlers(
  1838. IN PFNW32ET pfnW32EndTask,
  1839. IN HANDLE hEventWowExec);
  1840. WINUSERAPI
  1841. ATOM
  1842. WINAPI
  1843. RegisterClassWOWA(
  1844. IN PVOID lpWndClass,
  1845. IN LPDWORD pdwWOWstuff);
  1846. WINUSERAPI
  1847. LONG
  1848. WINAPI
  1849. GetClassWOWWords(
  1850. IN HINSTANCE hInstance,
  1851. OUT LPCTSTR pString);
  1852. WINUSERAPI
  1853. DWORD
  1854. WINAPI
  1855. CurrentTaskLock(
  1856. IN DWORD hlck);
  1857. WINUSERAPI
  1858. HDESK
  1859. WINAPI
  1860. GetInputDesktop(
  1861. VOID);
  1862. #define WINDOWED 0
  1863. #define FULLSCREEN 1
  1864. #define GDIFULLSCREEN 2
  1865. #define FULLSCREENMIN 4
  1866. #define WCSToMB(pUnicodeString, cbUnicodeChar, ppAnsiString, nAnsiChar,\
  1867. bAllocateMem)\
  1868. WCSToMBEx(0, pUnicodeString, cbUnicodeChar, ppAnsiString, nAnsiChar, bAllocateMem)
  1869. #define MBToWCS(pAnsiString, nAnsiChar, ppUnicodeString, cbUnicodeChar,\
  1870. bAllocateMem)\
  1871. MBToWCSEx(0, pAnsiString, nAnsiChar, ppUnicodeString, cbUnicodeChar, bAllocateMem)
  1872. #define ID(string) (((ULONG_PTR)string & ~0x0000ffff) == 0)
  1873. /*
  1874. * For setting RIT timers and such. GDI uses this for the cursor-restore
  1875. * timer.
  1876. */
  1877. #define TMRF_READY 0x0001
  1878. #define TMRF_SYSTEM 0x0002
  1879. #define TMRF_RIT 0x0004
  1880. #define TMRF_INIT 0x0008
  1881. #define TMRF_ONESHOT 0x0010
  1882. #define TMRF_WAITING 0x0020
  1883. #define TMRF_PTIWINDOW 0x0040
  1884. /*
  1885. * For GDI SetAbortProc support.
  1886. */
  1887. WINUSERAPI
  1888. int
  1889. WINAPI
  1890. CsDrawTextA(
  1891. IN HDC hDC,
  1892. IN LPCSTR lpString,
  1893. IN int nCount,
  1894. IN LPRECT lpRect,
  1895. IN UINT uFormat);
  1896. WINUSERAPI
  1897. int
  1898. WINAPI
  1899. CsDrawTextW(
  1900. IN HDC hDC,
  1901. IN LPCWSTR lpString,
  1902. IN int nCount,
  1903. IN LPRECT lpRect,
  1904. IN UINT uFormat);
  1905. #ifdef UNICODE
  1906. #define CsDrawText CsDrawTextW
  1907. #else
  1908. #define CsDrawText CsDrawTextA
  1909. #endif // !UNICODE
  1910. WINUSERAPI
  1911. LONG
  1912. WINAPI
  1913. CsTabbedTextOutA(
  1914. IN HDC hDC,
  1915. IN int X,
  1916. IN int Y,
  1917. IN LPCSTR lpString,
  1918. IN int nCount,
  1919. IN int nTabPositions,
  1920. IN LPINT lpnTabStopPositions,
  1921. IN int nTabOrigin);
  1922. WINUSERAPI
  1923. LONG
  1924. WINAPI
  1925. CsTabbedTextOutW(
  1926. IN HDC hDC,
  1927. IN int X,
  1928. IN int Y,
  1929. IN LPCWSTR lpString,
  1930. IN int nCount,
  1931. IN int nTabPositions,
  1932. IN LPINT lpnTabStopPositions,
  1933. IN int nTabOrigin);
  1934. #ifdef UNICODE
  1935. #define CsTabbedTextOut CsTabbedTextOutW
  1936. #else
  1937. #define CsTabbedTextOut CsTabbedTextOutA
  1938. #endif // !UNICODE
  1939. WINUSERAPI
  1940. int
  1941. WINAPI
  1942. CsFrameRect(
  1943. IN HDC hDC,
  1944. IN CONST RECT *lprc,
  1945. IN HBRUSH hbr);
  1946. #ifdef UNICODE
  1947. #define CsDrawText CsDrawTextW
  1948. #define CsTabbedTextOut CsTabbedTextOutW
  1949. #else /* !UNICODE */
  1950. #define CsDrawText CsDrawTextA
  1951. #define CsTabbedTextOut CsTabbedTextOutA
  1952. #endif /* !UNICODE */
  1953. /*
  1954. * Custom Cursor action.
  1955. */
  1956. WINUSERAPI
  1957. HCURSOR
  1958. WINAPI
  1959. GetCursorFrameInfo( // Obsolete? - IanJa
  1960. IN HCURSOR hcur,
  1961. OUT LPWSTR id,
  1962. IN int iFrame,
  1963. OUT LPDWORD pjifRate,
  1964. OUT LPINT pccur);
  1965. /*
  1966. * WOW: replace cursor/icon handle
  1967. */
  1968. WINUSERAPI
  1969. BOOL
  1970. WINAPI
  1971. SetCursorContents( IN HCURSOR hCursor, IN HCURSOR hCursorNew);
  1972. #ifdef WX86
  1973. /*
  1974. * Wx86
  1975. * export from wx86.dll to convert an x86 hook proc to risc address.
  1976. */
  1977. typedef
  1978. PVOID
  1979. (*PFNWX86HOOKCALLBACK)(
  1980. SHORT HookType,
  1981. PVOID HookProc
  1982. );
  1983. typedef
  1984. HMODULE
  1985. (*PFNWX86LOADX86DLL)(
  1986. LPCWSTR lpLibFileName,
  1987. DWORD dwFlags
  1988. );
  1989. typedef
  1990. BOOL
  1991. (*PFNWX86FREEX86DLL)(
  1992. HMODULE hMod
  1993. );
  1994. #endif
  1995. typedef struct _TAG {
  1996. DWORD type;
  1997. DWORD style;
  1998. DWORD len;
  1999. } TAG, *PTAG;
  2000. #define MAKETAG(a, b, c, d) (DWORD)(a | (b<<8) | ((DWORD)c<<16) | ((DWORD)d<<24))
  2001. /* Valid TAG types. */
  2002. /* 'ASDF' (CONT) - Advanced Systems Data Format */
  2003. #define TAGT_ASDF MAKETAG('A', 'S', 'D', 'F')
  2004. /* 'RAD ' (CONT) - ?R Animation ?Definition (an aggregate type) */
  2005. #define TAGT_RAD MAKETAG('R', 'A', 'D', ' ')
  2006. /* 'ANIH' (DATA) - ANImation Header */
  2007. /* Contains an ANIHEADER structure. */
  2008. #define TAGT_ANIH MAKETAG('A', 'N', 'I', 'H')
  2009. /*
  2010. * 'RATE' (DATA) - RATE table (array of jiffies)
  2011. * Contains an array of JIFs. Each JIF specifies how long the corresponding
  2012. * animation frame is to be displayed before advancing to the next frame.
  2013. * If the AF_SEQUENCE flag is set then the count of JIFs == anih.cSteps,
  2014. * otherwise the count == anih.cFrames.
  2015. */
  2016. #define TAGT_RATE MAKETAG('R', 'A', 'T', 'E')
  2017. /*
  2018. * 'SEQ ' (DATA) - SEQuence table (array of frame index values)
  2019. * Countains an array of DWORD frame indices. anih.cSteps specifies how
  2020. * many.
  2021. */
  2022. #define TAGT_SEQ MAKETAG('S', 'E', 'Q', ' ')
  2023. /* 'ICON' (DATA) - Windows ICON format image (replaces MPTR) */
  2024. #define TAGT_ICON MAKETAG('I', 'C', 'O', 'N')
  2025. /* 'TITL' (DATA) - TITLe string (can be inside or outside aggregates) */
  2026. /* Contains a single ASCIIZ string that titles the file. */
  2027. #define TAGT_TITL MAKETAG('T', 'I', 'T', 'L')
  2028. /* 'AUTH' (DATA) - AUTHor string (can be inside or outside aggregates) */
  2029. /* Contains a single ASCIIZ string that indicates the author of the file. */
  2030. #define TAGT_AUTH MAKETAG('A', 'U', 'T', 'H')
  2031. #define TAGT_AXOR MAKETAG('A', 'X', 'O', 'R')
  2032. /* Valid TAG styles. */
  2033. /* 'CONT' - CONTainer chunk (contains other DATA and CONT chunks) */
  2034. #define TAGS_CONT MAKETAG('C', 'O', 'N', 'T')
  2035. /* 'DATA' - DATA chunk */
  2036. #define TAGS_DATA MAKETAG('D', 'A', 'T', 'A')
  2037. typedef DWORD JIF, *PJIF;
  2038. typedef struct _ANIHEADER { /* anih */
  2039. DWORD cbSizeof;
  2040. DWORD cFrames;
  2041. DWORD cSteps;
  2042. DWORD cx, cy;
  2043. DWORD cBitCount, cPlanes;
  2044. JIF jifRate;
  2045. DWORD fl;
  2046. } ANIHEADER, *PANIHEADER;
  2047. /* If the AF_ICON flag is specified the fields cx, cy, cBitCount, and */
  2048. /* cPlanes are all unused. Each frame will be of type ICON and will */
  2049. /* contain its own dimensional information. */
  2050. #define AF_ICON 0x0001L /* Windows format icon/cursor animation */
  2051. #define AF_SEQUENCE 0x0002L /* Animation is sequenced */
  2052. #define WINEVENT_32BITCALLER 0x8000 // - unused in NT
  2053. #define WINEVENT_VALID 0x0007 //
  2054. #ifdef REDIRECTION
  2055. #define EVENT_SYSTEM_REDIRECTEDPAINT 0x0018
  2056. #endif // REDIRECTION
  2057. // Output from DISPID_ACC_STATE (IanJa: taken from oleacc.h)
  2058. /*
  2059. * CONSTANTS
  2060. */
  2061. /*
  2062. * Object constants (these are NOT public). OBJID are public IDs for
  2063. * standard frame elements. But the indeces for their elements are not.
  2064. */
  2065. // TITLEBAR
  2066. #define INDEX_TITLEBAR_SELF 0
  2067. #define INDEX_TITLEBAR_IMEBUTTON 1
  2068. #define INDEX_TITLEBAR_MINBUTTON 2
  2069. #define INDEX_TITLEBAR_MAXBUTTON 3
  2070. #define INDEX_TITLEBAR_HELPBUTTON 4
  2071. #define INDEX_TITLEBAR_CLOSEBUTTON 5
  2072. #define INDEX_TITLEBAR_MIC 1
  2073. #define INDEX_TITLEBAR_MAC 5
  2074. #define INDEX_TITLEBAR_RESTOREBUTTON 6 // The min/max buttons turn into this
  2075. // SCROLLBAR
  2076. #define INDEX_SCROLLBAR_SELF 0
  2077. #define INDEX_SCROLLBAR_UP 1
  2078. #define INDEX_SCROLLBAR_UPPAGE 2
  2079. #define INDEX_SCROLLBAR_THUMB 3
  2080. #define INDEX_SCROLLBAR_DOWNPAGE 4
  2081. #define INDEX_SCROLLBAR_DOWN 5
  2082. #define INDEX_SCROLLBAR_MIC 1
  2083. #define INDEX_SCROLLBAR_MAC 5
  2084. #define INDEX_SCROLLBAR_LEFT 7
  2085. #define INDEX_SCROLLBAR_LEFTPAGE 8
  2086. #define INDEX_SCROLLBAR_HORZTHUMB 9
  2087. #define INDEX_SCROLLBAR_RIGHTPAGE 10
  2088. #define INDEX_SCROLLBAR_RIGHT 11
  2089. #define INDEX_SCROLLBAR_HORIZONTAL 6
  2090. #define INDEX_SCROLLBAR_GRIP 12
  2091. // COMBOBOXES
  2092. #define INDEX_COMBOBOX 0
  2093. #define INDEX_COMBOBOX_ITEM 1
  2094. #define INDEX_COMBOBOX_BUTTON 2
  2095. #define INDEX_COMBOBOX_LIST 3
  2096. #define CCHILDREN_COMBOBOX 3
  2097. #define CBLISTBOXID 1000
  2098. #define CBEDITID 1001
  2099. #define CBBUTTONID 1002
  2100. // CURSORS
  2101. #define CURSOR_SYSTEM_NOTHING -1
  2102. #define CURSOR_SYSTEM_UNKNOWN 0
  2103. #define CURSOR_SYSTEM_ARROW 1
  2104. #define CURSOR_SYSTEM_IBEAM 2
  2105. #define CURSOR_SYSTEM_WAIT 3
  2106. #define CURSOR_SYSTEM_CROSS 4
  2107. #define CURSOR_SYSTEM_UPARROW 5
  2108. #define CURSOR_SYSTEM_SIZENWSE 6
  2109. #define CURSOR_SYSTEM_SIZENESW 7
  2110. #define CURSOR_SYSTEM_SIZEWE 8
  2111. #define CURSOR_SYSTEM_SIZENS 9
  2112. #define CURSOR_SYSTEM_SIZEALL 10
  2113. #define CURSOR_SYSTEM_NO 11
  2114. #define CURSOR_SYSTEM_APPSTARTING 12
  2115. #define CURSOR_SYSTEM_HELP 13
  2116. #define CURSOR_SYSTEM_NWPEN 14
  2117. #define CURSOR_SYSTEM_HAND 15
  2118. #define CCURSOR_SYSTEM 15
  2119. #define GA_MIN 1
  2120. #define GA_MAX 3
  2121. #if(_WIN32_WINNT >= 0x0500)
  2122. /*
  2123. * The max number of tags to fail that can be
  2124. * specified to Win32PoolAllocationStats. If tagsCount is more than
  2125. * this value then all the pool allocations will fail.
  2126. */
  2127. #define MAX_TAGS_TO_FAIL 256
  2128. BOOL
  2129. WINAPI
  2130. Win32PoolAllocationStats(
  2131. IN LPDWORD parrTags,
  2132. IN SIZE_T tagCount,
  2133. OUT SIZE_T* lpdwMaxMem,
  2134. OUT SIZE_T* lpdwCrtMem,
  2135. OUT LPDWORD lpdwMaxAlloc,
  2136. OUT LPDWORD lpdwCrtAlloc);
  2137. #define WHF_DESKTOP 0x00000001
  2138. #define WHF_SHAREDHEAP 0x00000002
  2139. #define WHF_CSRSS 0x00000004
  2140. #define WHF_ALL (WHF_DESKTOP | WHF_SHAREDHEAP | WHF_CSRSS)
  2141. #define WHF_VALID WHF_ALL
  2142. VOID
  2143. WINAPI
  2144. DbgWin32HeapFail(
  2145. DWORD dwFlags,
  2146. BOOL bFail
  2147. );
  2148. typedef struct tagDBGHEAPSTAT {
  2149. DWORD dwTag;
  2150. DWORD dwSize;
  2151. DWORD dwCount;
  2152. } DBGHEAPSTAT, *PDBGHEAPSTAT;
  2153. DWORD
  2154. WINAPI
  2155. DbgWin32HeapStat(
  2156. PDBGHEAPSTAT phs,
  2157. DWORD dwLen,
  2158. DWORD dwFlags
  2159. );
  2160. #define WPROTOCOLNAME_LENGTH 10
  2161. #define WAUDIONAME_LENGTH 10
  2162. typedef struct tagWSINFO {
  2163. WCHAR ProtocolName[WPROTOCOLNAME_LENGTH];
  2164. WCHAR AudioDriverName[WAUDIONAME_LENGTH];
  2165. } WSINFO, *PWSINFO;
  2166. BOOL
  2167. GetWinStationInfo(
  2168. WSINFO* pWsInfo);
  2169. #endif /* _WIN32_WINNT >= 0x0500 */
  2170. /*
  2171. * The handle to this structure is passed in the lParam
  2172. * of WM_INPUT message.
  2173. * The application can call GetRawInputData API to
  2174. * get the detailed information, including the header
  2175. * and all the content of the Raw Input.
  2176. *
  2177. * For the bulk read the RawInput in the message loop,
  2178. * the application may call GetRawInputBuffer API.
  2179. *
  2180. * For the device specific information,
  2181. * the application may call GetRawInputDeviceInfo API.
  2182. *
  2183. * Raw Input is available only when the application
  2184. * calls SetRawInputDevices with valid device
  2185. * specifications.
  2186. */
  2187. #define RID_GETTYPE_INPUT 0x10000000
  2188. #define RID_GETTYPE_DEVICE 0x20000000
  2189. #define RID_GETTYPE_MASK 0xf0000000
  2190. #define RIDEV_ADD_OR_MODIFY 0x00000000
  2191. #define RIDEV_MODEMASK 0x00000001
  2192. #define RIDEV_INCLUDE 0x00000000
  2193. #define RIDEV_VALID 0x00000731
  2194. /*
  2195. * vkey table counts, macros, etc. input synchonized key state tables have
  2196. * 2 bits per vkey: fDown, fToggled. Async key state tables have 3 bits:
  2197. * fDown, fToggled, fDownSinceLastRead.
  2198. *
  2199. * Important! The array gafAsyncKeyState matches the bit positions of the
  2200. * afKeyState array in each thread info block. The fDownSinceLastRead bit
  2201. * for the async state is stored in a separate bit array, called
  2202. * gafAsyncKeyStateRecentDown.
  2203. *
  2204. * It is important that the bit positions of gafAsyncKeyState and
  2205. * pti->afKeyState match because we copy from one to the other to maintain
  2206. * key state synchronization between threads.
  2207. *
  2208. * These macros below MUST be used when setting / querying key state.
  2209. */
  2210. #define CVKKEYSTATE 256
  2211. #define CBKEYSTATE (CVKKEYSTATE >> 2)
  2212. #define CBKEYSTATERECENTDOWN (CVKKEYSTATE >> 3)
  2213. #define KEYSTATE_TOGGLE_BYTEMASK 0xAA // 10101010
  2214. #define KEYSTATE_DOWN_BYTEMASK 0x55 // 01010101
  2215. /*
  2216. * Two bits per VK (down & toggle) so we can pack 4 VK keystates into 1 byte:
  2217. *
  2218. * Byte 0 Byte 1
  2219. * .---.---.---.---.---.---.---.---. .---.---.---.---.---.---.---.---. .-- -
  2220. * | T | D | T | D | T | D | T | D | | T | D | T | D | T | D | T | D | |
  2221. * `---'---'---'---'---'---'---'---' `---'---'---'---'---'---'---'---' `-- -
  2222. * : VK 3 : VK 2 : VK 1 : VK 0 : : VK 7 : VK 6 : VK 5 : VK 4 : :
  2223. *
  2224. * KEY_BYTE(pb, vk) identifies the byte containing the VK's state
  2225. * KEY_DOWN_BIT(vk) identifies the VK's down bit within a byte
  2226. * KEY_TOGGLE_BIT(vk) identifies the VK's toggle bit within a byte
  2227. */
  2228. #define KEY_BYTE(pb, vk) pb[((BYTE)(vk)) >> 2]
  2229. #define KEY_DOWN_BIT(vk) (1 << ((((BYTE)(vk)) & 3) << 1))
  2230. #define KEY_TOGGLE_BIT(vk) (1 << (((((BYTE)(vk)) & 3) << 1) + 1))
  2231. #define TestKeyDownBit(pb, vk) (KEY_BYTE(pb,vk) & KEY_DOWN_BIT(vk))
  2232. #define SetKeyDownBit(pb, vk) (KEY_BYTE(pb,vk) |= KEY_DOWN_BIT(vk))
  2233. #define ClearKeyDownBit(pb, vk) (KEY_BYTE(pb,vk) &= ~KEY_DOWN_BIT(vk))
  2234. #define TestKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) & KEY_TOGGLE_BIT(vk))
  2235. #define SetKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) |= KEY_TOGGLE_BIT(vk))
  2236. #define ClearKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) &= ~KEY_TOGGLE_BIT(vk))
  2237. #define ToggleKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) ^= KEY_TOGGLE_BIT(vk))
  2238. /*
  2239. * Similar to the above, but here we need only one bit per VK (down)
  2240. * so we can pack 8 VK down states into 1 byte.
  2241. */
  2242. #define RKEY_BYTE(pb, vk) pb[((BYTE)(vk)) >> 3]
  2243. #define RKEY_BIT(vk) (1 << ((BYTE)(vk) & 7))
  2244. #define TestKeyRecentDownBit(pb, vk) (RKEY_BYTE(pb,vk) & RKEY_BIT(vk))
  2245. #define SetKeyRecentDownBit(pb, vk) (RKEY_BYTE(pb,vk) |= RKEY_BIT(vk))
  2246. #define ClearKeyRecentDownBit(pb, vk) (RKEY_BYTE(pb,vk) &= ~RKEY_BIT(vk))
  2247. #define TestKeyStateDown(pq, vk)\
  2248. TestKeyDownBit(pq->afKeyState, vk)
  2249. #define SetKeyStateDown(pq, vk)\
  2250. SetKeyDownBit(pq->afKeyState, vk)
  2251. #define ClearKeyStateDown(pq, vk)\
  2252. ClearKeyDownBit(pq->afKeyState, vk)
  2253. #define TestKeyStateToggle(pq, vk)\
  2254. TestKeyToggleBit(pq->afKeyState, vk)
  2255. #define SetKeyStateToggle(pq, vk)\
  2256. SetKeyToggleBit(pq->afKeyState, vk)
  2257. #define ClearKeyStateToggle(pq, vk)\
  2258. ClearKeyToggleBit(pq->afKeyState, vk)
  2259. #define TestAsyncKeyStateDown(vk)\
  2260. TestKeyDownBit(gafAsyncKeyState, vk)
  2261. #define SetAsyncKeyStateDown(vk)\
  2262. SetKeyDownBit(gafAsyncKeyState, vk)
  2263. #define ClearAsyncKeyStateDown(vk)\
  2264. ClearKeyDownBit(gafAsyncKeyState, vk)
  2265. #define TestAsyncKeyStateToggle(vk)\
  2266. TestKeyToggleBit(gafAsyncKeyState, vk)
  2267. #define SetAsyncKeyStateToggle(vk)\
  2268. SetKeyToggleBit(gafAsyncKeyState, vk)
  2269. #define ClearAsyncKeyStateToggle(vk)\
  2270. ClearKeyToggleBit(gafAsyncKeyState, vk)
  2271. #define TestAsyncKeyStateRecentDown(vk)\
  2272. TestKeyRecentDownBit(gafAsyncKeyStateRecentDown, vk)
  2273. #define SetAsyncKeyStateRecentDown(vk)\
  2274. SetKeyRecentDownBit(gafAsyncKeyStateRecentDown, vk)
  2275. #define ClearAsyncKeyStateRecentDown(vk)\
  2276. ClearKeyRecentDownBit(gafAsyncKeyStateRecentDown, vk)
  2277. #if(_WIN32_WINNT >= 0x0501)
  2278. #ifndef NOUSER
  2279. #ifndef NOSCROLL
  2280. #ifndef NOSYSMETRICS
  2281. #ifndef NOSYSPARAMSINFO
  2282. typedef BOOL (CALLBACK* OVERRIDEWNDPROC)(HWND, UINT, WPARAM, LPARAM, LRESULT*, void**);
  2283. typedef BOOL (CALLBACK* FORCERESETUSERAPIHOOK)(HMODULE hmod);
  2284. typedef VOID (CALLBACK* MDIREDRAWFRAMEPROC)(HWND hwndChild, BOOL fAdd);
  2285. /*
  2286. * Flags passed to UAH DLL's indicating current status of UAH.
  2287. *
  2288. * UIAH_INITIALIZE : UAH are being initialized for current process and DLL has just been loaded.
  2289. * UIAH_UNINITIALIZE : UAH are being uninitialized for current process and DLL is about to be unloaded.
  2290. * UIAH_UNHOOK : UAH have been unregistered system-wide but DLL can't be unloaded due to outstanding
  2291. * API calls into it. Table of function pointers (guah) has been reset to native
  2292. * user32 functions to prevent further calls.
  2293. */
  2294. #define UIAH_INITIALIZE 0
  2295. #define UIAH_UNINITIALIZE 1
  2296. #define UIAH_UNHOOK 2
  2297. typedef struct tagMSGMASK {
  2298. BYTE * rgb;
  2299. DWORD cb;
  2300. } MSGMASK, *PMSGMASK;
  2301. typedef struct tagUSEROWPINFO {
  2302. OVERRIDEWNDPROC pfnBeforeOWP;
  2303. OVERRIDEWNDPROC pfnAfterOWP;
  2304. MSGMASK mm;
  2305. } USEROWPINFO, *PUSEROWPINFO;
  2306. typedef struct tagUSERAPIHOOK {
  2307. DWORD cbSize;
  2308. WNDPROC pfnDefWindowProcA;
  2309. WNDPROC pfnDefWindowProcW;
  2310. MSGMASK mmDWP;
  2311. GETSCROLLINFOPROC pfnGetScrollInfo;
  2312. SETSCROLLINFOPROC pfnSetScrollInfo;
  2313. ENABLESCROLLBARPROC pfnEnableScrollBar;
  2314. ADJUSTWINDOWRECTEXPROC pfnAdjustWindowRectEx;
  2315. SETWINDOWRGNPROC pfnSetWindowRgn;
  2316. USEROWPINFO uoiWnd;
  2317. USEROWPINFO uoiDlg;
  2318. GETSYSTEMMETRICSPROC pfnGetSystemMetrics;
  2319. SYSTEMPARAMETERSINFO pfnSystemParametersInfoA;
  2320. SYSTEMPARAMETERSINFO pfnSystemParametersInfoW;
  2321. FORCERESETUSERAPIHOOK pfnForceResetUserApiHook;
  2322. DRAWFRAMECONTROLPROC pfnDrawFrameControl;
  2323. DRAWCAPTIONPROC pfnDrawCaption;
  2324. MDIREDRAWFRAMEPROC pfnMDIRedrawFrame;
  2325. } USERAPIHOOK, *PUSERAPIHOOK;
  2326. typedef BOOL (CALLBACK* INITUSERAPIHOOK)(DWORD dwCmd, void* pvParam);
  2327. WINUSERAPI
  2328. BOOL
  2329. WINAPI
  2330. RegisterUserApiHook(
  2331. IN HINSTANCE hmod,
  2332. IN INITUSERAPIHOOK pfnUserApiHook);
  2333. WINUSERAPI
  2334. BOOL
  2335. WINAPI
  2336. UnregisterUserApiHook(VOID);
  2337. #endif /*!NOSYSPARAMSINFO*/
  2338. #endif /*!NOSYSMETRICS*/
  2339. #endif /* NOSCROLL */
  2340. /*
  2341. * Message Hook
  2342. */
  2343. #ifndef NOMSG
  2344. typedef struct tagMESSAGEPUMPHOOK {
  2345. DWORD cbSize;
  2346. INTERNALGETMESSAGEPROC
  2347. pfnInternalGetMessage;
  2348. WAITMESSAGEEXPROC pfnWaitMessageEx;
  2349. GETQUEUESTATUSPROC pfnGetQueueStatus;
  2350. MSGWAITFORMULTIPLEOBJECTSEXPROC
  2351. pfnMsgWaitForMultipleObjectsEx;
  2352. } MESSAGEPUMPHOOK;
  2353. typedef BOOL (CALLBACK* INITMESSAGEPUMPHOOK)(DWORD dwCmd, void* pvParam);
  2354. WINUSERAPI
  2355. BOOL
  2356. WINAPI
  2357. RegisterMessagePumpHook(
  2358. IN INITMESSAGEPUMPHOOK pfnInitMPH);
  2359. WINUSERAPI
  2360. BOOL
  2361. WINAPI
  2362. UnregisterMessagePumpHook();
  2363. #endif /* NOMSG */
  2364. #endif /* NOUSER */
  2365. #endif /* _WIN32_WINNT >= 0x0501 */
  2366. #ifdef REDIRECTION
  2367. WINUSERAPI
  2368. BOOL
  2369. WINAPI
  2370. SetProcessRedirectionMode(
  2371. IN HANDLE hProcess,
  2372. IN BOOL bRedirectionMode);
  2373. WINUSERAPI
  2374. BOOL
  2375. WINAPI
  2376. GetProcessRedirectionMode(
  2377. IN HANDLE hProcess,
  2378. OUT PBOOL pbRedirectionMode);
  2379. WINUSERAPI
  2380. BOOL
  2381. WINAPI
  2382. SetDesktopRedirectionMode(
  2383. IN HANDLE hProcess,
  2384. IN BOOL bRedirectionMode);
  2385. WINUSERAPI
  2386. BOOL
  2387. WINAPI
  2388. GetDesktopRedirectionMode(
  2389. IN HANDLE hProcess,
  2390. OUT PBOOL pbRedirectionMode);
  2391. #endif // REDIRECTION
  2392. /*
  2393. * We set this bit in GetDeviceChangeInfo to signify that the drive letter
  2394. * represents a new drive.
  2395. */
  2396. #define HMCE_ARRIVAL 0x80000000
  2397. /*
  2398. * Shutdown reason code
  2399. */
  2400. #include <reason.h>
  2401. typedef struct _REASON_INITIALISER {
  2402. DWORD dwCode;
  2403. DWORD dwNameId;
  2404. DWORD dwDescId;
  2405. } REASON_INITIALISER;
  2406. typedef struct _REASON
  2407. {
  2408. DWORD dwCode;
  2409. WCHAR szName[MAX_REASON_NAME_LEN + 1];
  2410. WCHAR szDesc[MAX_REASON_DESC_LEN + 1];
  2411. } REASON, *PREASON;
  2412. typedef struct _REASONDATA
  2413. {
  2414. REASON** rgReasons;
  2415. int cReasons;
  2416. int cReasonCapacity;
  2417. DWORD dwReasonSelect;
  2418. WCHAR szComment[MAX_REASON_COMMENT_LEN + 1];
  2419. WCHAR szBugID[MAX_REASON_BUGID_LEN + 1];
  2420. int cCommentLen;
  2421. int cBugIDLen;
  2422. } REASONDATA, *PREASONDATA;
  2423. BOOL ReasonCodeNeedsComment(DWORD dwCode);
  2424. BOOL ReasonCodeNeedsBugID(DWORD dwCode);
  2425. BOOL BuildReasonArray(REASONDATA *pdata, BOOL forCleanUI, BOOL forDirtyUI);
  2426. VOID DestroyReasons(REASONDATA *pdata);
  2427. BOOL GetReasonTitleFromReasonCode(DWORD code, WCHAR *title, DWORD dwTitleLen);
  2428. // Reason Titles
  2429. #define IDS_REASON_UNPLANNED_HARDWARE_MAINTENANCE_TITLE 8250
  2430. #define IDS_REASON_PLANNED_HARDWARE_MAINTENANCE_TITLE 8251
  2431. #define IDS_REASON_UNPLANNED_HARDWARE_INSTALLATION_TITLE 8252
  2432. #define IDS_REASON_PLANNED_HARDWARE_INSTALLATION_TITLE 8253
  2433. #define IDS_REASON_UNPLANNED_OPERATINGSYSTEM_UPGRADE_TITLE 8254
  2434. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_UPGRADE_TITLE 8255
  2435. #define IDS_REASON_UNPLANNED_OPERATINGSYSTEM_RECONFIG_TITLE 8256
  2436. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_RECONFIG_TITLE 8257
  2437. #define IDS_REASON_APPLICATION_HUNG_TITLE 8258
  2438. #define IDS_REASON_APPLICATION_UNSTABLE_TITLE 8259
  2439. #define IDS_REASON_APPLICATION_MAINTENANCE_TITLE 8260
  2440. #define IDS_REASON_UNPLANNED_OTHER_TITLE 8261
  2441. #define IDS_REASON_PLANNED_OTHER_TITLE 8262
  2442. #define IDS_REASON_SYSTEMFAILURE_BLUESCREEN_TITLE 8263
  2443. #define IDS_REASON_POWERFAILURE_CORDUNPLUGGED_TITLE 8264
  2444. #define IDS_REASON_POWERFAILURE_ENVIRONMENT_TITLE 8265
  2445. #define IDS_REASON_OTHERFAILURE_HUNG_TITLE 8266
  2446. #define IDS_REASON_OTHERFAILURE_TITLE 8267
  2447. #define IDS_REASON_APPLICATION_PM_TITLE 8268
  2448. // Default reason title returned by GetReasonTitleFromReasonCode
  2449. #define IDS_REASON_DEFAULT_TITLE 8269
  2450. // Reason Descriptions
  2451. #define IDS_REASON_HARDWARE_MAINTENANCE_DESCRIPTION 8275
  2452. #define IDS_REASON_HARDWARE_INSTALLATION_DESCRIPTION 8276
  2453. #define IDS_REASON_OPERATINGSYSTEM_UPGRADE_DESCRIPTION 8277
  2454. #define IDS_REASON_OPERATINGSYSTEM_RECONFIG_DESCRIPTION 8278
  2455. #define IDS_REASON_APPLICATION_HUNG_DESCRIPTION 8279
  2456. #define IDS_REASON_APPLICATION_UNSTABLE_DESCRIPTION 8280
  2457. #define IDS_REASON_APPLICATION_MAINTENANCE_DESCRIPTION 8281
  2458. #define IDS_REASON_OTHER_DESCRIPTION 8282
  2459. #define IDS_REASON_SYSTEMFAILURE_BLUESCREEN_DESCRIPTION 8283
  2460. #define IDS_REASON_POWERFAILURE_CORDUNPLUGGED_DESCRIPTION 8284
  2461. #define IDS_REASON_POWERFAILURE_ENVIRONMENT_DESCRIPTION 8285
  2462. #define IDS_REASON_OTHERFAILURE_HUNG_DESCRIPTION 8286
  2463. #define IDS_REASON_APPLICATION_PM_DESCRIPTION 8287
  2464. #define WC_HARDERRORHANDLER "HardErrorHandler"
  2465. #define COPYDATA_HARDERROR "HardError"
  2466. typedef struct _tagHardErrorData
  2467. {
  2468. DWORD dwSize; // Size of this structure
  2469. DWORD dwError; // Hard Error
  2470. DWORD dwFlags; // Hard Error flags
  2471. UINT uOffsetTitleW; // Offset to UNICODE Title
  2472. UINT uOffsetTextW; // Offset to UNICODE Text
  2473. } HARDERRORDATA, *PHARDERRORDATA;
  2474. #ifdef __cplusplus
  2475. }
  2476. #endif /* __cplusplus */
  2477. #endif /* !_WINUSERP_ */