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