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