Synchronize up to trunk's revision r57756.
[reactos.git] / include / reactos / undocuser.h
1 #ifndef _UNDOCUSER_H
2 #define _UNDOCUSER_H
3
4 /* Built in class atoms */
5 #define WC_MENU (MAKEINTATOM(0x8000))
6 #define WC_DESKTOP (MAKEINTATOM(0x8001))
7 #define WC_DIALOG (MAKEINTATOM(0x8002))
8 #define WC_SWITCH (MAKEINTATOM(0x8003))
9 #define WC_ICONTITLE (MAKEINTATOM(0x8004))
10
11 /* Non SDK Styles */
12 #define ES_COMBO 0x200 /* Parent is a combobox */
13 #define WS_MAXIMIZED WS_MAXIMIZE
14 #define WS_MINIMIZED WS_MINIMIZE
15
16 /* Non SDK ExStyles */
17 #define WS_EX_DRAGDETECT 0x00000002
18 #define WS_EX_MAKEVISIBLEWHENUNGHOSTED 0x00000800
19 #define WS_EX_FORCELEGACYRESIZENCMETR 0x00800000
20 #define WS_EX_UISTATEACTIVE 0x04000000
21 #define WS_EX_REDIRECTED 0x20000000
22 #define WS_EX_UISTATEKBACCELHIDDEN 0x40000000
23 #define WS_EX_UISTATEFOCUSRECTHIDDEN 0x80000000
24 #define WS_EX_SETANSICREATOR 0x80000000 // For WNDS_ANSICREATOR
25
26 /* Non SDK Window Message types. */
27 #define WM_SETVISIBLE 0x00000009
28 #define WM_ALTTABACTIVE 0x00000029
29 #define WM_ISACTIVEICON 0x00000035
30 #define WM_QUERYPARKICON 0x00000036
31 #define WM_CLIENTSHUTDOWN 0x0000003B
32 #define WM_COPYGLOBALDATA 0x00000049
33 #define WM_LOGONNOTIFY 0x0000004C
34 #define WM_KEYF1 0x0000004D
35 #define WM_NCUAHDRAWCAPTION 0x000000AE
36 #define WM_NCUAHDRAWFRAME 0x000000AF
37 #define WM_SYSTIMER 0x00000118
38 #define WM_LBTRACKPOINT 0x00000131
39 #define LB_CARETON 0x000001a3
40 #define LB_CARETOFF 0x000001a4
41 #define WM_DROPOBJECT 0x0000022A
42 #define WM_QUERYDROPOBJECT 0x0000022B
43 #define WM_BEGINDRAG 0x0000022C
44 #define WM_DRAGLOOP 0x0000022D
45 #define WM_DRAGSELECT 0x0000022E
46 #define WM_DRAGMOVE 0x0000022F
47 #define WM_POPUPSYSTEMMENU 0x00000313
48 #define WM_UAHINIT 0x0000031b
49 #define WM_CBT 0x000003FF // ReactOS only.
50 #define WM_MAXIMUM 0x0001FFFF
51
52 /* Non SDK DCE types.*/
53 #define DCX_USESTYLE 0x00010000
54 #define DCX_KEEPCLIPRGN 0x00040000
55 #define DCX_KEEPLAYOUT 0x40000000
56 #define DCX_PROCESSOWNED 0x80000000
57
58 /* NtUserCreateWindowEx dwFlags bits. */
59 #define NUCWE_ANSI 0x00000001
60 #define NUCWE_SIDEBYSIDE 0x40000000
61
62 /* Caret timer ID */
63 #define IDCARETTIMER (0xffff)
64 #define ID_TME_TIMER (0xFFFA)
65
66 /* SetWindowPos undocumented flags */
67 #define SWP_NOCLIENTSIZE 0x0800
68 #define SWP_NOCLIENTMOVE 0x1000
69 #define SWP_STATECHANGED 0x8000
70
71 /* NtUserSetScrollInfo mask to return original position before it is change */
72 #define SIF_PREVIOUSPOS 4096
73
74 /* ScrollWindow uses the window DC, ScrollWindowEx doesn't */
75 #define SW_SCROLLWNDDCE 0x8000
76
77 /* Non SDK Queue state flags. */
78 #define QS_SMRESULT 0x8000 /* see "Undoc. Windows" */
79
80 //
81 // Definitions used by WM_CLIENTSHUTDOWN
82 //
83 // Client Shutdown messages
84 #define MCS_SHUTDOWNTIMERS 1
85 #define MCS_QUERYENDSESSION 2
86 // Client Shutdown returns
87 #define MCSR_GOODFORSHUTDOWN 1
88 #define MCSR_SHUTDOWNFINISHED 2
89 #define MCSR_DONOTSHUTDOWN 3
90
91 //
92 // Definitions used by WM_LOGONNOTIFY
93 //
94 #define LN_SHELL_EXITED 0x2
95 #define LN_START_TASK_MANAGER 0x4
96 #define LN_LOCK_WORKSTATION 0x5
97 #define LN_UNLOCK_WORKSTATION 0x6
98 #define LN_MESSAGE_BEEP 0x9
99 #define LN_START_SCREENSAVE 0xA
100
101 #define STARTF_SCRNSAVER 0x80000000
102
103 #define CW_USEDEFAULT16 ((short)0x8000)
104
105 #define SBRG_SCROLLBAR 0 /* the scrollbar itself */
106 #define SBRG_TOPRIGHTBTN 1 /* the top or right button */
107 #define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
108 #define SBRG_SCROLLBOX 3 /* the scroll box */
109 #define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
110 #define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
111
112 BOOL WINAPI UpdatePerUserSystemParameters(DWORD dwReserved, BOOL bEnable);
113 BOOL WINAPI SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta);
114 BOOL WINAPI KillSystemTimer(HWND,UINT_PTR);
115 UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
116 DWORD_PTR WINAPI SetSysColorsTemp(const COLORREF *, const HBRUSH *, DWORD_PTR);
117 BOOL WINAPI SetDeskWallPaper(LPCSTR);
118 VOID WINAPI ScrollChildren(HWND,UINT,WPARAM,LPARAM);
119 void WINAPI CalcChildScroll(HWND, INT);
120 BOOL WINAPI RegisterLogonProcess(DWORD,BOOL);
121 DWORD WINAPI GetAppCompatFlags(HTASK hTask);
122 DWORD WINAPI GetAppCompatFlags2(HTASK hTask);
123 LONG WINAPI CsrBroadcastSystemMessageExW(DWORD dwflags,
124 LPDWORD lpdwRecipients,
125 UINT uiMessage,
126 WPARAM wParam,
127 LPARAM lParam,
128 PBSMINFO pBSMInfo);
129 BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl);
130 HWND WINAPI GetTaskmanWindow(VOID);
131 HWND WINAPI GetProgmanWindow(VOID);
132
133 //
134 // User api hook
135 //
136
137 typedef LRESULT(CALLBACK *WNDPROC_OWP)(HWND,UINT,WPARAM,LPARAM,ULONG_PTR,PDWORD);
138 typedef int (WINAPI *SETWINDOWRGN)(HWND hWnd, HRGN hRgn, BOOL bRedraw);
139
140 typedef struct _UAHOWP
141 {
142 BYTE* MsgBitArray;
143 DWORD Size;
144 } UAHOWP, *PUAHOWP;
145
146 #define UAH_HOOK_MESSAGE(uahowp, msg) uahowp.MsgBitArray[msg/8] |= (1 << (msg % 8));
147 #define UAH_IS_MESSAGE_HOOKED(uahowp, msg) (uahowp.MsgBitArray[msg/8] & (1 << (msg % 8)))
148 #define UAHOWP_MAX_SIZE WM_USER/8
149
150 typedef struct tagUSERAPIHOOK
151 {
152 DWORD size;
153 WNDPROC DefWindowProcA;
154 WNDPROC DefWindowProcW;
155 UAHOWP DefWndProcArray;
156 FARPROC GetScrollInfo;
157 FARPROC SetScrollInfo;
158 FARPROC EnableScrollBar;
159 FARPROC AdjustWindowRectEx;
160 SETWINDOWRGN SetWindowRgn;
161 WNDPROC_OWP PreWndProc;
162 WNDPROC_OWP PostWndProc;
163 UAHOWP WndProcArray;
164 WNDPROC_OWP PreDefDlgProc;
165 WNDPROC_OWP PostDefDlgProc;
166 UAHOWP DlgProcArray;
167 FARPROC GetSystemMetrics;
168 FARPROC SystemParametersInfoA;
169 FARPROC SystemParametersInfoW;
170 FARPROC ForceResetUserApiHook;
171 FARPROC DrawFrameControl;
172 FARPROC DrawCaption;
173 FARPROC MDIRedrawFrame;
174 FARPROC GetRealWindowOwner;
175 } USERAPIHOOK, *PUSERAPIHOOK;
176
177 typedef enum _UAPIHK
178 {
179 uahLoadInit,
180 uahStop,
181 uahShutdown
182 } UAPIHK, *PUAPIHK;
183
184 typedef BOOL(CALLBACK *USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah);
185
186 typedef struct _USERAPIHOOKINFO
187 {
188 DWORD m_size;
189 LPCWSTR m_dllname1;
190 LPCWSTR m_funname1;
191 LPCWSTR m_dllname2;
192 LPCWSTR m_funname2;
193 } USERAPIHOOKINFO,*PUSERAPIHOOKINFO;
194
195 #if (WINVER == _WIN32_WINNT_WINXP)
196 BOOL WINAPI RegisterUserApiHook(HINSTANCE hInstance, USERAPIHOOKPROC CallbackFunc);
197 #elif (WINVER == _WIN32_WINNT_WS03)
198 BOOL WINAPI RegisterUserApiHook(PUSERAPIHOOKINFO puah);
199 #endif
200
201 BOOL WINAPI UnregisterUserApiHook(VOID);
202
203 #endif