Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
11 KiB

  1. //-------------------------------------------------------------------------//
  2. //
  3. // scrollp.h
  4. //
  5. // Definitions and decls used exclusively by the win32K->uxtheme scrollbar
  6. // port for non-client theming. Many of the same definitions are duplicated in
  7. // usrctl32.h for base control ports to comctl [scotthan]
  8. //
  9. //-------------------------------------------------------------------------//
  10. #ifndef __SCROLLPORT_H__
  11. #define __SCROLLPORT_H__
  12. #define SIF_RETURNOLDPOS 0x1000
  13. #define SB_DISABLE_MASK ESB_DISABLE_BOTH
  14. #define abs(x) (((x)<0) ? -1 * x : x)
  15. #define TEST_FLAG(dw,f) ((BOOL)((dw) & (f)))
  16. #define SYSMET(i) NcGetSystemMetrics( SM_##i )
  17. #define SYSMETRTL(i) NcGetSystemMetrics( SM_##i )
  18. #define SYSRGB(i) GetSysColor(COLOR_##i)
  19. #define SYSRGBRTL(i) GetSysColor(COLOR_##i)
  20. #define SYSHBR(i) GetSysColorBrush(COLOR_##i)
  21. #define UserAssert(x)
  22. #define SelectBrush (HBRUSH)SelectObject
  23. #define GetWindowStyle(hwnd) GetWindowLong(hwnd,GWL_STYLE)
  24. #define GetWindowExStyle(hwnd) GetWindowLong(hwnd,GWL_EXSTYLE)
  25. // lparam->point crackers from user.h
  26. #ifndef GET_X_LPARAM
  27. #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
  28. #endif
  29. #ifndef GET_Y_LPARAM
  30. #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
  31. // from comctl32 v6
  32. #define MSAA_CLASSNAMEIDX_SCROLLBAR (65536L + 10)
  33. #endif
  34. //-------------------------------------------------------------------------//
  35. // private DrawFrameControl values (winuserp.h)
  36. //#define DFC_CACHE 0xFFFF
  37. //#define DFCS_INMENU 0x0040
  38. //#define DFCS_INSMALL 0x0080
  39. #define DFCS_SCROLLMIN 0x0000
  40. #define DFCS_SCROLLVERT 0x0000
  41. #define DFCS_SCROLLMAX 0x0001
  42. #define DFCS_SCROLLHORZ 0x0002
  43. //#define DFCS_SCROLLLINE 0x0004
  44. //-------------------------------------------------------------------------//
  45. // internal window state/style bits
  46. #define WFMPRESENT 0x0001
  47. #ifndef _UXTHEME_
  48. #define WFVPRESENT 0x0002
  49. #define WFHPRESENT 0x0004
  50. #else _UXTHEME_
  51. #define WFVPRESENT WFVSCROLL /*0x0002*/
  52. #define WFHPRESENT WFHSCROLL /*0x0004*/
  53. #endif _UXTHEME_
  54. #define WFCPRESENT 0x0008
  55. #define WFFRAMEPRESENTMASK 0x000F
  56. #define WFSENDSIZEMOVE 0x0010
  57. #define WFMSGBOX 0x0020 // used to maintain count of msg boxes on screen
  58. #define WFFRAMEON 0x0040
  59. #define WFHASSPB 0x0080
  60. #define WFNONCPAINT 0x0101
  61. #define WFSENDERASEBKGND 0x0102
  62. #define WFERASEBKGND 0x0104
  63. #define WFSENDNCPAINT 0x0108
  64. #define WFINTERNALPAINT 0x0110
  65. #define WFUPDATEDIRTY 0x0120
  66. #define WFHIDDENPOPUP 0x0140
  67. #define WFMENUDRAW 0x0180
  68. /*
  69. * NOTE -- WFDIALOGWINDOW is used in WOW. DO NOT CHANGE without
  70. * changing WD_DIALOG_WINDOW in winuser.w
  71. */
  72. #define WFDIALOGWINDOW 0x0201
  73. #define WFTITLESET 0x0202
  74. #define WFSERVERSIDEPROC 0x0204
  75. #define WFANSIPROC 0x0208
  76. #define WFBEINGACTIVATED 0x0210 // prevent recursion in xxxActivateThis Window
  77. #define WFHASPALETTE 0x0220
  78. #define WFPAINTNOTPROCESSED 0x0240 // WM_PAINT message not processed
  79. #define WFSYNCPAINTPENDING 0x0280
  80. #define WFGOTQUERYSUSPENDMSG 0x0301
  81. #define WFGOTSUSPENDMSG 0x0302
  82. #define WFTOGGLETOPMOST 0x0304 // Toggle the WS_EX_TOPMOST bit ChangeStates
  83. /*
  84. * DON'T MOVE REDRAWIFHUNGFLAGS WITHOUT ADJUSTING WFANYHUNGREDRAW
  85. */
  86. #define WFREDRAWIFHUNG 0x0308
  87. #define WFREDRAWFRAMEIFHUNG 0x0310
  88. #define WFANYHUNGREDRAW 0x0318
  89. #define WFANSICREATOR 0x0320
  90. #define WFREALLYMAXIMIZABLE 0x0340 // The window fills the work area or monitor when maximized
  91. #define WFDESTROYED 0x0380
  92. #define WFWMPAINTSENT 0x0401
  93. #define WFDONTVALIDATE 0x0402
  94. #define WFSTARTPAINT 0x0404
  95. #define WFOLDUI 0x0408
  96. #define WFCEPRESENT 0x0410 // Client edge present
  97. #define WFBOTTOMMOST 0x0420 // Bottommost window
  98. #define WFFULLSCREEN 0x0440
  99. #define WFINDESTROY 0x0480
  100. /*
  101. * DON'T MOVE ANY ONE OF THE FOLLOWING WFWINXXCOMPAT FLAGS,
  102. * BECAUSE WFWINCOMPATMASK DEPENDS ON THEIR VALUES
  103. */
  104. #define WFWIN31COMPAT 0x0501 // Win 3.1 compatible window
  105. #define WFWIN40COMPAT 0x0502 // Win 4.0 compatible window
  106. #define WFWIN50COMPAT 0x0504 // Win 5.0 compatibile window
  107. #define WFWINCOMPATMASK 0x0507 // Compatibility flag mask
  108. #define WFMAXFAKEREGIONAL 0x0508 // Window has a fake region for maxing on 1 monitor
  109. // Active Accessibility (Window Event) state
  110. #define WFCLOSEBUTTONDOWN 0x0510
  111. #define WFZOOMBUTTONDOWN 0x0520
  112. #define WFREDUCEBUTTONDOWN 0x0540
  113. #define WFHELPBUTTONDOWN 0x0580
  114. #define WFLINEUPBUTTONDOWN 0x0601 // Line up/left scroll button down
  115. #define WFPAGEUPBUTTONDOWN 0x0602 // Page up/left scroll area down
  116. #define WFPAGEDNBUTTONDOWN 0x0604 // Page down/right scroll area down
  117. #define WFLINEDNBUTTONDOWN 0x0608 // Line down/right scroll area down
  118. #define WFSCROLLBUTTONDOWN 0x0610 // Any scroll button down?
  119. #define WFVERTSCROLLTRACK 0x0620 // Vertical or horizontal scroll track...
  120. #define WFALWAYSSENDNCPAINT 0x0640 // Always send WM_NCPAINT to children
  121. #define WFPIXIEHACK 0x0680 // Send (HRGN)1 to WM_NCPAINT (see PixieHack)
  122. /*
  123. * WFFULLSCREENBASE MUST HAVE LOWORD OF 0. See SetFullScreen macro.
  124. */
  125. #define WFFULLSCREENBASE 0x0700 // Fullscreen flags take up 0x0701
  126. #define WFFULLSCREENMASK 0x0707 // and 0x0702 and 0x0704
  127. #define WEFTRUNCATEDCAPTION 0x0708 // The caption text was truncated -> caption tootip
  128. #define WFNOANIMATE 0x0710 // ???
  129. #define WFSMQUERYDRAGICON 0x0720 // ??? Small icon comes from WM_QUERYDRAGICON
  130. #define WFSHELLHOOKWND 0x0740 // ???
  131. #define WFISINITIALIZED 0x0780 // Window is initialized -- checked by WoW32
  132. /*
  133. * Add more state flags here, up to 0x0780.
  134. * Look for empty slots above before adding to the end.
  135. * Be sure to add the flag to the wFlags array in kd\userexts.c
  136. */
  137. /*
  138. * Window Extended Style, from 0x0800 to 0x0B80.
  139. */
  140. #define WEFDLGMODALFRAME 0x0801 // WS_EX_DLGMODALFRAME
  141. #define WEFDRAGOBJECT 0x0802 // ???
  142. #define WEFNOPARENTNOTIFY 0x0804 // WS_EX_NOPARENTNOTIFY
  143. #define WEFTOPMOST 0x0808 // WS_EX_TOPMOST
  144. #define WEFACCEPTFILES 0x0810 // WS_EX_ACCEPTFILES
  145. #define WEFTRANSPARENT 0x0820 // WS_EX_TRANSPARENT
  146. #define WEFMDICHILD 0x0840 // WS_EX_MDICHILD
  147. #define WEFTOOLWINDOW 0x0880 // WS_EX_TOOLWINDOW
  148. #define WEFWINDOWEDGE 0x0901 // WS_EX_WINDOWEDGE
  149. #define WEFCLIENTEDGE 0x0902 // WS_EX_CLIENTEDGE
  150. #define WEFEDGEMASK 0x0903 // WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE
  151. #define WEFCONTEXTHELP 0x0904 // WS_EX_CONTEXTHELP
  152. // intl styles
  153. #define WEFRIGHT 0x0910 // WS_EX_RIGHT
  154. #define WEFRTLREADING 0x0920 // WS_EX_RTLREADING
  155. #define WEFLEFTSCROLL 0x0940 // WS_EX_LEFTSCROLLBAR
  156. #define WEFCONTROLPARENT 0x0A01 // WS_EX_CONTROLPARENT
  157. #define WEFSTATICEDGE 0x0A02 // WS_EX_STATICEDGE
  158. #define WEFAPPWINDOW 0x0A04 // WS_EX_APPWINDOW
  159. #define WEFLAYERED 0x0A08 // WS_EX_LAYERED
  160. #ifdef USE_MIRRORING
  161. #define WEFNOINHERITLAYOUT 0x0A10 // WS_EX_NOINHERITLAYOUT
  162. #define WEFLAYOUTVBHRESERVED 0x0A20 // WS_EX_LAYOUTVBHRESERVED
  163. #define WEFLAYOUTRTL 0x0A40 // WS_EX_LAYOUTRTL
  164. #define WEFLAYOUTBTTRESERVED 0x0A80 // WS_EX_LAYOUTBTTRESERVED
  165. #endif
  166. /*
  167. * To delay adding a new state3 DWORD in the WW structure, we're using
  168. * the extended style bits for now. If we'll need more of these, we'll
  169. * add the new DWORD and move these ones around
  170. */
  171. #define WEFPUIFOCUSHIDDEN 0x0B80 // focus indicators hidden
  172. #define WEFPUIACCELHIDDEN 0x0B40 // keyboard acceleraors hidden
  173. #define WEFPREDIRECTED 0x0B20 // redirection bit
  174. #define WEFPCOMPOSITING 0x0B10 // compositing
  175. /*
  176. * Add more Window Extended Style flags here, up to 0x0B80.
  177. * Be sure to add the flag to the wFlags array in kd\userexts.c
  178. */
  179. #ifdef REDIRECTION
  180. #define WEFMSR 0x0B01 // WS_EX_MSR
  181. #endif // REDIRECTION
  182. #define WEFCOMPOSITED 0x0B02 // WS_EX_COMPOSITED
  183. #define WEFNOACTIVATE 0x0B08 // WS_EX_NOACTIVATE
  184. #ifdef LAME_BUTTON
  185. #define WEFLAMEBUTTONON 0x0908 // the "comments" button is displayed
  186. #endif // LAME_BUTTON
  187. /*
  188. * Window styles, from 0x0E00 to 0x0F80.
  189. */
  190. #define WFMAXBOX 0x0E01 // WS_MAXIMIZEBOX
  191. #define WFTABSTOP 0x0E01 // WS_TABSTOP
  192. #define WFMINBOX 0x0E02 // WS_MAXIMIZEBOX
  193. #define WFGROUP 0x0E02 // WS_GROUP
  194. #define WFSIZEBOX 0x0E04 // WS_THICKFRAME, WS_SIZEBOX
  195. #define WFSYSMENU 0x0E08 // WS_SYSMENU
  196. #define WFHSCROLL 0x0E10 // WS_HSCROLL
  197. #define WFVSCROLL 0x0E20 // WS_VSCROLL
  198. #define WFDLGFRAME 0x0E40 // WS_DLGFRAME
  199. #define WFTOPLEVEL 0x0E40 // ???
  200. #define WFBORDER 0x0E80 // WS_BORDER
  201. #define WFBORDERMASK 0x0EC0 // WS_BORDER | WS_DLGFRAME
  202. #define WFCAPTION 0x0EC0 // WS_CAPTION
  203. #define WFTILED 0x0F00 // WS_OVERLAPPED, WS_TILED
  204. #define WFMAXIMIZED 0x0F01 // WS_MAXIMIZE
  205. #define WFCLIPCHILDREN 0x0F02 // WS_CLIPCHILDREN
  206. #define WFCLIPSIBLINGS 0x0F04 // WS_CLIPSIBLINGS
  207. #define WFDISABLED 0x0F08 // WS_DISABLED
  208. #define WFVISIBLE 0x0F10 // WS_VISIBLE
  209. #define WFMINIMIZED 0x0F20 // WS_MINIMIZE
  210. #define WFCHILD 0x0F40 // WS_CHILD
  211. #define WFPOPUP 0x0F80 // WS_POPUP
  212. #define WFTYPEMASK 0x0FC0 // WS_CHILD | WS_POPUP
  213. #define WFICONICPOPUP 0x0FC0 // WS_CHILD | WS_POPUP
  214. #define WFICONIC WFMINIMIZED
  215. #define CheckMsgFilter(wMsg, wMsgFilterMin, wMsgFilterMax) \
  216. ( ((wMsgFilterMin) == 0 && (wMsgFilterMax) == 0xFFFFFFFF) \
  217. || ( ((wMsgFilterMin) > (wMsgFilterMax)) \
  218. ? (((wMsg) < (wMsgFilterMax)) || ((wMsg) > (wMsgFilterMin))) \
  219. : (((wMsg) >= (wMsgFilterMin)) && ((wMsg) <= (wMsgFilterMax)))))
  220. #define SYS_ALTERNATE 0x2000
  221. #define SYS_PREVKEYSTATE 0x4000
  222. //-------------------------------------------------------------------------//
  223. // Utility fn forwards.
  224. LONG TestWF(HWND hwnd, DWORD flag);
  225. void SetWindowState( HWND hwnd, UINT flags);
  226. void ClearWindowState( HWND hwnd, UINT flags);
  227. #endif __SCROLLPORT_H__