[SDK] -Add the prototype of PaintMenuBar and update the prototype of NtUserPaintMenuBar.
[reactos.git] / reactos / sdk / include / reactos / undocuser.h
1 #ifndef _UNDOCUSER_H
2 #define _UNDOCUSER_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif /* defined(__cplusplus) */
7
8 /* Built in class atoms */
9 #define WC_MENU (MAKEINTATOM(0x8000))
10 #define WC_DESKTOP (MAKEINTATOM(0x8001))
11 #define WC_DIALOG (MAKEINTATOM(0x8002))
12 #define WC_SWITCH (MAKEINTATOM(0x8003))
13 #define WC_ICONTITLE (MAKEINTATOM(0x8004))
14
15 /* Non SDK Styles */
16 #define ES_COMBO 0x200 /* Parent is a combobox */
17 #define WS_MAXIMIZED WS_MAXIMIZE
18 #define WS_MINIMIZED WS_MINIMIZE
19
20 /* Non SDK ExStyles */
21 #define WS_EX_DRAGDETECT 0x00000002
22 #define WS_EX_MAKEVISIBLEWHENUNGHOSTED 0x00000800
23 #define WS_EX_FORCELEGACYRESIZENCMETR 0x00800000
24 #define WS_EX_UISTATEACTIVE 0x04000000
25 #define WS_EX_REDIRECTED 0x20000000
26 #define WS_EX_UISTATEKBACCELHIDDEN 0x40000000
27 #define WS_EX_UISTATEFOCUSRECTHIDDEN 0x80000000
28 #define WS_EX_SETANSICREATOR 0x80000000 // For WNDS_ANSICREATOR
29
30 /* Non SDK Window Message types. */
31 #define WM_SETVISIBLE 0x00000009
32 #define WM_ALTTABACTIVE 0x00000029
33 #define WM_ISACTIVEICON 0x00000035
34 #define WM_QUERYPARKICON 0x00000036
35 #define WM_CLIENTSHUTDOWN 0x0000003B
36 #define WM_COPYGLOBALDATA 0x00000049
37 #define WM_LOGONNOTIFY 0x0000004C
38 #define WM_KEYF1 0x0000004D
39 #define WM_KLUDGEMINRECT 0x0000008B
40 #define WM_NCUAHDRAWCAPTION 0x000000AE
41 #define WM_NCUAHDRAWFRAME 0x000000AF
42 #define WM_SYSTIMER 0x00000118
43 #define WM_LBTRACKPOINT 0x00000131
44 #define LB_CARETON 0x000001a3
45 #define LB_CARETOFF 0x000001a4
46 #define MN_SETHMENU 0x000001e0
47 #define WM_DROPOBJECT 0x0000022A
48 #define WM_QUERYDROPOBJECT 0x0000022B
49 #define WM_BEGINDRAG 0x0000022C
50 #define WM_DRAGLOOP 0x0000022D
51 #define WM_DRAGSELECT 0x0000022E
52 #define WM_DRAGMOVE 0x0000022F
53 #define WM_POPUPSYSTEMMENU 0x00000313
54 #define WM_UAHINIT 0x0000031b
55 #define WM_CBT 0x000003FF // ReactOS only.
56 #define WM_MAXIMUM 0x0001FFFF
57
58 /* Non SDK DCE types.*/
59 #define DCX_USESTYLE 0x00010000
60 #define DCX_KEEPCLIPRGN 0x00040000
61 #define DCX_KEEPLAYOUT 0x40000000
62 #define DCX_PROCESSOWNED 0x80000000
63
64 /* Non SDK TPM types.*/
65 #define TPM_SYSTEM_MENU 0x00000200
66
67 /* NtUserCreateWindowEx dwFlags bits. */
68 #define NUCWE_ANSI 0x00000001
69 #define NUCWE_SIDEBYSIDE 0x40000000
70
71 /* Caret timer ID */
72 #define IDCARETTIMER (0xffff)
73 #define ID_TME_TIMER (0xFFFA)
74
75 /* SetWindowPos undocumented flags */
76 #define SWP_NOCLIENTSIZE 0x0800
77 #define SWP_NOCLIENTMOVE 0x1000
78 #define SWP_STATECHANGED 0x8000
79
80 /* NtUserSetScrollInfo mask to return original position before it is change */
81 #define SIF_PREVIOUSPOS 4096
82
83 /* ScrollWindow uses the window DC, ScrollWindowEx doesn't */
84 #define SW_SCROLLWNDDCE 0x8000
85
86 /* Non SDK Queue state flags. */
87 #define QS_SMRESULT 0x8000 /* see "Undoc. Windows" */
88 //
89 #define QS_EVENT 0x2000
90 #define QS_SYSEVENT (QS_EVENT|QS_SENDMESSAGE)
91 //
92
93 //
94 // Definitions used by WM_CLIENTSHUTDOWN
95 //
96 // Client Shutdown messages
97 #define MCS_ENDSESSION 1
98 #define MCS_QUERYENDSESSION 2
99 // Client Shutdown returns
100 #define MCSR_GOODFORSHUTDOWN 1
101 #define MCSR_SHUTDOWNFINISHED 2
102 #define MCSR_DONOTSHUTDOWN 3
103
104 //
105 // Definitions used by WM_LOGONNOTIFY
106 //
107 #define LN_LOGOFF 0x0
108 #define LN_SHELL_EXITED 0x2
109 #define LN_START_TASK_MANAGER 0x4
110 #define LN_LOCK_WORKSTATION 0x5
111 #define LN_UNLOCK_WORKSTATION 0x6
112 #define LN_MESSAGE_BEEP 0x9
113 #define LN_START_SCREENSAVE 0xA
114 #define LN_LOGOFF_CANCELED 0xB
115
116 //
117 // Undocumented flags for ExitWindowsEx
118 //
119 #define EWX_SHUTDOWN_CANCELED 0x0080
120 #define EWX_CALLER_SYSTEM 0x0100
121 #define EWX_CALLER_WINLOGON 0x0200
122 #define EWX_CALLER_WINLOGON_LOGOFF 0x1000 // WARNING!! Broken flag.
123 // All the range 0x0400 to 0x1000 is reserved for Winlogon.
124 // Flag 0x2000 appears to be a flag set when we call InitiateSystemShutdown* APIs (Winlogon shutdown APIs).
125 // 0x4000 is also reserved.
126 #define EWX_NOTIFY 0x8000
127 #define EWX_NONOTIFY 0x10000
128
129 // From WinCE 6.0 Imm.h SDK
130 // Returns for ImmProcessHotKey
131 #define IPHK_HOTKEY 0x0001
132 #define IPHK_PROCESSBYIME 0x0002
133 #define IPHK_CHECKCTRL 0x0004
134 #define IPHK_SKIPTHISKEY 0x0010
135
136 //
137 // Undocumented flags for DrawCaptionTemp
138 //
139 #define DC_NOVISIBLE 0x0800
140 #define DC_NOSENDMSG 0x2000
141 #define DC_FRAME 0x8000 // Missing from WinUser.H!
142
143 #define DC_DRAWCAPTIONMD 0x10000000
144 #define DC_REDRAWHUNGWND 0x20000000
145 #define DC_DRAWFRAMEMD 0x80000000
146
147 //
148 // Undocumented states for DrawFrameControl
149 //
150 #define DFCS_MENUARROWUP 0x0008
151 #define DFCS_MENUARROWDOWN 0x0010
152
153
154 #define STARTF_SCRNSAVER 0x80000000
155
156 #define MOD_WINLOGON_SAS 0x8000
157
158 #define CW_USEDEFAULT16 ((short)0x8000)
159
160 #define SBRG_SCROLLBAR 0 /* the scrollbar itself */
161 #define SBRG_TOPRIGHTBTN 1 /* the top or right button */
162 #define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
163 #define SBRG_SCROLLBOX 3 /* the scroll box */
164 #define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
165 #define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
166
167 BOOL WINAPI UpdatePerUserSystemParameters(DWORD dwReserved, BOOL bEnable);
168 BOOL WINAPI SetLogonNotifyWindow(HWND Wnd);
169 BOOL WINAPI KillSystemTimer(HWND,UINT_PTR);
170 UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
171 DWORD_PTR WINAPI SetSysColorsTemp(const COLORREF *, const HBRUSH *, DWORD_PTR);
172 BOOL WINAPI SetDeskWallPaper(LPCSTR);
173 VOID WINAPI ScrollChildren(HWND,UINT,WPARAM,LPARAM);
174 void WINAPI CalcChildScroll(HWND, INT);
175 BOOL WINAPI RegisterLogonProcess(DWORD,BOOL);
176 DWORD WINAPI GetAppCompatFlags(HTASK hTask);
177 DWORD WINAPI GetAppCompatFlags2(HTASK hTask);
178 LONG WINAPI CsrBroadcastSystemMessageExW(DWORD dwflags,
179 LPDWORD lpdwRecipients,
180 UINT uiMessage,
181 WPARAM wParam,
182 LPARAM lParam,
183 PBSMINFO pBSMInfo);
184 BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl);
185 HWND WINAPI SetTaskmanWindow(HWND);
186 HWND WINAPI GetTaskmanWindow(VOID);
187 HWND WINAPI GetProgmanWindow(VOID);
188 BOOL WINAPI SetShellWindow(HWND);
189 BOOL WINAPI SetShellWindowEx(HWND, HWND);
190
191 BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT);
192 BOOL WINAPI DrawCaptionTempW(HWND,HDC,const RECT*,HFONT,HICON,LPCWSTR,UINT);
193 BOOL WINAPI PaintMenuBar(HWND hWnd, HDC hDC, ULONG left, ULONG right, ULONG top, BOOL bActive);
194
195 #ifdef UNICODE
196 #define DrawCaptionTemp DrawCaptionTempW
197 #else
198 #define DrawCaptionTemp DrawCaptionTempA
199 #endif
200
201
202 //
203 // User api hook
204 //
205
206 typedef LRESULT(CALLBACK *WNDPROC_OWP)(HWND,UINT,WPARAM,LPARAM,ULONG_PTR,PDWORD);
207 typedef int (WINAPI *SETWINDOWRGN)(HWND hWnd, HRGN hRgn, BOOL bRedraw);
208 typedef BOOL (WINAPI *GETSCROLLINFO)(HWND,INT,LPSCROLLINFO);
209 typedef INT (WINAPI *SETSCROLLINFO)(HWND,int,LPCSCROLLINFO,BOOL);
210 typedef BOOL (WINAPI *ENABLESCROLLBAR)(HWND,UINT,UINT);
211 typedef BOOL (WINAPI *ADJUSTWINDOWRECTEX)(LPRECT,DWORD,BOOL,DWORD);
212 typedef int (WINAPI *GETSYSTEMMETRICS)(int);
213 typedef BOOL (WINAPI *SYSTEMPARAMETERSINFOA)(UINT,UINT,PVOID,UINT);
214 typedef BOOL (WINAPI *SYSTEMPARAMETERSINFOW)(UINT,UINT,PVOID,UINT);
215 typedef BOOL (__fastcall *FORCERESETUSERAPIHOOK)(HINSTANCE);
216 typedef BOOL (WINAPI *DRAWFRAMECONTROL)(HDC,LPRECT,UINT,UINT);
217 typedef BOOL (WINAPI *DRAWCAPTION)(HWND,HDC,LPCRECT,UINT);
218 typedef BOOL (WINAPI *MDIREDRAWFRAME)(HWND,DWORD);
219 typedef DWORD (WINAPI *GETREALWINDOWOWNER)(HWND);
220
221 typedef struct _UAHOWP
222 {
223 BYTE* MsgBitArray;
224 DWORD Size;
225 } UAHOWP, *PUAHOWP;
226
227 #define UAH_HOOK_MESSAGE(uahowp, msg) uahowp.MsgBitArray[msg/8] |= (1 << (msg % 8));
228 #define UAH_IS_MESSAGE_HOOKED(uahowp, msg) (uahowp.MsgBitArray[msg/8] & (1 << (msg % 8)))
229 #define UAHOWP_MAX_SIZE WM_USER/8
230
231 typedef struct tagUSERAPIHOOK
232 {
233 DWORD size;
234 WNDPROC DefWindowProcA;
235 WNDPROC DefWindowProcW;
236 UAHOWP DefWndProcArray;
237 GETSCROLLINFO GetScrollInfo;
238 SETSCROLLINFO SetScrollInfo;
239 ENABLESCROLLBAR EnableScrollBar;
240 ADJUSTWINDOWRECTEX AdjustWindowRectEx;
241 SETWINDOWRGN SetWindowRgn;
242 WNDPROC_OWP PreWndProc;
243 WNDPROC_OWP PostWndProc;
244 UAHOWP WndProcArray;
245 WNDPROC_OWP PreDefDlgProc;
246 WNDPROC_OWP PostDefDlgProc;
247 UAHOWP DlgProcArray;
248 GETSYSTEMMETRICS GetSystemMetrics;
249 SYSTEMPARAMETERSINFOA SystemParametersInfoA;
250 SYSTEMPARAMETERSINFOW SystemParametersInfoW;
251 FORCERESETUSERAPIHOOK ForceResetUserApiHook;
252 DRAWFRAMECONTROL DrawFrameControl;
253 DRAWCAPTION DrawCaption;
254 MDIREDRAWFRAME MDIRedrawFrame;
255 GETREALWINDOWOWNER GetRealWindowOwner;
256 } USERAPIHOOK, *PUSERAPIHOOK;
257
258 typedef enum _UAPIHK
259 {
260 uahLoadInit,
261 uahStop,
262 uahShutdown
263 } UAPIHK, *PUAPIHK;
264
265 typedef BOOL(CALLBACK *USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah);
266
267 typedef struct _USERAPIHOOKINFO
268 {
269 DWORD m_size;
270 LPCWSTR m_dllname1;
271 LPCWSTR m_funname1;
272 LPCWSTR m_dllname2;
273 LPCWSTR m_funname2;
274 } USERAPIHOOKINFO,*PUSERAPIHOOKINFO;
275
276 #if (WINVER == _WIN32_WINNT_WINXP)
277 BOOL WINAPI RegisterUserApiHook(HINSTANCE hInstance, USERAPIHOOKPROC CallbackFunc);
278 #elif (WINVER == _WIN32_WINNT_WS03)
279 BOOL WINAPI RegisterUserApiHook(PUSERAPIHOOKINFO puah);
280 #endif
281
282 BOOL WINAPI UnregisterUserApiHook(VOID);
283
284 #ifdef __cplusplus
285 } /* extern "C" */
286 #endif /* defined(__cplusplus) */
287
288 #endif