Leaked source code of windows server 2003
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.

2878 lines
97 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 | WS_EX_COMPOSITED)
  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. #ifdef REDIRECTION
  454. #define WS_EX_VALID50 (WS_EX_VALID40 | \
  455. WS_EX_LAYERED | \
  456. WS_EX_NOINHERITLAYOUT| \
  457. WS_EX_LAYOUTRTL | \
  458. WS_EX_COMPOSITED | \
  459. WS_EX_NOACTIVATE | \
  460. WS_EX_EXTREDIRECTED)
  461. #else
  462. #define WS_EX_VALID50 (WS_EX_VALID40 | \
  463. WS_EX_LAYERED | \
  464. WS_EX_NOINHERITLAYOUT| \
  465. WS_EX_LAYOUTRTL | \
  466. WS_EX_COMPOSITED | \
  467. WS_EX_NOACTIVATE)
  468. #endif // REDIRECTION
  469. #define WS_EX_INTERNAL (WS_EX_DRAGOBJECT | \
  470. WS_EX_ANSICREATOR)
  471. /*
  472. * We currently return to applications only the valid Ex_Style bits.
  473. * If declaring another macro i.e. WS_EX_VALID60, make sure to change WS_EX_ALLVALID
  474. */
  475. #define WS_EX_ALLVALID WS_EX_VALID50
  476. #define WF_DIALOG_WINDOW 0x00010000 // used in WOW32 -- this is a state flag, not a style flag
  477. #define CS_KEYCVTWINDOW 0x0004
  478. #define CS_OEMCHARS 0x0010 /* reserved (see user\server\usersrv.h) */
  479. #define CS_NOKEYCVT 0x0100
  480. #define CS_LVB 0x0400
  481. #define CS_SYSTEM 0x8000
  482. #define CS_VALID (CS_VREDRAW | \
  483. CS_HREDRAW | \
  484. CS_KEYCVTWINDOW | \
  485. CS_DBLCLKS | \
  486. CS_OEMCHARS | \
  487. CS_OWNDC | \
  488. CS_CLASSDC | \
  489. CS_PARENTDC | \
  490. CS_NOKEYCVT | \
  491. CS_NOCLOSE | \
  492. CS_SAVEBITS | \
  493. CS_BYTEALIGNCLIENT | \
  494. CS_BYTEALIGNWINDOW | \
  495. CS_GLOBALCLASS | \
  496. CS_DROPSHADOW | \
  497. CS_IME)
  498. #define CS_VALID31 0x0800ffef
  499. #define CS_VALID40 0x0803feeb
  500. #define BDR_VALID 0x000F
  501. #define BF_VALID (BF_MIDDLE | \
  502. BF_SOFT | \
  503. BF_ADJUST | \
  504. BF_FLAT | \
  505. BF_MONO | \
  506. BF_LEFT | \
  507. BF_TOP | \
  508. BF_RIGHT | \
  509. BF_BOTTOM | \
  510. BF_DIAGONAL)
  511. #define DFC_CACHE 0xFFFF
  512. #define DFCS_CAPTIONALL 0x000F
  513. #define DFCS_INMENU 0x0040
  514. #define DFCS_INSMALL 0x0080
  515. #define DFCS_MENUARROWUP 0x0008
  516. #define DFCS_MENUARROWDOWN 0x0010
  517. #define DFCS_SCROLLMIN 0x0000
  518. #define DFCS_SCROLLVERT 0x0000
  519. #define DFCS_SCROLLMAX 0x0001
  520. #define DFCS_SCROLLHORZ 0x0002
  521. #define DFCS_SCROLLLINE 0x0004
  522. #define DFCS_CACHEICON 0x0000
  523. #define DFCS_CACHEBUTTONS 0x0001
  524. #if(_WIN32_WINNT >= 0x0501)
  525. typedef BOOL (CALLBACK* DRAWFRAMECONTROLPROC)(
  526. IN HDC,
  527. IN OUT LPRECT,
  528. IN UINT,
  529. IN UINT);
  530. #endif /* _WIN32_WINNT >= 0x0501 */
  531. #define DC_LAMEBUTTON 0x0400
  532. #define DC_NOVISIBLE 0x0800
  533. #define DC_NOSENDMSG 0x2000
  534. #define DC_CENTER 0x4000
  535. #define DC_FRAME 0x8000
  536. #define DC_CAPTION (DC_ICON | DC_TEXT | DC_BUTTONS)
  537. #define DC_NC (DC_CAPTION | DC_FRAME)
  538. /* flags for WM_NCUAHDRAWFRAME */
  539. #if(_WIN32_WINNT >= 0x0501)
  540. #define DF_ACTIVE 0x0001
  541. #define DF_HUNGREDRAW 0x2000
  542. #endif /* _WIN32_WINNT >= 0x0501 */
  543. #if(_WIN32_WINNT >= 0x0501)
  544. typedef BOOL (CALLBACK* DRAWCAPTIONPROC)(
  545. IN HWND,
  546. IN HDC,
  547. IN CONST RECT *,
  548. IN UINT);
  549. #endif /* _WIN32_WINNT >= 0x0501 */
  550. WINUSERAPI
  551. BOOL
  552. WINAPI
  553. DrawCaptionTempA(
  554. IN HWND,
  555. IN HDC,
  556. IN LPCRECT,
  557. IN HFONT,
  558. IN HICON,
  559. IN LPCSTR,
  560. IN UINT);
  561. WINUSERAPI
  562. BOOL
  563. WINAPI
  564. DrawCaptionTempW(
  565. IN HWND,
  566. IN HDC,
  567. IN LPCRECT,
  568. IN HFONT,
  569. IN HICON,
  570. IN LPCWSTR,
  571. IN UINT);
  572. #ifdef UNICODE
  573. #define DrawCaptionTemp DrawCaptionTempW
  574. #else
  575. #define DrawCaptionTemp DrawCaptionTempA
  576. #endif // !UNICODE
  577. #define IDANI_CLOSE 2
  578. #define CF_FIRST 0
  579. #define WPF_VALID (WPF_SETMINPOSITION | \
  580. WPF_RESTORETOMAXIMIZED)
  581. /*
  582. * MEASUREITEMSTRUCT_EX for ownerdraw
  583. * used when server initiates a WM_MEASUREITEM and adds the additional info
  584. * of whether the itemData needs to be thunked when the message is sent to
  585. * the client (see also WM_MEASUREITEM_CLIENTDATA
  586. */
  587. typedef struct tagMEASUREITEMSTRUCT_EX {
  588. UINT CtlType;
  589. UINT CtlID;
  590. UINT itemID;
  591. UINT itemWidth;
  592. UINT itemHeight;
  593. ULONG_PTR itemData;
  594. BOOL bThunkClientData;
  595. } MEASUREITEMSTRUCT_EX, NEAR *PMEASUREITEMSTRUCT_EX, FAR *LPMEASUREITEMSTRUCT_EX;
  596. typedef BOOL (CALLBACK* INTERNALGETMESSAGEPROC)(OUT LPMSG lpMsg, IN HWND hwnd,
  597. IN UINT wMsgFilterMin, IN UINT wMsgFilterMax, IN UINT flags, IN BOOL fGetMessage);
  598. #define PM_VALID (PM_NOREMOVE | \
  599. PM_REMOVE | \
  600. PM_NOYIELD | \
  601. PM_QS_INPUT | \
  602. PM_QS_POSTMESSAGE | \
  603. PM_QS_PAINT | \
  604. PM_QS_SENDMESSAGE)
  605. #define MOD_SAS 0x8000
  606. #define MOD_VALID (MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_WIN|MOD_SAS)
  607. #define EW_RESTARTWINDOWS 0x0042L
  608. #define EW_REBOOTSYSTEM 0x0043L
  609. #define EWX_REALLYLOGOFF ENDSESSION_LOGOFF
  610. #define EWX_CANCELED 0x00000080
  611. #define EWX_SYSTEM_CALLER 0x00000100
  612. #define EWX_WINLOGON_CALLER 0x00000200
  613. #define EWX_WINLOGON_OLD_SYSTEM 0x00000400
  614. #define EWX_WINLOGON_OLD_SHUTDOWN 0x00000800
  615. #define EWX_WINLOGON_OLD_REBOOT 0x00001000
  616. #define EWX_WINLOGON_API_SHUTDOWN 0x00002000
  617. #define EWX_WINLOGON_OLD_POWEROFF 0x00004000
  618. #define EWX_NOTIFY 0x00008000
  619. #define EWX_NONOTIFY 0x00010000
  620. #define EWX_WINLOGON_INITIATED 0x00020000
  621. #define EWX_TERMSRV_INITIATED 0x00040000
  622. #define EWX_VALID (EWX_LOGOFF | \
  623. EWX_SHUTDOWN | \
  624. EWX_REBOOT | \
  625. EWX_FORCE | \
  626. EWX_POWEROFF | \
  627. EWX_FORCEIFHUNG | \
  628. EWX_NOTIFY | \
  629. EWX_TERMSRV_INITIATED)
  630. #define SHUTDOWN_FLAGS (EWX_SHUTDOWN | EWX_REBOOT | EWX_POWEROFF | \
  631. EWX_WINLOGON_OLD_SHUTDOWN | EWX_WINLOGON_OLD_REBOOT | \
  632. EWX_WINLOGON_OLD_POWEROFF)
  633. /*
  634. * Shutdown logging stuff
  635. */
  636. #define SR_EVENT_INITIATE_CLEAN 1
  637. #define SR_EVENT_INITIATE_CLEAN_ABORT 2
  638. #define SR_EVENT_EXITWINDOWS 3
  639. #define SR_EVENT_DIRTY 4
  640. typedef struct _SHUTDOWN_REASON
  641. {
  642. UINT cbSize; /* Set to sizeof(SHUTDOWN_REASON) */
  643. UINT uFlags; /* Shutdown flags; e.g., EWX_SHUTDOWN */
  644. DWORD dwReasonCode; /* Optional field */
  645. DWORD dwEventType; /* See #defines above */
  646. BOOL fShutdownCancelled; /* Optional field */
  647. LPWSTR lpszComment; /* Optional field */
  648. } SHUTDOWN_REASON, *PSHUTDOWN_REASON;
  649. WINUSERAPI
  650. BOOL
  651. WINAPI
  652. RecordShutdownReason(
  653. PSHUTDOWN_REASON psr);
  654. WINUSERAPI
  655. BOOL
  656. WINAPI
  657. DisplayExitWindowsWarnings(
  658. UINT uExitWindowsFlags);
  659. #define BSM_COMPONENTS 0x0000000F
  660. #define BSM_VALID 0x0000001F
  661. #define BSF_QUEUENOTIFYMESSAGE 0x20000000
  662. #define BSF_SYSTEMSHUTDOWN 0x40000000
  663. #define BSF_MSGSRV32OK 0x80000000
  664. #define BSF_VALID 0x000007FF
  665. #define BSF_ASYNC (BSF_POSTMESSAGE | BSF_SENDNOTIFYMESSAGE)
  666. //
  667. // NOTE: Completion port-based notification is not implemented in Win2K,
  668. // nor is it planned for Whistler.
  669. //
  670. #define DEVICE_NOTIFY_COMPLETION_HANDLE 0x00000002
  671. WINUSERAPI
  672. ULONG
  673. WINAPI
  674. DeviceEventWorker(
  675. IN HWND hWnd,
  676. IN WPARAM wParam,
  677. IN LPARAM lParam,
  678. IN DWORD dwFlags,
  679. OUT PDWORD pdwResult
  680. );
  681. typedef BOOL (CALLBACK* WAITMESSAGEEXPROC)(UINT fsWakeMask, DWORD dwTimeout);
  682. #define PW_VALID (PW_CLIENTONLY)
  683. #define LWA_VALID (LWA_COLORKEY | \
  684. LWA_ALPHA)
  685. #define ULW_VALID (ULW_COLORKEY | \
  686. ULW_ALPHA | \
  687. ULW_OPAQUE)
  688. #define FLASHW_FLASHNOFG 0x00000008
  689. #define FLASHW_TIMERCALL 0x00000400
  690. #define FLASHW_DONE 0x00000800
  691. #define FLASHW_STARTON 0x00001000
  692. #define FLASHW_COUNTING 0x00002000
  693. #define FLASHW_KILLTIMER 0x00004000
  694. #define FLASHW_ON 0x00008000
  695. #define FLASHW_VALID (FLASHW_ALL | FLASHW_TIMERNOFG)
  696. #define FLASHW_COUNTMASK 0xFFFF0000
  697. #define FLASHW_CALLERBITS (FLASHW_VALID | FLASHW_COUNTMASK)
  698. #define SWP_STATECHANGE 0x8000 /* force size, move messages */
  699. #define SWP_NOCLIENTSIZE 0x0800 /* Client didn't resize */
  700. #define SWP_NOCLIENTMOVE 0x1000 /* Client didn't move */
  701. #define SWP_DEFERDRAWING 0x2000
  702. #define SWP_CREATESPB 0x4000
  703. #define SWP_CHANGEMASK (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_HIDEWINDOW | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
  704. #define SWP_NOCHANGE (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
  705. #define SWP_VALID1 (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_FRAMECHANGED)
  706. #define SWP_VALID2 (SWP_SHOWWINDOW | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOSENDCHANGING | SWP_ASYNCWINDOWPOS | SWP_DEFERDRAWING | SWP_CREATESPB)
  707. #define SWP_VALID (SWP_VALID1 | SWP_VALID2)
  708. #define SWP_NOTIFYCREATE 0x10000000
  709. #define SWP_NOTIFYDESTROY 0x20000000
  710. #define SWP_NOTIFYACTIVATE 0x40000000
  711. #define SWP_NOTIFYFS 0x80000000
  712. #define SWP_NOTIFYALL (SWP_NOTIFYCREATE | SWP_NOTIFYDESTROY | SWP_NOTIFYACTIVATE | SWP_NOTIFYFS)
  713. #undef SWP_VALID
  714. #define SWP_VALID (SWP_DEFERERASE | \
  715. SWP_ASYNCWINDOWPOS | \
  716. SWP_NOCOPYBITS | \
  717. SWP_NOOWNERZORDER | \
  718. SWP_NOSENDCHANGING | \
  719. SWP_NOSIZE | \
  720. SWP_NOMOVE | \
  721. SWP_NOZORDER | \
  722. SWP_NOREDRAW | \
  723. SWP_NOACTIVATE | \
  724. SWP_FRAMECHANGED | \
  725. SWP_SHOWWINDOW | \
  726. SWP_HIDEWINDOW)
  727. #define HWND_GROUPTOTOP HWND_TOPMOST
  728. /*
  729. * WARNING:
  730. * The following structures must NOT be DWORD padded because they are
  731. * followed by strings, etc that do not have to be DWORD aligned.
  732. */
  733. #include <pshpack2.h>
  734. /*
  735. * Chicago dialog template
  736. */
  737. typedef struct {
  738. WORD wDlgVer;
  739. WORD wSignature;
  740. DWORD dwHelpID;
  741. DWORD dwExStyle;
  742. DWORD style;
  743. WORD cDlgItems;
  744. short x;
  745. short y;
  746. short cx;
  747. short cy;
  748. } DLGTEMPLATE2;
  749. typedef DLGTEMPLATE2 *LPDLGTEMPLATE2A;
  750. typedef DLGTEMPLATE2 *LPDLGTEMPLATE2W;
  751. #ifdef UNICODE
  752. typedef LPDLGTEMPLATE2W LPDLGTEMPLATE2;
  753. #else
  754. typedef LPDLGTEMPLATE2A LPDLGTEMPLATE2;
  755. #endif // UNICODE
  756. typedef CONST DLGTEMPLATE2 *LPCDLGTEMPLATE2A;
  757. typedef CONST DLGTEMPLATE2 *LPCDLGTEMPLATE2W;
  758. #ifdef UNICODE
  759. typedef LPCDLGTEMPLATE2W LPCDLGTEMPLATE2;
  760. #else
  761. typedef LPCDLGTEMPLATE2A LPCDLGTEMPLATE2;
  762. #endif // UNICODE
  763. /*
  764. * Dialog item template for NT 1.0a/Chicago (dit2)
  765. */
  766. typedef struct {
  767. DWORD dwHelpID;
  768. DWORD dwExStyle;
  769. DWORD style;
  770. short x;
  771. short y;
  772. short cx;
  773. short cy;
  774. DWORD dwID;
  775. } DLGITEMTEMPLATE2;
  776. typedef DLGITEMTEMPLATE2 *PDLGITEMTEMPLATE2A;
  777. typedef DLGITEMTEMPLATE2 *PDLGITEMTEMPLATE2W;
  778. #ifdef UNICODE
  779. typedef PDLGITEMTEMPLATE2W PDLGITEMTEMPLATE2;
  780. #else
  781. typedef PDLGITEMTEMPLATE2A PDLGITEMTEMPLATE2;
  782. #endif // UNICODE
  783. typedef DLGITEMTEMPLATE2 *LPDLGITEMTEMPLATE2A;
  784. typedef DLGITEMTEMPLATE2 *LPDLGITEMTEMPLATE2W;
  785. #ifdef UNICODE
  786. typedef LPDLGITEMTEMPLATE2W LPDLGITEMTEMPLATE2;
  787. #else
  788. typedef LPDLGITEMTEMPLATE2A LPDLGITEMTEMPLATE2;
  789. #endif // UNICODE
  790. #include <poppack.h> /* Resume normal packing */
  791. /*
  792. * The driver flags corresponding to these mouse events are
  793. * shifted to the right by one, e.g.
  794. * MOUSEEVENTF_LEFTDOWN >> 1 == MOUSE_LEFT_BUTTON_DOWN
  795. *
  796. * The mouse driver sends the fourth and fifth buttons corresponding
  797. * as button flags, so we define MOUSEEVENTF_ flags INTERNALLY for
  798. * mimicking the input sent by the driver.
  799. */
  800. #define MOUSEEVENTF_DRIVER_X1DOWN 0x0080 /* x1 button down */
  801. #define MOUSEEVENTF_DRIVER_X1UP 0x0100 /* x1 button up */
  802. #define MOUSEEVENTF_DRIVER_X2DOWN 0x0200 /* x2 button down */
  803. #define MOUSEEVENTF_DRIVER_X2UP 0x0400 /* x2 button up */
  804. /* Legal MOUSEEVENTF_ flags that indicate a button has been pressed or the wheel moved */
  805. #define MOUSEEVENTF_BUTTONMASK \
  806. (MOUSEEVENTF_LEFTDOWN | \
  807. MOUSEEVENTF_LEFTUP | \
  808. MOUSEEVENTF_RIGHTDOWN | \
  809. MOUSEEVENTF_RIGHTUP | \
  810. MOUSEEVENTF_MIDDLEDOWN | \
  811. MOUSEEVENTF_MIDDLEUP | \
  812. MOUSEEVENTF_XDOWN | \
  813. MOUSEEVENTF_XUP | \
  814. MOUSEEVENTF_WHEEL)
  815. /* MOUSEEVENTF_ flags that indicate useful data in the mouseData field */
  816. #define MOUSEEVENTF_MOUSEDATAMASK \
  817. (MOUSEEVENTF_XDOWN | \
  818. MOUSEEVENTF_XUP | \
  819. MOUSEEVENTF_WHEEL)
  820. typedef DWORD (CALLBACK* GETQUEUESTATUSPROC)(IN UINT flags);
  821. typedef DWORD (CALLBACK* MSGWAITFORMULTIPLEOBJECTSEXPROC)(IN DWORD nCount, IN CONST HANDLE *pHandles, IN DWORD dwMilliseconds, IN DWORD dwWakeMask, IN DWORD dwFlags);
  822. #define MWMO_VALID 0x0007
  823. #define QS_SMSREPLY 0x0200
  824. #define QS_THREADATTACHED 0x0800
  825. #define QS_EXCLUSIVE 0x1000 // wait for these events only!!
  826. #define QS_EVENT 0x2000 // signifies event message
  827. #define QS_TRANSFER 0x4000 // Input was transfered from another thread
  828. // 0x8000 // unused, but should not be used for external API.
  829. // Win9x has used this for SMSREPLY
  830. #define QS_VALID (QS_KEY | \
  831. QS_MOUSEMOVE | \
  832. QS_MOUSEBUTTON | \
  833. QS_POSTMESSAGE | \
  834. QS_TIMER | \
  835. QS_PAINT | \
  836. QS_SENDMESSAGE | \
  837. QS_TRANSFER | \
  838. QS_HOTKEY | \
  839. QS_ALLPOSTMESSAGE| \
  840. QS_RAWINPUT)
  841. /*
  842. * QS_EVENT is used to clear the QS_EVENT bit, QS_EVENTSET is used to
  843. * set the bit.
  844. *
  845. * Include QS_SENDMESSAGE because the queue events
  846. * match what a win3.1 app would see as the QS_SENDMESSAGE bit. Plus 16 bit
  847. * apps don't even know about QS_EVENT.
  848. */
  849. #define QS_EVENTSET (QS_EVENT | QS_SENDMESSAGE)
  850. /*
  851. * When you add a system metric, be sure to
  852. * add it to userexts.c in the function Idsi.
  853. */
  854. #define SM_UNUSED_64 64
  855. #define SM_UNUSED_65 65
  856. #define SM_UNUSED_66 66
  857. #define SM_BOOLEANS 85
  858. /*
  859. * Add system metrics that don't take space in gpsi->aiSysMet here.
  860. */
  861. /*
  862. * To add a BOOLEAN system metric increment SM_ENDBOOLRANGE by 1 and make your
  863. * SM_XXXX constant that new value.
  864. */
  865. #define SM_STARTBOOLRANGE 0x2000
  866. #define SM_ENDBOOLRANGE 0x2001
  867. /*
  868. * When you add a system metric, be sure to
  869. * add it to userexts.c in the function Idsi.
  870. */
  871. #if(_WIN32_WINNT >= 0x0501)
  872. typedef int (CALLBACK* GETSYSTEMMETRICSPROC)(IN int nIndex);
  873. #endif /* _WIN32_WINNT >= 0x0501 */
  874. #define PMB_VALID PMB_ACTIVE
  875. WINUSERAPI
  876. UINT
  877. WINAPI
  878. PaintMenuBar(
  879. IN HWND hwnd,
  880. IN HDC hdc,
  881. IN int iLeftOffset,
  882. IN int iRightOffset,
  883. IN int iTopOffset,
  884. IN DWORD dwFlags);
  885. WINUSERAPI
  886. UINT
  887. WINAPI
  888. CalcMenuBar(
  889. IN HWND hwnd,
  890. IN int iLeftOffset,
  891. IN int iRightOffset,
  892. IN int iTopOffset,
  893. IN LPCRECT prcWnd);
  894. WINUSERAPI
  895. int
  896. WINAPI
  897. DrawMenuBarTemp(
  898. IN HWND,
  899. IN HDC,
  900. IN LPCRECT,
  901. IN HMENU,
  902. IN HFONT);
  903. WINUSERAPI BOOL WINAPI SetSystemMenu( IN HWND, IN HMENU);
  904. /*
  905. * MNS_ values are stored in pMenu->fFlags.
  906. * Low order bits are used for internal MF* flags defined in user.h
  907. */
  908. #define MNS_LAST 0x04000000
  909. #define MNS_VALID 0xFC000000
  910. #define MIM_MASK 0x8000001F
  911. #define MNGOF_GAP 0x00000003
  912. #define MNGOF_CROSSBOUNDARY 0x00000004
  913. #define MIIM_MASK 0x000001FF
  914. #define HBMMENU_MIN ((HBITMAP) 0)
  915. #define HBMMENU_MBARFIRST ((HBITMAP) 2)
  916. #define HBMMENU_UNUSED ((HBITMAP) 4)
  917. #define HBMMENU_MBARLAST ((HBITMAP) 7)
  918. #define HBMMENU_POPUPFIRST ((HBITMAP) 8)
  919. #define HBMMENU_POPUPLAST ((HBITMAP) 11)
  920. #define HBMMENU_MAX ((HBITMAP) 12)
  921. /*
  922. * Make sure to keep this in synch with the MENUITEMINFO structure. It should
  923. * be equal to the size of the structure pre NT5.
  924. */
  925. #define SIZEOFMENUITEMINFO95 FIELD_OFFSET(MENUITEMINFO, hbmpItem)
  926. #define TPM_SYSMENU 0x0200L
  927. #define TPM_FIRSTANIBITPOS 10
  928. #define TPM_ANIMATIONBITS 0x3C00L
  929. #if (WINVER >= 0x0500)
  930. #define TPM_VALID (TPM_LEFTBUTTON | \
  931. TPM_RIGHTBUTTON | \
  932. TPM_LEFTALIGN | \
  933. TPM_CENTERALIGN | \
  934. TPM_RIGHTALIGN | \
  935. TPM_TOPALIGN | \
  936. TPM_VCENTERALIGN | \
  937. TPM_BOTTOMALIGN | \
  938. TPM_HORIZONTAL | \
  939. TPM_VERTICAL | \
  940. TPM_NONOTIFY | \
  941. TPM_RECURSE | \
  942. TPM_RETURNCMD | \
  943. TPM_HORPOSANIMATION | \
  944. TPM_HORNEGANIMATION | \
  945. TPM_VERPOSANIMATION | \
  946. TPM_VERNEGANIMATION | \
  947. TPM_NOANIMATION |\
  948. TPM_LAYOUTRTL)
  949. #else /* (WINVER >= 0x0500) */
  950. #define TPM_VALID (TPM_LEFTBUTTON | \
  951. TPM_RIGHTBUTTON | \
  952. TPM_LEFTALIGN | \
  953. TPM_CENTERALIGN | \
  954. TPM_RIGHTALIGN | \
  955. TPM_TOPALIGN | \
  956. TPM_VCENTERALIGN | \
  957. TPM_BOTTOMALIGN | \
  958. TPM_HORIZONTAL | \
  959. TPM_VERTICAL | \
  960. TPM_NONOTIFY | \
  961. TPM_RETURNCMD)
  962. #endif /* (WINVER >= 0x0500) */
  963. typedef struct _dropfilestruct {
  964. DWORD pFiles; // offset of file list
  965. POINT pt; // drop point
  966. BOOL fNC; // is it on NonClient area
  967. BOOL fWide; // WIDE character switch
  968. } DROPFILESTRUCT, FAR * LPDROPFILESTRUCT;
  969. #define DT_VALID 0x0007ffff /* union of all others */
  970. #undef DT_VALID
  971. #define DT_VALID (DT_CENTER | \
  972. DT_RIGHT | \
  973. DT_VCENTER | \
  974. DT_BOTTOM | \
  975. DT_WORDBREAK | \
  976. DT_SINGLELINE | \
  977. DT_EXPANDTABS | \
  978. DT_TABSTOP | \
  979. DT_NOCLIP | \
  980. DT_EXTERNALLEADING | \
  981. DT_CALCRECT | \
  982. DT_NOPREFIX | \
  983. DT_INTERNAL | \
  984. DT_EDITCONTROL | \
  985. DT_PATH_ELLIPSIS | \
  986. DT_END_ELLIPSIS | \
  987. DT_MODIFYSTRING | \
  988. DT_RTLREADING | \
  989. DT_WORD_ELLIPSIS | \
  990. DT_NOFULLWIDTHCHARBREAK |\
  991. DT_HIDEPREFIX | \
  992. DT_PREFIXONLY )
  993. #define DST_TEXTMAX 0x0002
  994. #define DST_GLYPH 0x0005
  995. #define DST_TYPEMASK 0x0007
  996. #define DST_GRAYSTRING 0x0008
  997. #define DSS_DEFAULT 0x0040
  998. #define DSS_INACTIVE 0x0100
  999. #define DCX_INVALID 0x00000800L
  1000. #define DCX_INUSE 0x00001000L
  1001. #define DCX_SAVEDRGNINVALID 0x00002000L
  1002. #define DCX_REDIRECTED 0x00004000L
  1003. #define DCX_OWNDC 0x00008000L
  1004. #define DCX_USESTYLE 0x00010000L
  1005. #define DCX_NEEDFONT 0x00020000L
  1006. #define DCX_NODELETERGN 0x00040000L
  1007. #define DCX_NOCLIPCHILDREN 0x00080000L
  1008. #define DCX_NORECOMPUTE 0x00100000L
  1009. #define DCX_DESTROYTHIS 0x00400000L
  1010. #define DCX_CREATEDC 0x00800000L
  1011. #define DCX_REDIRECTEDBITMAP 0x08000000L
  1012. #define DCX_PWNDORGINVISIBLE 0x10000000L
  1013. #define DCX_NOMIRROR 0x40000000L // Don't RTL Mirror DC (RTL_MIRRORING)
  1014. #define DCX_MATCHMASK (DCX_WINDOW | \
  1015. DCX_CACHE | \
  1016. DCX_REDIRECTED | \
  1017. DCX_CLIPCHILDREN | \
  1018. DCX_CLIPSIBLINGS | \
  1019. DCX_NORESETATTRS | \
  1020. DCX_LOCKWINDOWUPDATE | \
  1021. DCX_CREATEDC)
  1022. #define DCX_VALID (DCX_WINDOW | \
  1023. DCX_CACHE | \
  1024. DCX_NORESETATTRS | \
  1025. DCX_CLIPCHILDREN | \
  1026. DCX_CLIPSIBLINGS | \
  1027. DCX_PARENTCLIP | \
  1028. DCX_EXCLUDERGN | \
  1029. DCX_INTERSECTRGN | \
  1030. DCX_EXCLUDEUPDATE | \
  1031. DCX_INTERSECTUPDATE | \
  1032. DCX_LOCKWINDOWUPDATE | \
  1033. DCX_INVALID | \
  1034. DCX_INUSE | \
  1035. DCX_SAVEDRGNINVALID | \
  1036. DCX_OWNDC | \
  1037. DCX_USESTYLE | \
  1038. DCX_NEEDFONT | \
  1039. DCX_NODELETERGN | \
  1040. DCX_NOCLIPCHILDREN | \
  1041. DCX_NORECOMPUTE | \
  1042. DCX_VALIDATE | \
  1043. DCX_DESTROYTHIS | \
  1044. DCX_CREATEDC)
  1045. /*
  1046. * DCX_MASK define valid DCX flags callable from applications.
  1047. * Note that DCX_USESTYLE and DCX_NODELETERGN should not be here.
  1048. * Themes uses them extensively so they are just an exception.
  1049. */
  1050. #define DCX_MASK (DCX_WINDOW | \
  1051. DCX_CACHE | \
  1052. DCX_NORESETATTRS | \
  1053. DCX_CLIPCHILDREN | \
  1054. DCX_CLIPSIBLINGS | \
  1055. DCX_PARENTCLIP | \
  1056. DCX_EXCLUDERGN | \
  1057. DCX_INTERSECTRGN | \
  1058. DCX_EXCLUDEUPDATE | \
  1059. DCX_INTERSECTUPDATE | \
  1060. DCX_LOCKWINDOWUPDATE | \
  1061. DCX_USESTYLE | \
  1062. DCX_NODELETERGN | \
  1063. DCX_VALIDATE)
  1064. WINUSERAPI
  1065. BOOL
  1066. WINAPI
  1067. AlignRects(
  1068. IN OUT LPRECT arc,
  1069. IN DWORD cCount,
  1070. IN DWORD iPrimary,
  1071. IN DWORD dwFlags);
  1072. //
  1073. // AlignRects flags
  1074. //
  1075. #define CUDR_NORMAL 0x0000
  1076. #define CUDR_NOSNAPTOGRID 0x0001
  1077. #define CUDR_NORESOLVEPOSITIONS 0x0002
  1078. #define CUDR_NOCLOSEGAPS 0x0004
  1079. #define CUDR_NOPRIMARY 0x0010
  1080. #if(_WIN32_WINNT >= 0x0501)
  1081. typedef int (CALLBACK* SETWINDOWRGNPROC)(IN HWND hWnd, IN HRGN hRgn, IN BOOL bRedraw);
  1082. #endif /* _WIN32_WINNT >= 0x0501 */
  1083. #define RDW_REDRAWWINDOW 0x1000 /* Called from RedrawWindow()*/
  1084. #define RDW_SUBTRACTSELF 0x2000 /* Subtract self from hrgn */
  1085. #define RDW_COPYRGN 0x4000 /* Copy the passed-in region */
  1086. #define RDW_IGNOREUPDATEDIRTY 0x8000 /* Ignore WFUPDATEDIRTY */
  1087. #define RDW_INVALIDATELAYERS 0x00010000 /* Allow layered windows invalidation */
  1088. #define RDW_VALIDMASK (RDW_INVALIDATE | \
  1089. RDW_INTERNALPAINT | \
  1090. RDW_ERASE | \
  1091. RDW_VALIDATE | \
  1092. RDW_NOINTERNALPAINT | \
  1093. RDW_NOERASE | \
  1094. RDW_NOCHILDREN | \
  1095. RDW_ALLCHILDREN | \
  1096. RDW_UPDATENOW | \
  1097. RDW_ERASENOW | \
  1098. RDW_FRAME | \
  1099. RDW_NOFRAME)
  1100. #define SW_EXACTTIME 0x0020
  1101. #define SW_SCROLLWINDOW 0x8000 /* Called from ScrollWindow() */
  1102. #define SW_VALIDFLAGS (SW_SCROLLWINDOW | \
  1103. SW_SCROLLCHILDREN | \
  1104. SW_INVALIDATE | \
  1105. SW_SMOOTHSCROLL | \
  1106. SW_EXACTTIME | \
  1107. SW_ERASE)
  1108. #if(_WIN32_WINNT >= 0x0501)
  1109. typedef BOOL (CALLBACK* ENABLESCROLLBARPROC)(IN HWND hWnd, IN UINT wSBflags, IN UINT wArrows);
  1110. #endif /* _WIN32_WINNT >= 0x0501 */
  1111. #define ESB_MAX 0x0003
  1112. #define SB_DISABLE_MASK ESB_DISABLE_BOTH
  1113. #if(_WIN32_WINNT >= 0x0501)
  1114. typedef BOOL (CALLBACK* ADJUSTWINDOWRECTEXPROC)(IN OUT LPRECT lpRect, IN DWORD dwStyle,
  1115. IN BOOL bMenu, IN DWORD dwExStyle);
  1116. #endif /* _WIN32_WINNT >= 0x0501 */
  1117. /*
  1118. * Help Engine stuff
  1119. *
  1120. * Note: for Chicago this is in winhelp.h and called WINHLP
  1121. */
  1122. typedef struct {
  1123. WORD cbData; /* Size of data */
  1124. WORD usCommand; /* Command to execute */
  1125. ULONG_PTR ulTopic; /* Topic/context number (if needed) */
  1126. DWORD ulReserved; /* Reserved (internal use) */
  1127. WORD offszHelpFile; /* Offset to help file in block */
  1128. WORD offabData; /* Offset to other data in block */
  1129. } HLP, *LPHLP;
  1130. #if(WINVER >= 0x0500)
  1131. #define MB_LASTVALIDTYPE MB_CANCELTRYCONTINUE
  1132. #else
  1133. #define MB_LASTVALIDTYPE MB_RETRYCANCEL
  1134. #endif
  1135. #define MBEX_VALIDL 0xf3f7
  1136. #define MBEX_VALIDH 1
  1137. WINUSERAPI
  1138. int
  1139. WINAPI
  1140. MessageBoxTimeoutA(
  1141. IN HWND hWnd,
  1142. IN LPCSTR lpText,
  1143. IN LPCSTR lpCaption,
  1144. IN UINT uType,
  1145. IN WORD wLanguageId,
  1146. IN DWORD dwTimeout);
  1147. WINUSERAPI
  1148. int
  1149. WINAPI
  1150. MessageBoxTimeoutW(
  1151. IN HWND hWnd,
  1152. IN LPCWSTR lpText,
  1153. IN LPCWSTR lpCaption,
  1154. IN UINT uType,
  1155. IN WORD wLanguageId,
  1156. IN DWORD dwTimeout);
  1157. #ifdef UNICODE
  1158. #define MessageBoxTimeout MessageBoxTimeoutW
  1159. #else
  1160. #define MessageBoxTimeout MessageBoxTimeoutA
  1161. #endif // !UNICODE
  1162. #define MB_VALID (MB_OK | \
  1163. MB_OKCANCEL | \
  1164. MB_ABORTRETRYIGNORE | \
  1165. MB_YESNOCANCEL | \
  1166. MB_YESNO | \
  1167. MB_RETRYCANCEL | \
  1168. MB_ICONHAND | \
  1169. MB_ICONQUESTION | \
  1170. MB_ICONEXCLAMATION | \
  1171. MB_ICONASTERISK | \
  1172. MB_DEFBUTTON1 | \
  1173. MB_DEFBUTTON2 | \
  1174. MB_DEFBUTTON3 | \
  1175. MB_DEFBUTTON4 | \
  1176. MB_APPLMODAL | \
  1177. MB_SYSTEMMODAL | \
  1178. MB_TASKMODAL | \
  1179. MB_HELP | \
  1180. MB_TOPMOST | \
  1181. MB_RIGHT | \
  1182. MB_RTLREADING | \
  1183. MB_NOFOCUS | \
  1184. MB_SETFOREGROUND | \
  1185. MB_DEFAULT_DESKTOP_ONLY | \
  1186. MB_SERVICE_NOTIFICATION | \
  1187. MB_TYPEMASK | \
  1188. MB_USERICON | \
  1189. MB_ICONMASK | \
  1190. MB_DEFMASK | \
  1191. MB_MODEMASK | \
  1192. MB_MISCMASK)
  1193. #define CWP_VALID (CWP_SKIPINVISIBLE | CWP_SKIPDISABLED | CWP_SKIPTRANSPARENT)
  1194. #define COLOR_3DALTFACE 25
  1195. #if(WINVER >= 0x0501)
  1196. #define COLOR_ENDCOLORS COLOR_MENUBAR
  1197. #else
  1198. #define COLOR_ENDCOLORS COLOR_INFOBK
  1199. #endif /* WINVER >= 0x0501 */
  1200. #define COLOR_MAX (COLOR_ENDCOLORS+1)
  1201. WINUSERAPI
  1202. HANDLE
  1203. WINAPI
  1204. SetSysColorsTemp(
  1205. IN CONST COLORREF *,
  1206. IN CONST HBRUSH *,
  1207. IN UINT_PTR wCnt);
  1208. /*
  1209. * RTL Mirroring APIs (RTL_MIRRORING)
  1210. */
  1211. WINUSERAPI
  1212. BOOL
  1213. WINAPI
  1214. SetDeskWallpaper(
  1215. IN LPCSTR lpString);
  1216. WINUSERAPI
  1217. HWND
  1218. WINAPI
  1219. CreateDialogIndirectParamAorW(
  1220. IN HANDLE hmod,
  1221. IN LPCDLGTEMPLATE lpDlgTemplate,
  1222. IN HWND hwndOwner,
  1223. IN DLGPROC lpDialogFunc,
  1224. IN LPARAM dwInitParam,
  1225. IN UINT fAnsi);
  1226. WINUSERAPI
  1227. INT_PTR
  1228. WINAPI
  1229. DialogBoxIndirectParamAorW(
  1230. IN HINSTANCE hmod,
  1231. IN LPCDLGTEMPLATEW lpDlgTemplate,
  1232. IN HWND hwndOwner,
  1233. IN DLGPROC lpDialogFunc,
  1234. IN LPARAM dwInitParam,
  1235. IN UINT fAnsiFlags);
  1236. WINUSERAPI
  1237. void
  1238. WINAPI
  1239. LoadLocalFonts(void);
  1240. WINUSERAPI
  1241. UINT
  1242. WINAPI
  1243. UserRealizePalette(IN HDC hdc);
  1244. WINUSERAPI BOOL WINAPI SetShellWindow( IN HWND);
  1245. WINUSERAPI BOOL WINAPI SetShellWindowEx( IN HWND, IN HWND);
  1246. WINUSERAPI HWND WINAPI GetProgmanWindow(void);
  1247. WINUSERAPI BOOL WINAPI SetProgmanWindow( IN HWND);
  1248. WINUSERAPI HWND WINAPI GetTaskmanWindow(void);
  1249. WINUSERAPI BOOL WINAPI SetTaskmanWindow( IN HWND);
  1250. WINUSERAPI
  1251. BOOL
  1252. WINAPI
  1253. IsWindowInDestroy(IN HWND hwnd);
  1254. WINUSERAPI
  1255. BOOL
  1256. WINAPI
  1257. IsServerSideWindow(IN HWND hwnd);
  1258. WINUSERAPI HWND WINAPI GetNextQueueWindow ( IN HWND hWnd, IN INT nCmd);
  1259. #define MF_CHANGE_VALID (MF_INSERT | \
  1260. MF_CHANGE | \
  1261. MF_APPEND | \
  1262. MF_DELETE | \
  1263. MF_REMOVE | \
  1264. MF_BYCOMMAND | \
  1265. MF_BYPOSITION | \
  1266. MF_SEPARATOR | \
  1267. MF_ENABLED | \
  1268. MF_GRAYED | \
  1269. MF_DISABLED | \
  1270. MF_UNCHECKED | \
  1271. MF_CHECKED | \
  1272. MF_USECHECKBITMAPS | \
  1273. MF_STRING | \
  1274. MF_BITMAP | \
  1275. MF_OWNERDRAW | \
  1276. MF_POPUP | \
  1277. MF_MENUBARBREAK | \
  1278. MF_MENUBREAK | \
  1279. MF_UNHILITE | \
  1280. MF_HILITE | \
  1281. MF_SYSMENU)
  1282. #define MF_VALID (MF_CHANGE_VALID | \
  1283. MF_HELP | \
  1284. MF_MOUSESELECT)
  1285. #define MFT_MASK 0x00036B64L
  1286. #define MFS_HOTTRACK MF_APPEND
  1287. #define MFS_MASK 0x0000108BL
  1288. #define MFS_HOTTRACKDRAWN 0x10000000L
  1289. #define MFS_CACHEDBMP 0x20000000L
  1290. #define MFS_BOTTOMGAPDROP 0x40000000L
  1291. #define MFS_TOPGAPDROP 0x80000000L
  1292. #define MFS_GAPDROP 0xC0000000L
  1293. #define MFR_POPUP 0x01
  1294. #define MFR_END 0x80
  1295. #define MFT_OLDAPI_MASK 0x00006B64L
  1296. #define MFS_OLDAPI_MASK 0x0000008BL
  1297. #define MFT_NONSTRING 0x00000904L
  1298. #define MFT_BREAK 0x00000060L
  1299. typedef struct { // version 1
  1300. DWORD dwHelpID;
  1301. DWORD fType;
  1302. DWORD fState;
  1303. DWORD menuId;
  1304. WORD wResInfo;
  1305. WCHAR mtString[1];
  1306. } MENUITEMTEMPLATE2, *PMENUITEMTEMPLATE2;
  1307. #define SC_LAMEBUTTON 0xF190
  1308. #define IDC_NWPEN MAKEINTRESOURCE(32531)
  1309. #define IDC_HUNG MAKEINTRESOURCE(32632)
  1310. WINUSERAPI UINT PrivateExtractIconExA(
  1311. IN LPCSTR szFileName,
  1312. IN int nIconIndex,
  1313. OUT HICON *phiconLarge,
  1314. OUT HICON *phiconSmall,
  1315. IN UINT nIcons);
  1316. WINUSERAPI UINT PrivateExtractIconExW(
  1317. IN LPCWSTR szFileName,
  1318. IN int nIconIndex,
  1319. OUT HICON *phiconLarge,
  1320. OUT HICON *phiconSmall,
  1321. IN UINT nIcons);
  1322. #ifdef UNICODE
  1323. #define PrivateExtractIconEx PrivateExtractIconExW
  1324. #else
  1325. #define PrivateExtractIconEx PrivateExtractIconExA
  1326. #endif // !UNICODE
  1327. #define LR_GLOBAL 0x0100
  1328. #define LR_ENVSUBST 0x0200
  1329. #define LR_ACONFRAME 0x0400
  1330. #define LR_CREATEREALDIB 0x0800
  1331. #define LR_VALID 0xF8FF
  1332. #define DI_VALID (DI_MASK | DI_IMAGE | DI_COMPAT | DI_DEFAULTSIZE | DI_NOMIRROR)
  1333. #define OBM_STARTUP 32733
  1334. #define OBM_TRUETYPE 32732
  1335. #define OBM_HELP 32731
  1336. #define OBM_HELPD 32730
  1337. #define OBM_RDRVERT 32559
  1338. #define OBM_RDRHORZ 32660
  1339. #define OBM_RDR2DIM 32661
  1340. #define OCR_NWPEN 32631
  1341. #define OCR_HELP 32651
  1342. #define OCR_RDRVERT 32652
  1343. #define OCR_RDRHORZ 32653
  1344. #define OCR_RDR2DIM 32654
  1345. #define OCR_RDRNORTH 32655
  1346. #define OCR_RDRSOUTH 32656
  1347. #define OCR_RDRWEST 32657
  1348. #define OCR_RDREAST 32658
  1349. #define OCR_RDRNORTHWEST 32659
  1350. #define OCR_RDRNORTHEAST 32660
  1351. #define OCR_RDRSOUTHWEST 32661
  1352. #define OCR_RDRSOUTHEAST 32662
  1353. #define OCR_AUTORUN 32663
  1354. /*
  1355. * Default Cursor IDs to get original image from User
  1356. */
  1357. #define OCR_FIRST_DEFAULT 100
  1358. #define OCR_ARROW_DEFAULT 100
  1359. #define OCR_IBEAM_DEFAULT 101
  1360. #define OCR_WAIT_DEFAULT 102
  1361. #define OCR_CROSS_DEFAULT 103
  1362. #define OCR_UPARROW_DEFAULT 104
  1363. #define OCR_SIZENWSE_DEFAULT 105
  1364. #define OCR_SIZENESW_DEFAULT 106
  1365. #define OCR_SIZEWE_DEFAULT 107
  1366. #define OCR_SIZENS_DEFAULT 108
  1367. #define OCR_SIZEALL_DEFAULT 109
  1368. #define OCR_NO_DEFAULT 110
  1369. #define OCR_APPSTARTING_DEFAULT 111
  1370. #define OCR_HELP_DEFAULT 112
  1371. #define OCR_NWPEN_DEFAULT 113
  1372. #define OCR_HAND_DEFAULT 114
  1373. #define OCR_ICON_DEFAULT 115
  1374. #define OCR_AUTORUN_DEFAULT 116
  1375. #define COCR_CONFIGURABLE (OCR_AUTORUN_DEFAULT - OCR_FIRST_DEFAULT + 1)
  1376. /* Default IDs for original User images */
  1377. #define OIC_FIRST_DEFAULT 100
  1378. #define OIC_APPLICATION_DEFAULT 100
  1379. #define OIC_HAND_DEFAULT 101
  1380. #define OIC_WARNING_DEFAULT 101
  1381. #define OIC_QUESTION_DEFAULT 102
  1382. #define OIC_EXCLAMATION_DEFAULT 103
  1383. #define OIC_ERROR_DEFAULT 103
  1384. #define OIC_ASTERISK_DEFAULT 104
  1385. #define OIC_INFORMATION_DEFAULT 104
  1386. #define OIC_WINLOGO_DEFAULT 105
  1387. #define COIC_CONFIGURABLE (OIC_WINLOGO_DEFAULT - OIC_FIRST_DEFAULT + 1)
  1388. #define IDUSERICON 20
  1389. #define ES_FMTMASK 0x0003L
  1390. #define ES_COMBOBOX 0x0200L
  1391. #define EM_SETFONT 0x00C3 /* no longer suported */
  1392. #define EM_SETWORDBREAK 0x00CA /* no longer suported */
  1393. #define EM_MSGMAX 0x00DA
  1394. #define BS_IMAGEMASK 0x000000C0L
  1395. #define BS_HORZMASK 0x00000300L
  1396. #define BS_VERTMASK 0x00000C00L
  1397. #define BS_ALIGNMASK 0x00000F00L
  1398. #define SS_TEXTMAX0 0x00000002L
  1399. #define SS_TEXTMIN1 0x0000000BL
  1400. #define SS_TEXTMAX1 0x0000000DL
  1401. #define ISSSTEXTOROD(bType) (((bType) <= SS_TEXTMAX0) \
  1402. || (((bType) >= SS_TEXTMIN1) && ((bType) <= SS_TEXTMAX1)))
  1403. #define DDL_NOFILES 0x1000
  1404. #define DDL_VALID (DDL_READWRITE | \
  1405. DDL_READONLY | \
  1406. DDL_HIDDEN | \
  1407. DDL_SYSTEM | \
  1408. DDL_DIRECTORY | \
  1409. DDL_ARCHIVE | \
  1410. DDL_POSTMSGS | \
  1411. DDL_DRIVES | \
  1412. DDL_EXCLUSIVE)
  1413. /*
  1414. * Valid dialog style bits for Chicago compatibility.
  1415. */
  1416. //#define DS_VALID_FLAGS (DS_ABSALIGN|DS_SYSMODAL|DS_LOCALEDIT|DS_SETFONT|DS_MODALFRAME|DS_NOIDLEMSG | DS_SETFOREGROUND)
  1417. #define DS_VALID_FLAGS 0x1FFF
  1418. #define SCDLG_CLIENT 0x0001
  1419. #define SCDLG_ANSI 0x0002
  1420. #define SCDLG_NOREVALIDATE 0x0004
  1421. #define SCDLG_16BIT 0x0008 // Created for a 16 bit thread; common dialogs
  1422. #define DS_VALID31 0x01e3L
  1423. #define DS_VALID40 0x7FFFL
  1424. #define DS_RECURSE DS_CONTROL /* BOGUS GOING AWAY */
  1425. #define DS_COMMONDIALOG 0x4000L
  1426. #define DS_NONBOLD DS_3DLOOK /* BOGUS GOING AWAY */
  1427. #define LBCB_CARETON 0x01A3
  1428. #define LBCB_CARETOFF 0x01A4
  1429. #define LB_INSERTSTRINGUPPER 0x01AA
  1430. #define LB_INSERTSTRINGLOWER 0x01AB
  1431. #define LB_ADDSTRINGUPPER 0x01AC
  1432. #define LB_ADDSTRINGLOWER 0x01AD
  1433. #define LBCB_STARTTRACK 0x01AE
  1434. #define LBCB_ENDTRACK 0x01AF
  1435. #define CBEC_SETCOMBOFOCUS (CB_MSGMAX+1)
  1436. #define CBEC_KILLCOMBOFOCUS (CB_MSGMAX+2)
  1437. #define SIF_RETURNOLDPOS 0x1000
  1438. #define SIF_NOSCROLL 0x2000
  1439. #define SIF_MASK 0x701F
  1440. #if(_WIN32_WINNT >= 0x0501)
  1441. typedef BOOL (CALLBACK* GETSCROLLINFOPROC)(IN HWND, IN int, IN OUT LPSCROLLINFO);
  1442. typedef int (CALLBACK* SETSCROLLINFOPROC)(IN HWND, IN int, IN LPCSCROLLINFO, IN BOOL);
  1443. #endif /* _WIN32_WINNT >= 0x0501 */
  1444. #define HELP_HB_NORMAL 0x0000L
  1445. #define HELP_HB_STRING 0x0100L
  1446. #define HELP_HB_STRUCT 0x0200L
  1447. #define GR_MAXOBJECT 1
  1448. #if(_WIN32_WINNT >= 0x0500)
  1449. /*
  1450. * Query win32k statistics -internal
  1451. * QUERYUSER_CS Query critical section usage
  1452. * QUERYUSER_HANDLES Query user per-process user handle count
  1453. */
  1454. #define QUC_PID_TOTAL 0xffffffff
  1455. #define QUERYUSER_HANDLES 0x1
  1456. #if defined (USER_PERFORMANCE)
  1457. #define QUERYUSER_CS 0x2
  1458. /*
  1459. * The counters in CSSTATISTICS refer to the USER critical section:
  1460. * cExclusive counts how many times the CS was aquired exclusive
  1461. * cShared counts how many times the CS was aquired shared
  1462. * i64TimeExclusive counts the time (NtQueryPerformanceCounter() units)
  1463. * spent in the resource since the last query.
  1464. */
  1465. typedef struct _tagCSStatistics {
  1466. DWORD cExclusive;
  1467. DWORD cShared;
  1468. __int64 i64TimeExclusive;
  1469. } CSSTATISTICS;
  1470. #endif // USER_PERFORMANCE
  1471. BOOL
  1472. WINAPI
  1473. QueryUserCounters(
  1474. IN DWORD dwQueryType,
  1475. IN LPVOID pvIn,
  1476. IN DWORD dwInSize,
  1477. OUT LPVOID pvResult,
  1478. IN DWORD dwOutSize
  1479. );
  1480. #endif /* _WIN32_WINNT >= 0x0500 */
  1481. #define SPI_TIMEOUTS 0x0007
  1482. #define SPI_KANJIMENU 0x0008
  1483. #define SPI_UNUSED39 0x0027
  1484. #define SPI_UNUSED40 0x0028
  1485. #define SPI_UNUSED108 0x006C
  1486. #define SPI_UNUSED109 0x006D
  1487. #define SPI_MAX 0x0074
  1488. /*
  1489. * ADDING NEW SPI_* VALUES
  1490. * If the value is a BOOL, it should be added after SPI_STARTBOOLRANGE
  1491. * If the value is a DWORD, it should be added after SPI_STARTDWORDRANGE
  1492. * If the value is a structure or a string, go ahead and setup SPI_START*RANGE....
  1493. */
  1494. /*
  1495. * If adding a new SPI value in the following ranges:
  1496. * -You must define both SPI_GET* and SPI_SET* using consecutive numbers
  1497. * -The low order bit of SPI_GET* must be 0
  1498. * -The low order bit of SPI_SET* must be 1
  1499. * -Properly update SPI_MAX*RANGE
  1500. * -Add the default value to kernel\globals.c in the proper *CPUserPreferences* variable
  1501. * -Add the default value to the proper registry hives.
  1502. * -If your value requires some special validation, do so in kernel\ntstubs.c
  1503. * -If you find something wrong in this documentation, FIX IT!.
  1504. */
  1505. #define SPIF_SET 0x0001
  1506. #define SPIF_BOOL 0x1000
  1507. #define SPIF_DWORD 0x2000
  1508. #define SPIF_RANGETYPEMASK 0x3000
  1509. /*
  1510. * BOOLeans range.
  1511. * For GET, pvParam is a pointer to a BOOL
  1512. * For SET, pvParam is the value
  1513. */
  1514. #define SPI_STARTBOOLRANGE 0x1000
  1515. #define SPI_UNUSED1010 0x1010
  1516. #define SPI_UNUSED1011 0x1011
  1517. /*
  1518. * All SPI_s for UI effects must be < SPI_GETUIEFFECTS
  1519. */
  1520. #define SPI_MAXBOOLRANGE 0x1040
  1521. #define SPI_BOOLRANGECOUNT ((SPI_MAXBOOLRANGE - SPI_STARTBOOLRANGE) / 2)
  1522. #define SPI_BOOLMASKDWORDSIZE (((SPI_BOOLRANGECOUNT - 1) / 32) + 1)
  1523. /*
  1524. * DWORDs range.
  1525. * For GET, pvParam is a pointer to a DWORD
  1526. * For SET, pvParam is the value
  1527. */
  1528. #define SPI_STARTDWORDRANGE 0x2000
  1529. #define FE_FONTSMOOTHINGTYPE_VALID (FE_FONTSMOOTHINGSTANDARD | FE_FONTSMOOTHINGCLEARTYPE | FE_FONTSMOOTHINGDOCKING)
  1530. #define FE_FONTSMOOTHINGORIENTATION_VALID (FE_FONTSMOOTHINGORIENTATIONRGB)
  1531. #define SPI_MAXDWORDRANGE 0x2014
  1532. #define SPI_DWORDRANGECOUNT ((SPI_MAXDWORDRANGE - SPI_STARTDWORDRANGE) / 2)
  1533. #define SPIF_VALID (SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)
  1534. #define ARW_VALID 0x000FL
  1535. #define MAX_SCHEME_NAME_SIZE 128
  1536. #define CDS_RAWMODE 0x00000040
  1537. #define CDS_TRYCLOSEST 0x00000080
  1538. #define CDS_EXCLUSIVE 0x80000000
  1539. #define CDS_VALID 0xD00000FF
  1540. #define EDS_SHOW_DUPLICATES 0x00000001
  1541. #define EDS_SHOW_MONITOR_NOT_CAPABLE 0x00000002
  1542. VOID LoadRemoteFonts(VOID);
  1543. #if(_WIN32_WINNT >= 0x0501)
  1544. typedef BOOL (CALLBACK* SYSTEMPARAMETERSINFO) (
  1545. IN UINT,
  1546. IN UINT,
  1547. IN OUT PVOID,
  1548. IN UINT);
  1549. #endif /* _WIN32_WINNT >= 0x0501 */
  1550. #define FKF_VALID 0x0000007F
  1551. #define SKF_VALID 0x000001FF
  1552. #define SKF_STATEINFO 0xffff0000
  1553. #define MKF_VALID 0x000000FF
  1554. #define MKF_STATEINFO 0xB3000000
  1555. #define ATF_VALID 0x00000003
  1556. #define SSF_VALID 0x00000007
  1557. #define TKF_VALID 0x0000003F
  1558. WINUSERAPI VOID WINAPI RegisterNetworkCapabilities( IN DWORD dwBitsToSet, IN DWORD dwValues);
  1559. #define RNC_NETWORKS 0x00000001
  1560. #define RNC_LOGON 0x00000002
  1561. #if !defined(WINNT) // Win95 version of EndTask
  1562. WINUSERAPI DWORD WINAPI EndTask( IN HWND hwnd, IN DWORD idProcess, IN LPSTR lpszCaption, IN DWORD dwFlags);
  1563. #define ET_ALLOWFORWAIT 0x00000001
  1564. #define ET_TRYTOKILLNICELY 0x00000002
  1565. #define ET_NOUI 0x00000004
  1566. #define ET_NOWAIT 0x00000008
  1567. #define ET_VALID (ET_ALLOWFORWAIT | ET_TRYTOKILLNICELY | ET_NOUI | ET_NOWAIT)
  1568. #endif
  1569. #define LOGON_LOGOFF 0
  1570. #define LOGON_INPUT_TIMEOUT 1
  1571. #define LOGON_RESTARTSHELL 2
  1572. #if (_WIN32_WINNT >= 0x0500)
  1573. #define LOGON_ACCESSNOTIFY 3
  1574. #define LOGON_POWERSTATE 4
  1575. #define LOGON_LOCKWORKSTATION 5
  1576. #define SESSION_RECONNECTED 6
  1577. #define SESSION_DISCONNECTED 7
  1578. #define SESSION_LOGOFF 8
  1579. #define LOGON_PLAYEVENTSOUND 9
  1580. #if(_WIN32_WINNT >= 0x0501)
  1581. #define LOGON_POWEREVENT 10
  1582. #endif /* _WIN32_WINNT >= 0x0501 */
  1583. #define LOGON_LOGOFFCANCELED 11
  1584. #if(_WIN32_WINNT >= 0x0501)
  1585. #define LOGON_SHOW_POWER_MESSAGE 12
  1586. #define LOGON_REMOVE_POWER_MESSAGE 13
  1587. #define SESSION_PRERECONNECT 14
  1588. #define SESSION_DISABLESCRNSAVER 15
  1589. #define SESSION_ENABLESCRNSAVER 16
  1590. #define SESSION_PRERECONNECTDESKTOPSWITCH 17
  1591. #define SESSION_HELPASSISTANTSHADOWSTART 18
  1592. #define SESSION_HELPASSISTANTSHADOWFINISH 19
  1593. #define SESSION_DISCONNECTPIPE 20
  1594. #define LOCK_NORMAL 0
  1595. #define LOCK_RESUMEHIBERNATE 1
  1596. #endif /* _WIN32_WINNT >= 0x0501 */
  1597. /*
  1598. * Notification codes for WM_DESKTOPNOTIFY
  1599. */
  1600. #define DESKTOP_RELOADWALLPAPER 0
  1601. #define ACCESS_STICKYKEYS 0x0001
  1602. #define ACCESS_FILTERKEYS 0x0002
  1603. #define ACCESS_MOUSEKEYS 0x0003
  1604. #define ACCESS_TOGGLEKEYS 0x0004
  1605. #define ACCESS_HIGHCONTRAST 0x0005 // notification dlg
  1606. #define ACCESS_UTILITYMANAGER 0x0006
  1607. #define ACCESS_HIGHCONTRASTON 0x0008
  1608. #define ACCESS_HIGHCONTRASTOFF 0x0009
  1609. #define ACCESS_HIGHCONTRASTCHANGE 0x000A
  1610. #define ACCESS_HIGHCONTRASTONNOREG 0x000C
  1611. #define ACCESS_HIGHCONTRASTOFFNOREG 0x000D
  1612. #define ACCESS_HIGHCONTRASTCHANGENOREG 0x000E
  1613. #define ACCESS_HIGHCONTRASTNOREG 0x0004
  1614. #define USER_SOUND_DEFAULT 0 // default MB sound
  1615. #define USER_SOUND_SYSTEMHAND 1 // MB_ICONHAND shifted
  1616. #define USER_SOUND_SYSTEMQUESTION 2 // MB_ICONQUESTION shifted
  1617. #define USER_SOUND_SYSTEMEXCLAMATION 3 // MB_ICONEXCLAMATION shifted
  1618. #define USER_SOUND_SYSTEMASTERISK 4 // MB_ICONASTERISK shifted
  1619. #define USER_SOUND_MENUPOPUP 5
  1620. #define USER_SOUND_MENUCOMMAND 6
  1621. #define USER_SOUND_OPEN 7
  1622. #define USER_SOUND_CLOSE 8
  1623. #define USER_SOUND_RESTOREUP 9
  1624. #define USER_SOUND_RESTOREDOWN 10
  1625. #define USER_SOUND_MINIMIZE 11
  1626. #define USER_SOUND_MAXIMIZE 12
  1627. #define USER_SOUND_SNAPSHOT 13
  1628. #define USER_SOUND_MAX 14
  1629. #ifdef _NTPOAPI_
  1630. typedef struct tagPOWERSTATEPARAMS {
  1631. POWER_ACTION SystemAction;
  1632. SYSTEM_POWER_STATE MinSystemState;
  1633. ULONG Flags;
  1634. BOOL FullScreenMode;
  1635. } POWERSTATEPARAMS, *PPOWERSTATEPARAMS;
  1636. #endif
  1637. #endif
  1638. #define LOGON_FLG_MASK 0xF0000000
  1639. #define LOGON_FLG_SHIFT 28
  1640. #define STARTF_DESKTOPINHERIT 0x40000000
  1641. #define STARTF_SCREENSAVER 0x80000000
  1642. #define WSS_ERROR 0
  1643. #define WSS_BUSY 1
  1644. #define WSS_IDLE 2
  1645. #define DTF_CENTER 0x00 /* Center the bitmap (default) */
  1646. #define DTF_TILE 0x01 /* Tile the bitmap */
  1647. #define DTF_STRETCH 0x02 /* Stretch bitmap to cover screen. */
  1648. #if 0 /* the following have not been used anywhere in NT since at least 1992 */
  1649. #define DTF_NOPALETTE 0x04 /* Realize palette, otherwise match to default. */
  1650. #define DTF_RETAIN 0x08 /* Retain bitmap, ignore win.ini changes */
  1651. #define DTF_FIT 0x10 /* Fit the bitmap to the screen (scaled). */
  1652. #endif
  1653. #ifdef _INC_DDEMLH
  1654. BOOL DdeIsDataHandleReadOnly(
  1655. IN HDDEDATA hData);
  1656. int DdeGetDataHandleFormat(
  1657. IN HDDEDATA hData);
  1658. DWORD DdeGetCallbackInstance(VOID);
  1659. #endif /* defined _INC_DDEMLH */
  1660. #define LPK_TABBED_TEXT_OUT 0
  1661. #define LPK_PSM_TEXT_OUT 1
  1662. #define LPK_DRAW_TEXT_EX 2
  1663. #define LPK_EDIT_CONTROL 3
  1664. VOID
  1665. WINAPI
  1666. InitializeLpkHooks(
  1667. IN CONST FARPROC *lpfpLpkHooks
  1668. );
  1669. WINUSERAPI
  1670. HWND
  1671. WINAPI
  1672. WOWFindWindow(
  1673. IN LPCSTR lpClassName,
  1674. IN LPCSTR lpWindowName);
  1675. int
  1676. WINAPI
  1677. InternalDoEndTaskDlg(
  1678. IN TCHAR* pszTitle);
  1679. DWORD
  1680. WINAPI
  1681. InternalWaitCancel(
  1682. IN HANDLE handle,
  1683. IN DWORD dwMilliseconds);
  1684. HANDLE
  1685. WINAPI
  1686. InternalCreateCallbackThread(
  1687. IN HANDLE hProcess,
  1688. IN ULONG_PTR lpfn,
  1689. IN ULONG_PTR dwData);
  1690. WINUSERAPI
  1691. UINT
  1692. WINAPI
  1693. GetInternalWindowPos(
  1694. IN HWND hWnd,
  1695. OUT LPRECT lpRect,
  1696. IN LPPOINT lpPoint);
  1697. WINUSERAPI
  1698. BOOL
  1699. WINAPI
  1700. SetInternalWindowPos(
  1701. IN HWND hWnd,
  1702. IN UINT cmdShow,
  1703. IN LPRECT lpRect,
  1704. IN LPPOINT lpPoint);
  1705. WINUSERAPI
  1706. BOOL
  1707. WINAPI
  1708. CalcChildScroll(
  1709. IN HWND hWnd,
  1710. IN UINT sb);
  1711. WINUSERAPI
  1712. BOOL
  1713. WINAPI
  1714. RegisterTasklist(
  1715. IN HWND hWndTasklist);
  1716. WINUSERAPI
  1717. BOOL
  1718. WINAPI
  1719. CascadeChildWindows(
  1720. IN HWND hWndParent,
  1721. IN UINT flags);
  1722. WINUSERAPI
  1723. BOOL
  1724. WINAPI
  1725. TileChildWindows(
  1726. IN HWND hWndParent,
  1727. IN UINT flags);
  1728. /*
  1729. * Services support routines
  1730. */
  1731. WINUSERAPI
  1732. BOOL
  1733. WINAPI
  1734. RegisterServicesProcess(
  1735. IN DWORD dwProcessId);
  1736. /*
  1737. * Logon support routines
  1738. */
  1739. WINUSERAPI
  1740. BOOL
  1741. WINAPI
  1742. RegisterLogonProcess(
  1743. IN DWORD dwProcessId,
  1744. IN BOOL fSecure);
  1745. WINUSERAPI
  1746. UINT
  1747. WINAPI
  1748. LockWindowStation(
  1749. IN HWINSTA hWindowStation);
  1750. WINUSERAPI
  1751. BOOL
  1752. WINAPI
  1753. UnlockWindowStation(
  1754. IN HWINSTA hWindowStation);
  1755. WINUSERAPI
  1756. BOOL
  1757. WINAPI
  1758. SetWindowStationUser(
  1759. IN HWINSTA hWindowStation,
  1760. IN PLUID pLuidUser,
  1761. IN PSID pSidUser,
  1762. IN DWORD cbSidUser);
  1763. WINUSERAPI
  1764. BOOL
  1765. WINAPI
  1766. SetDesktopBitmap(
  1767. IN HDESK hdesk,
  1768. IN HBITMAP hbmWallpaper,
  1769. IN DWORD dwStyle);
  1770. WINUSERAPI
  1771. BOOL
  1772. WINAPI
  1773. SetLogonNotifyWindow(
  1774. IN HWND hWndNotify);
  1775. WINUSERAPI
  1776. UINT
  1777. WINAPI
  1778. GetIconId(
  1779. IN HANDLE hRes,
  1780. IN LPSTR lpszType);
  1781. WINUSERAPI
  1782. int
  1783. WINAPI
  1784. CriticalNullCall(
  1785. VOID);
  1786. WINUSERAPI
  1787. int
  1788. WINAPI
  1789. NullCall(
  1790. VOID);
  1791. WINUSERAPI
  1792. VOID
  1793. WINAPI
  1794. UserNotifyConsoleApplication(
  1795. IN DWORD dwProcessId);
  1796. WINUSERAPI
  1797. BOOL
  1798. WINAPI
  1799. EnterReaderModeHelper(
  1800. HWND hwnd);
  1801. /*
  1802. * Reserved console space.
  1803. *
  1804. * This was moved from the console code so that we can localize it
  1805. * in one place. This was necessary for dealing with the background
  1806. * color, which we need to have for the hungapp drawing. These are
  1807. * stored in the extra-window-bytes of each console.
  1808. */
  1809. #define GWL_CONSOLE_WNDALLOC (3 * sizeof(DWORD))
  1810. #define GWL_CONSOLE_PID 0
  1811. #define GWL_CONSOLE_TID 4
  1812. #define GWL_CONSOLE_BKCOLOR 8
  1813. VOID vFontSweep();
  1814. VOID vLoadLocalT1Fonts();
  1815. VOID vLoadRemoteT1Fonts();
  1816. #ifndef NOMSG
  1817. #define TM_INMENUMODE 0x0001
  1818. #define TM_POSTCHARBREAKS 0x0002
  1819. WINUSERAPI
  1820. BOOL
  1821. WINAPI
  1822. TranslateMessageEx(
  1823. IN CONST MSG *lpMsg,
  1824. IN UINT flags);
  1825. #endif /* !NOMSG */
  1826. /*
  1827. * Those values can be specified as nAnsiChar for MBToWCSEx
  1828. * USER_AWCONV_COUNTSTRING: Count the length of the string including trailing \0
  1829. * USER_AWCONV_COUNTSTRINGSZ: Count the length of the string excluding trailing \0
  1830. *
  1831. * Note: The result includes trailing \0 if USER_AWCONV_COUNTSTRING is specified.
  1832. * USER_AWCONV_COUNTSTRINGSZ will not null-terminate the restult string. It may return
  1833. * 0 if the source strlen() == 0.
  1834. */
  1835. #define USER_AWCONV_COUNTSTRING (-1)
  1836. #define USER_AWCONV_COUNTSTRINGSZ (-2)
  1837. WINUSERAPI
  1838. int
  1839. WINAPI
  1840. WCSToMBEx(
  1841. IN WORD wCodePage,
  1842. IN LPCWSTR pUnicodeString,
  1843. IN int cbUnicodeChar,
  1844. OUT LPSTR *ppAnsiString,
  1845. IN int nAnsiChar,
  1846. IN BOOL bAllocateMem);
  1847. WINUSERAPI
  1848. int
  1849. WINAPI
  1850. MBToWCSEx(
  1851. IN WORD wCodePage,
  1852. IN LPCSTR pAnsiString,
  1853. IN int nAnsiChar,
  1854. OUT LPWSTR *ppUnicodeString,
  1855. IN int cbUnicodeChar,
  1856. IN BOOL bAllocateMem);
  1857. #define UPUSP_USERLOGGEDON 0x00000001
  1858. #define UPUSP_POLICYCHANGE 0x00000002
  1859. #define UPUSP_REMOTESETTINGS 0x00000004
  1860. #define UPUSP_USERLOGGEDON 0x00000001
  1861. #define UPUSP_POLICYCHANGE 0x00000002
  1862. #define UPUSP_REMOTESETTINGS 0x00000004
  1863. WINUSERAPI
  1864. BOOL
  1865. WINAPI
  1866. UpdatePerUserSystemParameters(
  1867. IN HANDLE hToken,
  1868. IN DWORD dwFlags);
  1869. typedef VOID (APIENTRY *PFNW32ET)(VOID);
  1870. WINUSERAPI
  1871. BOOL
  1872. WINAPI
  1873. RegisterUserHungAppHandlers(
  1874. IN PFNW32ET pfnW32EndTask,
  1875. IN HANDLE hEventWowExec);
  1876. WINUSERAPI
  1877. ATOM
  1878. WINAPI
  1879. RegisterClassWOWA(
  1880. IN PVOID lpWndClass,
  1881. IN LPDWORD pdwWOWstuff);
  1882. WINUSERAPI
  1883. LONG
  1884. WINAPI
  1885. GetClassWOWWords(
  1886. IN HINSTANCE hInstance,
  1887. OUT LPCTSTR pString);
  1888. WINUSERAPI
  1889. DWORD
  1890. WINAPI
  1891. CurrentTaskLock(
  1892. IN DWORD hlck);
  1893. WINUSERAPI
  1894. HDESK
  1895. WINAPI
  1896. GetInputDesktop(
  1897. VOID);
  1898. #define WINDOWED 0
  1899. #define FULLSCREEN 1
  1900. #define GDIFULLSCREEN 2
  1901. #define FULLSCREENMIN 4
  1902. #define WCSToMB(pUnicodeString, cbUnicodeChar, ppAnsiString, nAnsiChar,\
  1903. bAllocateMem)\
  1904. WCSToMBEx(0, pUnicodeString, cbUnicodeChar, ppAnsiString, nAnsiChar, bAllocateMem)
  1905. #define MBToWCS(pAnsiString, nAnsiChar, ppUnicodeString, cbUnicodeChar,\
  1906. bAllocateMem)\
  1907. MBToWCSEx(0, pAnsiString, nAnsiChar, ppUnicodeString, cbUnicodeChar, bAllocateMem)
  1908. #define ID(string) (((ULONG_PTR)string & ~0x0000ffff) == 0)
  1909. /*
  1910. * For setting RIT timers and such. GDI uses this for the cursor-restore
  1911. * timer.
  1912. */
  1913. #define TMRF_READY 0x0001
  1914. #define TMRF_SYSTEM 0x0002
  1915. #define TMRF_RIT 0x0004
  1916. #define TMRF_INIT 0x0008
  1917. #define TMRF_ONESHOT 0x0010
  1918. #define TMRF_WAITING 0x0020
  1919. #define TMRF_PTIWINDOW 0x0040
  1920. /*
  1921. * For GDI SetAbortProc support.
  1922. */
  1923. WINUSERAPI
  1924. int
  1925. WINAPI
  1926. CsDrawTextA(
  1927. IN HDC hDC,
  1928. IN LPCSTR lpString,
  1929. IN int nCount,
  1930. IN LPRECT lpRect,
  1931. IN UINT uFormat);
  1932. WINUSERAPI
  1933. int
  1934. WINAPI
  1935. CsDrawTextW(
  1936. IN HDC hDC,
  1937. IN LPCWSTR lpString,
  1938. IN int nCount,
  1939. IN LPRECT lpRect,
  1940. IN UINT uFormat);
  1941. #ifdef UNICODE
  1942. #define CsDrawText CsDrawTextW
  1943. #else
  1944. #define CsDrawText CsDrawTextA
  1945. #endif // !UNICODE
  1946. WINUSERAPI
  1947. LONG
  1948. WINAPI
  1949. CsTabbedTextOutA(
  1950. IN HDC hDC,
  1951. IN int X,
  1952. IN int Y,
  1953. IN LPCSTR lpString,
  1954. IN int nCount,
  1955. IN int nTabPositions,
  1956. IN LPINT lpnTabStopPositions,
  1957. IN int nTabOrigin);
  1958. WINUSERAPI
  1959. LONG
  1960. WINAPI
  1961. CsTabbedTextOutW(
  1962. IN HDC hDC,
  1963. IN int X,
  1964. IN int Y,
  1965. IN LPCWSTR lpString,
  1966. IN int nCount,
  1967. IN int nTabPositions,
  1968. IN LPINT lpnTabStopPositions,
  1969. IN int nTabOrigin);
  1970. #ifdef UNICODE
  1971. #define CsTabbedTextOut CsTabbedTextOutW
  1972. #else
  1973. #define CsTabbedTextOut CsTabbedTextOutA
  1974. #endif // !UNICODE
  1975. WINUSERAPI
  1976. int
  1977. WINAPI
  1978. CsFrameRect(
  1979. IN HDC hDC,
  1980. IN CONST RECT *lprc,
  1981. IN HBRUSH hbr);
  1982. #ifdef UNICODE
  1983. #define CsDrawText CsDrawTextW
  1984. #define CsTabbedTextOut CsTabbedTextOutW
  1985. #else /* !UNICODE */
  1986. #define CsDrawText CsDrawTextA
  1987. #define CsTabbedTextOut CsTabbedTextOutA
  1988. #endif /* !UNICODE */
  1989. /*
  1990. * Custom Cursor action.
  1991. */
  1992. WINUSERAPI
  1993. HCURSOR
  1994. WINAPI
  1995. GetCursorFrameInfo( // Obsolete? - IanJa
  1996. IN HCURSOR hcur,
  1997. OUT LPWSTR id,
  1998. IN int iFrame,
  1999. OUT LPDWORD pjifRate,
  2000. OUT LPINT pccur);
  2001. /*
  2002. * WOW: replace cursor/icon handle
  2003. */
  2004. WINUSERAPI
  2005. BOOL
  2006. WINAPI
  2007. SetCursorContents( IN HCURSOR hCursor, IN HCURSOR hCursorNew);
  2008. #ifdef WX86
  2009. /*
  2010. * Wx86
  2011. * export from wx86.dll to convert an x86 hook proc to risc address.
  2012. */
  2013. typedef
  2014. PVOID
  2015. (*PFNWX86HOOKCALLBACK)(
  2016. SHORT HookType,
  2017. PVOID HookProc
  2018. );
  2019. typedef
  2020. HMODULE
  2021. (*PFNWX86LOADX86DLL)(
  2022. LPCWSTR lpLibFileName,
  2023. DWORD dwFlags
  2024. );
  2025. typedef
  2026. BOOL
  2027. (*PFNWX86FREEX86DLL)(
  2028. HMODULE hMod
  2029. );
  2030. #endif
  2031. typedef struct _TAG {
  2032. DWORD type;
  2033. DWORD style;
  2034. DWORD len;
  2035. } TAG, *PTAG;
  2036. #define MAKETAG(a, b, c, d) (DWORD)(a | (b<<8) | ((DWORD)c<<16) | ((DWORD)d<<24))
  2037. /* Valid TAG types. */
  2038. /* 'ASDF' (CONT) - Advanced Systems Data Format */
  2039. #define TAGT_ASDF MAKETAG('A', 'S', 'D', 'F')
  2040. /* 'RAD ' (CONT) - ?R Animation ?Definition (an aggregate type) */
  2041. #define TAGT_RAD MAKETAG('R', 'A', 'D', ' ')
  2042. /* 'ANIH' (DATA) - ANImation Header */
  2043. /* Contains an ANIHEADER structure. */
  2044. #define TAGT_ANIH MAKETAG('A', 'N', 'I', 'H')
  2045. /*
  2046. * 'RATE' (DATA) - RATE table (array of jiffies)
  2047. * Contains an array of JIFs. Each JIF specifies how long the corresponding
  2048. * animation frame is to be displayed before advancing to the next frame.
  2049. * If the AF_SEQUENCE flag is set then the count of JIFs == anih.cSteps,
  2050. * otherwise the count == anih.cFrames.
  2051. */
  2052. #define TAGT_RATE MAKETAG('R', 'A', 'T', 'E')
  2053. /*
  2054. * 'SEQ ' (DATA) - SEQuence table (array of frame index values)
  2055. * Countains an array of DWORD frame indices. anih.cSteps specifies how
  2056. * many.
  2057. */
  2058. #define TAGT_SEQ MAKETAG('S', 'E', 'Q', ' ')
  2059. /* 'ICON' (DATA) - Windows ICON format image (replaces MPTR) */
  2060. #define TAGT_ICON MAKETAG('I', 'C', 'O', 'N')
  2061. /* 'TITL' (DATA) - TITLe string (can be inside or outside aggregates) */
  2062. /* Contains a single ASCIIZ string that titles the file. */
  2063. #define TAGT_TITL MAKETAG('T', 'I', 'T', 'L')
  2064. /* 'AUTH' (DATA) - AUTHor string (can be inside or outside aggregates) */
  2065. /* Contains a single ASCIIZ string that indicates the author of the file. */
  2066. #define TAGT_AUTH MAKETAG('A', 'U', 'T', 'H')
  2067. #define TAGT_AXOR MAKETAG('A', 'X', 'O', 'R')
  2068. /* Valid TAG styles. */
  2069. /* 'CONT' - CONTainer chunk (contains other DATA and CONT chunks) */
  2070. #define TAGS_CONT MAKETAG('C', 'O', 'N', 'T')
  2071. /* 'DATA' - DATA chunk */
  2072. #define TAGS_DATA MAKETAG('D', 'A', 'T', 'A')
  2073. typedef DWORD JIF, *PJIF;
  2074. typedef struct _ANIHEADER { /* anih */
  2075. DWORD cbSizeof;
  2076. DWORD cFrames;
  2077. DWORD cSteps;
  2078. DWORD cx, cy;
  2079. DWORD cBitCount, cPlanes;
  2080. JIF jifRate;
  2081. DWORD fl;
  2082. } ANIHEADER, *PANIHEADER;
  2083. /* If the AF_ICON flag is specified the fields cx, cy, cBitCount, and */
  2084. /* cPlanes are all unused. Each frame will be of type ICON and will */
  2085. /* contain its own dimensional information. */
  2086. #define AF_ICON 0x0001L /* Windows format icon/cursor animation */
  2087. #define AF_SEQUENCE 0x0002L /* Animation is sequenced */
  2088. #define WINEVENT_32BITCALLER 0x8000 // - unused in NT
  2089. #define WINEVENT_VALID 0x0007 //
  2090. #ifdef REDIRECTION
  2091. #define EVENT_SYSTEM_REDIRECTEDPAINT 0x0018
  2092. #endif // REDIRECTION
  2093. WINUSERAPI
  2094. BOOL
  2095. WINAPI
  2096. IsProcess16Bit(
  2097. VOID);
  2098. // Output from DISPID_ACC_STATE (IanJa: taken from oleacc.h)
  2099. /*
  2100. * CONSTANTS
  2101. */
  2102. /*
  2103. * Object constants (these are NOT public). OBJID are public IDs for
  2104. * standard frame elements. But the indeces for their elements are not.
  2105. */
  2106. // TITLEBAR
  2107. #define INDEX_TITLEBAR_SELF 0
  2108. #define INDEX_TITLEBAR_IMEBUTTON 1
  2109. #define INDEX_TITLEBAR_MINBUTTON 2
  2110. #define INDEX_TITLEBAR_MAXBUTTON 3
  2111. #define INDEX_TITLEBAR_HELPBUTTON 4
  2112. #define INDEX_TITLEBAR_CLOSEBUTTON 5
  2113. #define INDEX_TITLEBAR_MIC 1
  2114. #define INDEX_TITLEBAR_MAC 5
  2115. #define INDEX_TITLEBAR_RESTOREBUTTON 6 // The min/max buttons turn into this
  2116. // SCROLLBAR
  2117. #define INDEX_SCROLLBAR_SELF 0
  2118. #define INDEX_SCROLLBAR_UP 1
  2119. #define INDEX_SCROLLBAR_UPPAGE 2
  2120. #define INDEX_SCROLLBAR_THUMB 3
  2121. #define INDEX_SCROLLBAR_DOWNPAGE 4
  2122. #define INDEX_SCROLLBAR_DOWN 5
  2123. #define INDEX_SCROLLBAR_MIC 1
  2124. #define INDEX_SCROLLBAR_MAC 5
  2125. #define INDEX_SCROLLBAR_LEFT 7
  2126. #define INDEX_SCROLLBAR_LEFTPAGE 8
  2127. #define INDEX_SCROLLBAR_HORZTHUMB 9
  2128. #define INDEX_SCROLLBAR_RIGHTPAGE 10
  2129. #define INDEX_SCROLLBAR_RIGHT 11
  2130. #define INDEX_SCROLLBAR_HORIZONTAL 6
  2131. #define INDEX_SCROLLBAR_GRIP 12
  2132. // COMBOBOXES
  2133. #define INDEX_COMBOBOX 0
  2134. #define INDEX_COMBOBOX_ITEM 1
  2135. #define INDEX_COMBOBOX_BUTTON 2
  2136. #define INDEX_COMBOBOX_LIST 3
  2137. #define CCHILDREN_COMBOBOX 3
  2138. #define CBLISTBOXID 1000
  2139. #define CBEDITID 1001
  2140. #define CBBUTTONID 1002
  2141. // CURSORS
  2142. #define CURSOR_SYSTEM_NOTHING -1
  2143. #define CURSOR_SYSTEM_UNKNOWN 0
  2144. #define CURSOR_SYSTEM_ARROW 1
  2145. #define CURSOR_SYSTEM_IBEAM 2
  2146. #define CURSOR_SYSTEM_WAIT 3
  2147. #define CURSOR_SYSTEM_CROSS 4
  2148. #define CURSOR_SYSTEM_UPARROW 5
  2149. #define CURSOR_SYSTEM_SIZENWSE 6
  2150. #define CURSOR_SYSTEM_SIZENESW 7
  2151. #define CURSOR_SYSTEM_SIZEWE 8
  2152. #define CURSOR_SYSTEM_SIZENS 9
  2153. #define CURSOR_SYSTEM_SIZEALL 10
  2154. #define CURSOR_SYSTEM_NO 11
  2155. #define CURSOR_SYSTEM_APPSTARTING 12
  2156. #define CURSOR_SYSTEM_HELP 13
  2157. #define CURSOR_SYSTEM_NWPEN 14
  2158. #define CURSOR_SYSTEM_HAND 15
  2159. #define CCURSOR_SYSTEM 15
  2160. #define GA_MIN 1
  2161. #define GA_MAX 3
  2162. #if(_WIN32_WINNT >= 0x0500)
  2163. /*
  2164. * The max number of tags to fail that can be
  2165. * specified to Win32PoolAllocationStats. If tagsCount is more than
  2166. * this value then all the pool allocations will fail.
  2167. */
  2168. #define MAX_TAGS_TO_FAIL 256
  2169. BOOL
  2170. WINAPI
  2171. Win32PoolAllocationStats(
  2172. IN LPDWORD parrTags,
  2173. IN SIZE_T tagCount,
  2174. OUT SIZE_T* lpdwMaxMem,
  2175. OUT SIZE_T* lpdwCrtMem,
  2176. OUT LPDWORD lpdwMaxAlloc,
  2177. OUT LPDWORD lpdwCrtAlloc);
  2178. #define WHF_DESKTOP 0x00000001
  2179. #define WHF_SHAREDHEAP 0x00000002
  2180. #define WHF_CSRSS 0x00000004
  2181. #define WHF_ALL (WHF_DESKTOP | WHF_SHAREDHEAP | WHF_CSRSS)
  2182. #define WHF_VALID WHF_ALL
  2183. VOID
  2184. WINAPI
  2185. DbgWin32HeapFail(
  2186. DWORD dwFlags,
  2187. BOOL bFail
  2188. );
  2189. typedef struct tagDBGHEAPSTAT {
  2190. DWORD dwTag;
  2191. DWORD dwSize;
  2192. DWORD dwCount;
  2193. } DBGHEAPSTAT, *PDBGHEAPSTAT;
  2194. DWORD
  2195. WINAPI
  2196. DbgWin32HeapStat(
  2197. PDBGHEAPSTAT phs,
  2198. DWORD dwLen,
  2199. DWORD dwFlags
  2200. );
  2201. #define WPROTOCOLNAME_LENGTH 10
  2202. #define WAUDIONAME_LENGTH 10
  2203. typedef struct tagWSINFO {
  2204. WCHAR ProtocolName[WPROTOCOLNAME_LENGTH];
  2205. WCHAR AudioDriverName[WAUDIONAME_LENGTH];
  2206. } WSINFO, *PWSINFO;
  2207. BOOL
  2208. GetWinStationInfo(
  2209. WSINFO* pWsInfo);
  2210. #endif /* _WIN32_WINNT >= 0x0500 */
  2211. /*
  2212. * The handle to this structure is passed in the lParam
  2213. * of WM_INPUT message.
  2214. * The application can call GetRawInputData API to
  2215. * get the detailed information, including the header
  2216. * and all the content of the Raw Input.
  2217. *
  2218. * For the bulk read the RawInput in the message loop,
  2219. * the application may call GetRawInputBuffer API.
  2220. *
  2221. * For the device specific information,
  2222. * the application may call GetRawInputDeviceInfo API.
  2223. *
  2224. * Raw Input is available only when the application
  2225. * calls SetRawInputDevices with valid device
  2226. * specifications.
  2227. */
  2228. #define RID_GETTYPE_INPUT 0x10000000
  2229. #define RID_GETTYPE_DEVICE 0x20000000
  2230. #define RID_GETTYPE_MASK 0xf0000000
  2231. #define RIDEV_ADD_OR_MODIFY 0x00000000
  2232. #define RIDEV_MODEMASK 0x00000001
  2233. #define RIDEV_INCLUDE 0x00000000
  2234. #define RIDEV_VALID 0x00000731
  2235. /*
  2236. * vkey table counts, macros, etc. input synchonized key state tables have
  2237. * 2 bits per vkey: fDown, fToggled. Async key state tables have 3 bits:
  2238. * fDown, fToggled, fDownSinceLastRead.
  2239. *
  2240. * Important! The array gafAsyncKeyState matches the bit positions of the
  2241. * afKeyState array in each thread info block. The fDownSinceLastRead bit
  2242. * for the async state is stored in a separate bit array, called
  2243. * gafAsyncKeyStateRecentDown.
  2244. *
  2245. * It is important that the bit positions of gafAsyncKeyState and
  2246. * pti->afKeyState match because we copy from one to the other to maintain
  2247. * key state synchronization between threads.
  2248. *
  2249. * These macros below MUST be used when setting / querying key state.
  2250. */
  2251. #define CVKKEYSTATE 256
  2252. #define CBKEYSTATE (CVKKEYSTATE >> 2)
  2253. #define CBKEYSTATERECENTDOWN (CVKKEYSTATE >> 3)
  2254. #define KEYSTATE_TOGGLE_BYTEMASK 0xAA // 10101010
  2255. #define KEYSTATE_DOWN_BYTEMASK 0x55 // 01010101
  2256. /*
  2257. * Two bits per VK (down & toggle) so we can pack 4 VK keystates into 1 byte:
  2258. *
  2259. * Byte 0 Byte 1
  2260. * .---.---.---.---.---.---.---.---. .---.---.---.---.---.---.---.---. .-- -
  2261. * | T | D | T | D | T | D | T | D | | T | D | T | D | T | D | T | D | |
  2262. * `---'---'---'---'---'---'---'---' `---'---'---'---'---'---'---'---' `-- -
  2263. * : VK 3 : VK 2 : VK 1 : VK 0 : : VK 7 : VK 6 : VK 5 : VK 4 : :
  2264. *
  2265. * KEY_BYTE(pb, vk) identifies the byte containing the VK's state
  2266. * KEY_DOWN_BIT(vk) identifies the VK's down bit within a byte
  2267. * KEY_TOGGLE_BIT(vk) identifies the VK's toggle bit within a byte
  2268. */
  2269. #define KEY_BYTE(pb, vk) pb[((BYTE)(vk)) >> 2]
  2270. #define KEY_DOWN_BIT(vk) (1 << ((((BYTE)(vk)) & 3) << 1))
  2271. #define KEY_TOGGLE_BIT(vk) (1 << (((((BYTE)(vk)) & 3) << 1) + 1))
  2272. #define TestKeyDownBit(pb, vk) (KEY_BYTE(pb,vk) & KEY_DOWN_BIT(vk))
  2273. #define SetKeyDownBit(pb, vk) (KEY_BYTE(pb,vk) |= KEY_DOWN_BIT(vk))
  2274. #define ClearKeyDownBit(pb, vk) (KEY_BYTE(pb,vk) &= ~KEY_DOWN_BIT(vk))
  2275. #define TestKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) & KEY_TOGGLE_BIT(vk))
  2276. #define SetKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) |= KEY_TOGGLE_BIT(vk))
  2277. #define ClearKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) &= ~KEY_TOGGLE_BIT(vk))
  2278. #define ToggleKeyToggleBit(pb, vk) (KEY_BYTE(pb,vk) ^= KEY_TOGGLE_BIT(vk))
  2279. /*
  2280. * Similar to the above, but here we need only one bit per VK (down)
  2281. * so we can pack 8 VK down states into 1 byte.
  2282. */
  2283. #define RKEY_BYTE(pb, vk) pb[((BYTE)(vk)) >> 3]
  2284. #define RKEY_BIT(vk) (1 << ((BYTE)(vk) & 7))
  2285. #define TestKeyRecentDownBit(pb, vk) (RKEY_BYTE(pb,vk) & RKEY_BIT(vk))
  2286. #define SetKeyRecentDownBit(pb, vk) (RKEY_BYTE(pb,vk) |= RKEY_BIT(vk))
  2287. #define ClearKeyRecentDownBit(pb, vk) (RKEY_BYTE(pb,vk) &= ~RKEY_BIT(vk))
  2288. #define TestKeyStateDown(pq, vk)\
  2289. TestKeyDownBit(pq->afKeyState, vk)
  2290. #define SetKeyStateDown(pq, vk)\
  2291. SetKeyDownBit(pq->afKeyState, vk)
  2292. #define ClearKeyStateDown(pq, vk)\
  2293. ClearKeyDownBit(pq->afKeyState, vk)
  2294. #define TestKeyStateToggle(pq, vk)\
  2295. TestKeyToggleBit(pq->afKeyState, vk)
  2296. #define SetKeyStateToggle(pq, vk)\
  2297. SetKeyToggleBit(pq->afKeyState, vk)
  2298. #define ClearKeyStateToggle(pq, vk)\
  2299. ClearKeyToggleBit(pq->afKeyState, vk)
  2300. #define TestAsyncKeyStateDown(vk)\
  2301. TestKeyDownBit(gafAsyncKeyState, vk)
  2302. #define SetAsyncKeyStateDown(vk)\
  2303. SetKeyDownBit(gafAsyncKeyState, vk)
  2304. #define ClearAsyncKeyStateDown(vk)\
  2305. ClearKeyDownBit(gafAsyncKeyState, vk)
  2306. #define TestAsyncKeyStateToggle(vk)\
  2307. TestKeyToggleBit(gafAsyncKeyState, vk)
  2308. #define SetAsyncKeyStateToggle(vk)\
  2309. SetKeyToggleBit(gafAsyncKeyState, vk)
  2310. #define ClearAsyncKeyStateToggle(vk)\
  2311. ClearKeyToggleBit(gafAsyncKeyState, vk)
  2312. #define TestAsyncKeyStateRecentDown(vk)\
  2313. TestKeyRecentDownBit(gafAsyncKeyStateRecentDown, vk)
  2314. #define SetAsyncKeyStateRecentDown(vk)\
  2315. SetKeyRecentDownBit(gafAsyncKeyStateRecentDown, vk)
  2316. #define ClearAsyncKeyStateRecentDown(vk)\
  2317. ClearKeyRecentDownBit(gafAsyncKeyStateRecentDown, vk)
  2318. #if(_WIN32_WINNT >= 0x0501)
  2319. #ifndef NOUSER
  2320. #ifndef NOSCROLL
  2321. #ifndef NOSYSMETRICS
  2322. #ifndef NOSYSPARAMSINFO
  2323. typedef BOOL (CALLBACK* OVERRIDEWNDPROC)(HWND, UINT, WPARAM, LPARAM, LRESULT*, void**);
  2324. typedef BOOL (CALLBACK* FORCERESETUSERAPIHOOK)(HMODULE hmod);
  2325. typedef VOID (CALLBACK* MDIREDRAWFRAMEPROC)(HWND hwndChild, BOOL fAdd);
  2326. /*
  2327. * Flags passed to UAH DLL's indicating current status of UAH.
  2328. *
  2329. * UIAH_INITIALIZE : UAH are being initialized for current process and DLL has just been loaded.
  2330. * UIAH_UNINITIALIZE : UAH are being uninitialized for current process and DLL is about to be unloaded.
  2331. * UIAH_UNHOOK : UAH have been unregistered system-wide but DLL can't be unloaded due to outstanding
  2332. * API calls into it. Table of function pointers (guah) has been reset to native
  2333. * user32 functions to prevent further calls.
  2334. */
  2335. #define UIAH_INITIALIZE 0
  2336. #define UIAH_UNINITIALIZE 1
  2337. #define UIAH_UNHOOK 2
  2338. typedef struct tagMSGMASK {
  2339. BYTE * rgb;
  2340. DWORD cb;
  2341. } MSGMASK, *PMSGMASK;
  2342. typedef struct tagUSEROWPINFO {
  2343. OVERRIDEWNDPROC pfnBeforeOWP;
  2344. OVERRIDEWNDPROC pfnAfterOWP;
  2345. MSGMASK mm;
  2346. } USEROWPINFO, *PUSEROWPINFO;
  2347. typedef struct tagUSERAPIHOOK {
  2348. DWORD cbSize;
  2349. WNDPROC pfnDefWindowProcA;
  2350. WNDPROC pfnDefWindowProcW;
  2351. MSGMASK mmDWP;
  2352. GETSCROLLINFOPROC pfnGetScrollInfo;
  2353. SETSCROLLINFOPROC pfnSetScrollInfo;
  2354. ENABLESCROLLBARPROC pfnEnableScrollBar;
  2355. ADJUSTWINDOWRECTEXPROC pfnAdjustWindowRectEx;
  2356. SETWINDOWRGNPROC pfnSetWindowRgn;
  2357. USEROWPINFO uoiWnd;
  2358. USEROWPINFO uoiDlg;
  2359. GETSYSTEMMETRICSPROC pfnGetSystemMetrics;
  2360. SYSTEMPARAMETERSINFO pfnSystemParametersInfoA;
  2361. SYSTEMPARAMETERSINFO pfnSystemParametersInfoW;
  2362. FORCERESETUSERAPIHOOK pfnForceResetUserApiHook;
  2363. DRAWFRAMECONTROLPROC pfnDrawFrameControl;
  2364. DRAWCAPTIONPROC pfnDrawCaption;
  2365. MDIREDRAWFRAMEPROC pfnMDIRedrawFrame;
  2366. } USERAPIHOOK, *PUSERAPIHOOK;
  2367. typedef BOOL (CALLBACK* INITUSERAPIHOOK)(DWORD dwCmd, void* pvParam);
  2368. WINUSERAPI
  2369. BOOL
  2370. WINAPI
  2371. RegisterUserApiHook(
  2372. IN HINSTANCE hmod,
  2373. IN INITUSERAPIHOOK pfnUserApiHook);
  2374. WINUSERAPI
  2375. BOOL
  2376. WINAPI
  2377. UnregisterUserApiHook(VOID);
  2378. #endif /*!NOSYSPARAMSINFO*/
  2379. #endif /*!NOSYSMETRICS*/
  2380. #endif /* NOSCROLL */
  2381. /*
  2382. * Message Hook
  2383. */
  2384. #ifndef NOMSG
  2385. typedef struct tagMESSAGEPUMPHOOK {
  2386. DWORD cbSize;
  2387. INTERNALGETMESSAGEPROC
  2388. pfnInternalGetMessage;
  2389. WAITMESSAGEEXPROC pfnWaitMessageEx;
  2390. GETQUEUESTATUSPROC pfnGetQueueStatus;
  2391. MSGWAITFORMULTIPLEOBJECTSEXPROC
  2392. pfnMsgWaitForMultipleObjectsEx;
  2393. } MESSAGEPUMPHOOK;
  2394. typedef BOOL (CALLBACK* INITMESSAGEPUMPHOOK)(DWORD dwCmd, void* pvParam);
  2395. WINUSERAPI
  2396. BOOL
  2397. WINAPI
  2398. RegisterMessagePumpHook(
  2399. IN INITMESSAGEPUMPHOOK pfnInitMPH);
  2400. WINUSERAPI
  2401. BOOL
  2402. WINAPI
  2403. UnregisterMessagePumpHook();
  2404. #endif /* NOMSG */
  2405. #endif /* NOUSER */
  2406. #endif /* _WIN32_WINNT >= 0x0501 */
  2407. #ifdef REDIRECTION
  2408. WINUSERAPI
  2409. BOOL
  2410. WINAPI
  2411. SetProcessRedirectionMode(
  2412. IN HANDLE hProcess,
  2413. IN BOOL bRedirectionMode);
  2414. WINUSERAPI
  2415. BOOL
  2416. WINAPI
  2417. GetProcessRedirectionMode(
  2418. IN HANDLE hProcess,
  2419. OUT PBOOL pbRedirectionMode);
  2420. WINUSERAPI
  2421. BOOL
  2422. WINAPI
  2423. SetDesktopRedirectionMode(
  2424. IN HANDLE hProcess,
  2425. IN BOOL bRedirectionMode);
  2426. WINUSERAPI
  2427. BOOL
  2428. WINAPI
  2429. GetDesktopRedirectionMode(
  2430. IN HANDLE hProcess,
  2431. OUT PBOOL pbRedirectionMode);
  2432. #endif // REDIRECTION
  2433. /*
  2434. * We set this bit in GetDeviceChangeInfo to signify that the drive letter
  2435. * represents a new drive.
  2436. */
  2437. #define HMCE_ARRIVAL 0x80000000
  2438. /*
  2439. * Shutdown reason code
  2440. */
  2441. #include <reason.h>
  2442. typedef struct _REASON_INITIALISER {
  2443. DWORD dwCode;
  2444. DWORD dwNameId;
  2445. DWORD dwDescId;
  2446. } REASON_INITIALISER;
  2447. typedef struct _REASON
  2448. {
  2449. DWORD dwCode;
  2450. WCHAR szName[MAX_REASON_NAME_LEN];
  2451. WCHAR szDesc[MAX_REASON_DESC_LEN];
  2452. } REASON, *PREASON;
  2453. typedef struct _REASONDATA
  2454. {
  2455. REASON** rgReasons;
  2456. int cReasons;
  2457. int cReasonCapacity;
  2458. DWORD dwReasonSelect;
  2459. WCHAR szComment[MAX_REASON_COMMENT_LEN];
  2460. WCHAR szBugID[MAX_REASON_BUGID_LEN];
  2461. int cCommentLen;
  2462. int cBugIDLen;
  2463. } REASONDATA, *PREASONDATA;
  2464. BOOL ReasonCodeNeedsComment(DWORD dwCode);
  2465. BOOL ReasonCodeNeedsBugID(DWORD dwCode);
  2466. BOOL BuildReasonArray(REASONDATA *pdata, BOOL forCleanUI, BOOL forDirtyUI);
  2467. VOID DestroyReasons(REASONDATA *pdata);
  2468. BOOL GetReasonTitleFromReasonCode(DWORD code, WCHAR *title, DWORD dwTitleLen);
  2469. BOOL IsSETEnabled();
  2470. // Reason Titles
  2471. #define IDS_REASON_UNPLANNED_HARDWARE_MAINTENANCE_TITLE 8250
  2472. #define IDS_REASON_PLANNED_HARDWARE_MAINTENANCE_TITLE 8251
  2473. #define IDS_REASON_UNPLANNED_HARDWARE_INSTALLATION_TITLE 8252
  2474. #define IDS_REASON_PLANNED_HARDWARE_INSTALLATION_TITLE 8253
  2475. //#define IDS_REASON_UNPLANNED_OPERATINGSYSTEM_UPGRADE_TITLE 8254
  2476. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_UPGRADE_TITLE 8255
  2477. #define IDS_REASON_UNPLANNED_OPERATINGSYSTEM_RECONFIG_TITLE 8256
  2478. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_RECONFIG_TITLE 8257
  2479. #define IDS_REASON_APPLICATION_HUNG_TITLE 8258
  2480. #define IDS_REASON_APPLICATION_UNSTABLE_TITLE 8259
  2481. #define IDS_REASON_APPLICATION_MAINTENANCE_TITLE 8260
  2482. #define IDS_REASON_UNPLANNED_OTHER_TITLE 8261
  2483. #define IDS_REASON_PLANNED_OTHER_TITLE 8262
  2484. #define IDS_REASON_SYSTEMFAILURE_BLUESCREEN_TITLE 8263
  2485. #define IDS_REASON_POWERFAILURE_CORDUNPLUGGED_TITLE 8264
  2486. #define IDS_REASON_POWERFAILURE_ENVIRONMENT_TITLE 8265
  2487. #define IDS_REASON_OTHERFAILURE_HUNG_TITLE 8266
  2488. #define IDS_REASON_OTHERFAILURE_TITLE 8267
  2489. #define IDS_REASON_APPLICATION_PM_TITLE 8268
  2490. // Default reason title returned by GetReasonTitleFromReasonCode
  2491. #define IDS_REASON_DEFAULT_TITLE 8269
  2492. #define IDS_REASON_LEGACY_API_TITLE 8270
  2493. // Reason Descriptions
  2494. #define IDS_REASON_HARDWARE_MAINTENANCE_DESCRIPTION 8275
  2495. #define IDS_REASON_HARDWARE_INSTALLATION_DESCRIPTION 8276
  2496. #define IDS_REASON_OPERATINGSYSTEM_UPGRADE_DESCRIPTION 8277
  2497. #define IDS_REASON_OPERATINGSYSTEM_RECONFIG_DESCRIPTION 8278
  2498. #define IDS_REASON_APPLICATION_HUNG_DESCRIPTION 8279
  2499. #define IDS_REASON_APPLICATION_UNSTABLE_DESCRIPTION 8280
  2500. #define IDS_REASON_APPLICATION_MAINTENANCE_DESCRIPTION 8281
  2501. #define IDS_REASON_OTHER_DESCRIPTION 8282
  2502. #define IDS_REASON_SYSTEMFAILURE_BLUESCREEN_DESCRIPTION 8283
  2503. #define IDS_REASON_POWERFAILURE_CORDUNPLUGGED_DESCRIPTION 8284
  2504. #define IDS_REASON_POWERFAILURE_ENVIRONMENT_DESCRIPTION 8285
  2505. #define IDS_REASON_OTHERFAILURE_HUNG_DESCRIPTION 8286
  2506. #define IDS_REASON_APPLICATION_PM_DESCRIPTION 8287
  2507. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_SERVICEPACK_TITLE 8288
  2508. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_HOTFIX_TITLE 8289
  2509. #define IDS_REASON_UNPLANNED_OPERATINGSYSTEM_HOTFIX_TITLE 8290
  2510. #define IDS_REASON_PLANNED_OPERATINGSYSTEM_SECURITYFIX_TITLE 8291
  2511. #define IDS_REASON_UNPLANNED_OPERATINGSYSTEM_SECURITYFIX_TITLE 8292
  2512. #define IDS_REASON_PLANNED_APPLICATION_INSTALLATION_TITLE 8293
  2513. #define IDS_REASON_SECURITY_ISSUE_TITLE 8300
  2514. #define IDS_REASON_LOSS_OF_NETWORK_TITLE 8301
  2515. #define IDS_REASON_OPERATINGSYSTEM_SERVICEPACK_DESCRIPTION 8294
  2516. #define IDS_REASON_OPERATINGSYSTEM_HOTFIX_DESCRIPTION 8295
  2517. #define IDS_REASON_OPERATINGSYSTEM_SECURITYFIX_DESCRIPTION 8296
  2518. #define IDS_REASON_APPLICATION_INSTALLATION_DESCRIPTION 8297
  2519. #define IDS_REASON_LEGACY_API_DESCRIPTION 8298
  2520. #define IDS_REASON_SECURITY_ISSUE_DESCRIPTION 8310
  2521. #define IDS_REASON_LOSS_OF_NETWORK_DESCRIPTION 8311
  2522. #define WC_HARDERRORHANDLER "HardErrorHandler"
  2523. #define COPYDATA_HARDERROR "HardError"
  2524. typedef struct _tagHardErrorData
  2525. {
  2526. DWORD dwSize; // Size of this structure
  2527. DWORD dwError; // Hard Error
  2528. DWORD dwFlags; // Hard Error flags
  2529. UINT uOffsetTitleW; // Offset to UNICODE Title
  2530. UINT uOffsetTextW; // Offset to UNICODE Text
  2531. } HARDERRORDATA, *PHARDERRORDATA;
  2532. #ifdef __cplusplus
  2533. }
  2534. #endif /* __cplusplus */
  2535. #endif /* !_WINUSERP_ */