blob: 041b3ba94f1bb12137cd509cc4cc78ff79035fa7 [file] [log] [blame]
Alexandre Julliard401710d1993-09-04 10:09:32 +00001/*
Alexandre Julliard6a78c162004-12-08 18:06:14 +00002 * USER private definitions
Alexandre Julliard401710d1993-09-04 10:09:32 +00003 *
4 * Copyright 1993 Alexandre Julliard
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00005 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
Jonathan Ernst360a3f92006-05-18 14:49:52 +020018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard401710d1993-09-04 10:09:32 +000019 */
20
Alexandre Julliard6a78c162004-12-08 18:06:14 +000021#ifndef __WINE_USER_PRIVATE_H
22#define __WINE_USER_PRIVATE_H
Alexandre Julliard401710d1993-09-04 10:09:32 +000023
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000024#include <stdarg.h>
Alexandre Julliard6a78c162004-12-08 18:06:14 +000025#include "windef.h"
26#include "winbase.h"
27#include "wingdi.h"
28#include "winuser.h"
Alexandre Julliard86be9f22005-04-27 08:18:20 +000029#include "winreg.h"
30#include "winternl.h"
Dimi Paun8ad6c252005-05-19 11:12:57 +000031#include "wine/windef16.h"
32#include "wine/winbase16.h"
Alexandre Julliard401710d1993-09-04 10:09:32 +000033
Alexandre Julliardc57b5052007-11-07 18:05:49 +010034extern WORD USER_HeapSel DECLSPEC_HIDDEN;
Alexandre Julliard401710d1993-09-04 10:09:32 +000035
Dimi Paun8ad6c252005-05-19 11:12:57 +000036static inline HLOCAL16 LOCAL_Alloc( HANDLE16 ds, UINT16 flags, WORD size )
37{
Dmitry Timoshkov9a295e72007-05-30 19:32:24 +090038 STACK16FRAME* stack16 = MapSL(PtrToUlong(NtCurrentTeb()->WOW32Reserved));
Dimi Paun8ad6c252005-05-19 11:12:57 +000039 HANDLE16 oldDS = stack16->ds;
40 HLOCAL16 ret;
41
42 stack16->ds = ds;
43 ret = LocalAlloc16 (flags, size);
44 stack16->ds = oldDS;
45 return ret;
46}
47
48static inline HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, UINT16 flags )
49{
Dmitry Timoshkov9a295e72007-05-30 19:32:24 +090050 STACK16FRAME* stack16 = MapSL(PtrToUlong(NtCurrentTeb()->WOW32Reserved));
Dimi Paun8ad6c252005-05-19 11:12:57 +000051 HANDLE16 oldDS = stack16->ds;
52 HLOCAL16 ret;
53
54 stack16->ds = ds;
55 ret = LocalReAlloc16 (handle, size, flags);
56 stack16->ds = oldDS;
57 return ret;
58}
59
60static inline HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle )
61{
Dmitry Timoshkov9a295e72007-05-30 19:32:24 +090062 STACK16FRAME* stack16 = MapSL(PtrToUlong(NtCurrentTeb()->WOW32Reserved));
Dimi Paun8ad6c252005-05-19 11:12:57 +000063 HANDLE16 oldDS = stack16->ds;
64 HLOCAL16 ret;
65
66 stack16->ds = ds;
67 ret = LocalFree16 (handle);
68 stack16->ds = oldDS;
69 return ret;
70}
71
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000072#define USER_HEAP_ALLOC(size) \
Alexandre Julliard7521a422002-10-19 00:55:34 +000073 ((HANDLE)(ULONG_PTR)LOCAL_Alloc( USER_HeapSel, LMEM_FIXED, (size) ))
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000074#define USER_HEAP_REALLOC(handle,size) \
Alexandre Julliard7521a422002-10-19 00:55:34 +000075 ((HANDLE)(ULONG_PTR)LOCAL_ReAlloc( USER_HeapSel, LOWORD(handle), (size), LMEM_FIXED ))
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000076#define USER_HEAP_FREE(handle) \
Alexandre Julliard7521a422002-10-19 00:55:34 +000077 LOCAL_Free( USER_HeapSel, LOWORD(handle) )
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000078#define USER_HEAP_LIN_ADDR(handle) \
Alexandre Julliard7521a422002-10-19 00:55:34 +000079 ((handle) ? MapSL(MAKESEGPTR(USER_HeapSel, LOWORD(handle))) : NULL)
Alexandre Julliardfb9a9191994-03-01 19:48:04 +000080
Eric Pouech294835a2004-12-06 20:43:55 +000081#define GET_WORD(ptr) (*(const WORD *)(ptr))
82#define GET_DWORD(ptr) (*(const DWORD *)(ptr))
Alexandre Julliard7fbd74e2002-05-23 02:53:10 +000083
Francois Gougeteab56a52006-11-09 11:24:16 +010084#define WM_SYSTIMER 0x0118
85
Alexandre Julliardfb0ff052001-10-16 21:58:58 +000086/* internal messages codes */
87enum wine_internal_message
88{
89 WM_WINE_DESTROYWINDOW = 0x80000000,
90 WM_WINE_SETWINDOWPOS,
91 WM_WINE_SHOWWINDOW,
Alexandre Julliardddc33172001-10-22 19:08:33 +000092 WM_WINE_SETPARENT,
93 WM_WINE_SETWINDOWLONG,
Alexandre Julliard5030bda2002-10-11 23:41:06 +000094 WM_WINE_ENABLEWINDOW,
Alexandre Julliardca3ac8f2003-07-11 21:55:58 +000095 WM_WINE_SETACTIVEWINDOW,
96 WM_WINE_KEYBOARD_LL_HOOK,
Alexandre Julliard97d6e7f2005-03-07 17:19:24 +000097 WM_WINE_MOUSE_LL_HOOK,
98 WM_WINE_FIRST_DRIVER_MSG = 0x80001000, /* range of messages reserved for the USER driver */
99 WM_WINE_LAST_DRIVER_MSG = 0x80001fff
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000100};
Alexandre Julliard42d20f92000-08-10 01:16:19 +0000101
Alexandre Julliard6a78c162004-12-08 18:06:14 +0000102struct tagCURSORICONINFO;
Alexandre Julliard32fb5802001-10-18 21:38:59 +0000103
Patrik Stridvallb87fe2e1999-04-01 08:16:08 +0000104typedef struct tagUSER_DRIVER {
Alexandre Julliard28c3a1b2000-03-20 18:21:19 +0000105 /* keyboard functions */
Alexandre Julliardaef19ab2005-03-09 16:45:23 +0000106 HKL (*pActivateKeyboardLayout)(HKL, UINT);
107 void (*pBeep)(void);
108 SHORT (*pGetAsyncKeyState)(INT);
Dmitry Timoshkovb0c2e542003-11-14 03:32:43 +0000109 INT (*pGetKeyNameText)(LONG, LPWSTR, INT);
Dmitry Timoshkovb0c2e542003-11-14 03:32:43 +0000110 HKL (*pGetKeyboardLayout)(DWORD);
Alexandre Julliardaef19ab2005-03-09 16:45:23 +0000111 UINT (*pGetKeyboardLayoutList)(INT, HKL *);
Dmitry Timoshkovb0c2e542003-11-14 03:32:43 +0000112 BOOL (*pGetKeyboardLayoutName)(LPWSTR);
113 HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT);
Alexandre Julliardaef19ab2005-03-09 16:45:23 +0000114 UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL);
115 UINT (*pSendInput)(UINT, LPINPUT, int);
116 INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
Dmitry Timoshkovb0c2e542003-11-14 03:32:43 +0000117 BOOL (*pUnloadKeyboardLayout)(HKL);
Alexandre Julliardaef19ab2005-03-09 16:45:23 +0000118 SHORT (*pVkKeyScanEx)(WCHAR, HKL);
Alexandre Julliard28c3a1b2000-03-20 18:21:19 +0000119 /* mouse functions */
Alexandre Julliard28c3a1b2000-03-20 18:21:19 +0000120 void (*pSetCursor)(struct tagCURSORICONINFO *);
Alexandre Julliardaef19ab2005-03-09 16:45:23 +0000121 BOOL (*pGetCursorPos)(LPPOINT);
122 BOOL (*pSetCursorPos)(INT,INT);
Vitaliy Margolenc3dc6922007-01-04 12:24:50 -0700123 BOOL (*pClipCursor)(LPCRECT);
Alexandre Julliard7f3418f2000-03-25 17:30:13 +0000124 /* screen saver functions */
125 BOOL (*pGetScreenSaveActive)(void);
126 void (*pSetScreenSaveActive)(BOOL);
Alexandre Julliard42d20f92000-08-10 01:16:19 +0000127 /* clipboard functions */
Ulrich Czekalla0c468c82006-06-05 11:55:14 -0400128 INT (*pAcquireClipboard)(HWND); /* Acquire selection */
Ulrich Czekallab2df5f92003-06-23 23:02:02 +0000129 BOOL (*pCountClipboardFormats)(void); /* Count available clipboard formats */
Ulrich Czekallab41466b2004-05-06 23:40:30 +0000130 void (*pEmptyClipboard)(BOOL); /* Empty clipboard data */
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000131 void (*pEndClipboardUpdate)(void); /* End clipboard update */
132 UINT (*pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */
Ulrich Czekallab2df5f92003-06-23 23:02:02 +0000133 BOOL (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000134 INT (*pGetClipboardFormatName)(UINT, LPWSTR, UINT); /* Get a clipboard format name */
Ulrich Czekallab2df5f92003-06-23 23:02:02 +0000135 BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000136 UINT (*pRegisterClipboardFormat)(LPCWSTR); /* Register a clipboard format */
Ulrich Czekallab41466b2004-05-06 23:40:30 +0000137 BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */
Alex Pasadyn330179f2003-04-22 00:15:48 +0000138 /* display modes */
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000139 LONG (*pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
Alexandre Julliard8a890352006-10-23 13:51:30 +0200140 BOOL (*pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000141 BOOL (*pEnumDisplaySettingsEx)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
Alexandre Julliard8a890352006-10-23 13:51:30 +0200142 BOOL (*pGetMonitorInfo)(HMONITOR,MONITORINFO*);
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +0000143 /* windowing functions */
Alexandre Julliarde419cb82005-07-07 20:33:29 +0000144 BOOL (*pCreateDesktopWindow)(HWND);
Gerard Patelad363032001-06-06 21:26:50 +0000145 BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL);
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000146 void (*pDestroyWindow)(HWND);
Alexandre Julliard2fb7c872005-03-25 16:47:04 +0000147 HDC (*pGetDCEx)(HWND,HRGN,DWORD);
Alexandre Julliard51ab43b2001-05-18 22:51:56 +0000148 DWORD (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000149 INT (*pReleaseDC)(HWND,HDC,BOOL);
Ulrich Czekalla06a60622004-06-15 17:04:02 +0000150 BOOL (*pScrollDC)(HDC, INT, INT, const RECT *, const RECT *, HRGN, LPRECT);
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +0000151 void (*pSetFocus)(HWND);
Pierre d'Herbemont221b0442006-12-10 23:21:28 +0100152 void (*pSetParent)(HWND,HWND,HWND);
Pierre d'Herbemonte5e58a62006-11-26 23:21:02 +0100153 BOOL (*pSetWindowPos)(HWND,HWND,const RECT *,const RECT *,UINT,const RECT *);
Alexandre Julliardddc33172001-10-22 19:08:33 +0000154 int (*pSetWindowRgn)(HWND,HRGN,BOOL);
Alexandre Julliard446d8322003-12-31 23:51:52 +0000155 void (*pSetWindowIcon)(HWND,UINT,HICON);
Gerard Patel94ce2a32001-10-03 18:44:02 +0000156 void (*pSetWindowStyle)(HWND,DWORD);
Alexandre Julliard2997fc52005-07-18 13:20:18 +0000157 void (*pSetWindowText)(HWND,LPCWSTR);
Alexandre Julliarddc4fe772001-06-04 21:55:17 +0000158 BOOL (*pShowWindow)(HWND,INT);
Alexandre Julliard3abeae82001-05-09 17:21:04 +0000159 void (*pSysCommandSizeMove)(HWND,WPARAM);
Alexandre Julliard2fb7c872005-03-25 16:47:04 +0000160 HWND (*pWindowFromDC)(HDC);
Alexandre Julliard97d6e7f2005-03-07 17:19:24 +0000161 LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM);
Patrik Stridvallb87fe2e1999-04-01 08:16:08 +0000162} USER_DRIVER;
163
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100164extern const USER_DRIVER *USER_Driver DECLSPEC_HIDDEN;
Patrik Stridvallb87fe2e1999-04-01 08:16:08 +0000165
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100166extern void USER_unload_driver(void) DECLSPEC_HIDDEN;
Alexandre Julliard1f90b5c2005-08-10 09:56:23 +0000167
Alexandre Julliard86be9f22005-04-27 08:18:20 +0000168struct received_message_info;
169struct hook16_queue_info;
170
Alexandre Julliard82964f52007-08-08 18:25:38 +0200171/* type of message-sending functions that need special WM_CHAR handling */
172enum wm_char_mapping
173{
174 WMCHAR_MAP_POSTMESSAGE,
175 WMCHAR_MAP_SENDMESSAGE,
176 WMCHAR_MAP_SENDMESSAGETIMEOUT,
177 WMCHAR_MAP_RECVMESSAGE,
178 WMCHAR_MAP_DISPATCHMESSAGE,
179 WMCHAR_MAP_CALLWINDOWPROC,
180 WMCHAR_MAP_COUNT,
181 WMCHAR_MAP_NOMAPPING = WMCHAR_MAP_COUNT
182};
183
184/* data to store state for A/W mappings of WM_CHAR */
185struct wm_char_mapping_data
186{
187 BYTE lead_byte[WMCHAR_MAP_COUNT];
Alexandre Julliard2ce799c2007-08-08 20:35:24 +0200188 MSG get_msg;
Alexandre Julliard82964f52007-08-08 18:25:38 +0200189};
190
Alexandre Julliard86be9f22005-04-27 08:18:20 +0000191/* this is the structure stored in TEB->Win32ClientInfo */
192/* no attempt is made to keep the layout compatible with the Windows one */
193struct user_thread_info
194{
Alexandre Julliard533f5192006-10-05 14:04:25 +0200195 HANDLE server_queue; /* Handle to server-side queue */
196 DWORD recursion_count; /* SendMessage recursion counter */
197 BOOL hook_unicode; /* Is current hook unicode? */
198 HHOOK hook; /* Current hook */
199 struct received_message_info *receive_info; /* Message being currently received */
200 struct hook16_queue_info *hook16_info; /* Opaque pointer for 16-bit hook support */
Alexandre Julliard82964f52007-08-08 18:25:38 +0200201 struct wm_char_mapping_data *wmchar_data; /* Data for WM_CHAR mappings */
Alexandre Julliard533f5192006-10-05 14:04:25 +0200202 DWORD GetMessageTimeVal; /* Value for GetMessageTime */
203 DWORD GetMessagePosVal; /* Value for GetMessagePos */
204 ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
205 HCURSOR cursor; /* Current cursor */
206 INT cursor_count; /* Cursor show count */
207 UINT active_hooks; /* Bitmap of active hooks */
208 HWND desktop; /* Desktop window */
209
Alexandre Julliard82964f52007-08-08 18:25:38 +0200210 ULONG pad[10]; /* Available for more data */
Alexandre Julliard86be9f22005-04-27 08:18:20 +0000211};
212
Vitaliy Margolenbc55b752006-10-04 21:27:09 -0600213struct hook_extra_info
214{
215 HHOOK handle;
216 LPARAM lparam;
217};
218
Alexandre Julliard86be9f22005-04-27 08:18:20 +0000219static inline struct user_thread_info *get_user_thread_info(void)
220{
221 return (struct user_thread_info *)NtCurrentTeb()->Win32ClientInfo;
222}
223
Alexandre Julliard6b4c02e2005-04-27 10:23:24 +0000224/* check if hwnd is a broadcast magic handle */
225static inline BOOL is_broadcast( HWND hwnd )
226{
227 return (hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST);
228}
229
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100230extern HMODULE user32_module DECLSPEC_HIDDEN;
231extern DWORD USER16_AlertableWait DECLSPEC_HIDDEN;
232extern HBRUSH SYSCOLOR_55AABrush DECLSPEC_HIDDEN;
Alexandre Julliard18d02972002-12-03 23:34:52 +0000233
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100234extern BOOL CLIPBOARD_ReleaseOwner(void) DECLSPEC_HIDDEN;
235extern BOOL FOCUS_MouseActivate( HWND hwnd ) DECLSPEC_HIDDEN;
236extern BOOL HOOK_IsHooked( INT id ) DECLSPEC_HIDDEN;
237extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
238extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
239extern BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
Alexandre Julliard6b4c02e2005-04-27 10:23:24 +0000240extern LRESULT MSG_SendInternalMessageTimeout( DWORD dest_pid, DWORD dest_tid,
241 UINT msg, WPARAM wparam, LPARAM lparam,
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100242 UINT flags, UINT timeout, PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN;
243extern HPEN SYSCOLOR_GetPen( INT index ) DECLSPEC_HIDDEN;
244extern void SYSPARAMS_Init(void) DECLSPEC_HIDDEN;
245extern void USER_CheckNotLock(void) DECLSPEC_HIDDEN;
246extern BOOL USER_IsExitingThread( DWORD tid ) DECLSPEC_HIDDEN;
Mike McCormack096524c2001-12-26 19:46:40 +0000247
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100248extern BOOL USER_SetWindowPos( WINDOWPOS * winpos ) DECLSPEC_HIDDEN;
Pierre d'Herbemonte5e58a62006-11-26 23:21:02 +0100249
Alexandre Julliardd00d54e2007-08-07 21:01:55 +0200250typedef LRESULT (*winproc_callback_t)( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
251 LRESULT *result, void *arg );
252typedef LRESULT (*winproc_callback16_t)( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPARAM lp,
253 LRESULT *result, void *arg );
254
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100255extern WNDPROC16 WINPROC_GetProc16( WNDPROC proc, BOOL unicode ) DECLSPEC_HIDDEN;
256extern WNDPROC WINPROC_AllocProc16( WNDPROC16 func ) DECLSPEC_HIDDEN;
257extern WNDPROC WINPROC_GetProc( WNDPROC proc, BOOL unicode ) DECLSPEC_HIDDEN;
258extern WNDPROC WINPROC_AllocProc( WNDPROC funcA, WNDPROC funcW ) DECLSPEC_HIDDEN;
259extern BOOL WINPROC_IsUnicode( WNDPROC proc, BOOL def_val ) DECLSPEC_HIDDEN;
Alexandre Julliardd00d54e2007-08-07 21:01:55 +0200260
261extern LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg,
Alexandre Julliard82964f52007-08-08 18:25:38 +0200262 WPARAM wParam, LPARAM lParam, LRESULT *result, void *arg,
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100263 enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
Alexandre Julliardd00d54e2007-08-07 21:01:55 +0200264extern LRESULT WINPROC_CallProc16To32A( winproc_callback_t callback, HWND16 hwnd, UINT16 msg,
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100265 WPARAM16 wParam, LPARAM lParam, LRESULT *result, void *arg ) DECLSPEC_HIDDEN;
Alexandre Julliardd00d54e2007-08-07 21:01:55 +0200266extern LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT msg,
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100267 WPARAM wParam, LPARAM lParam, LRESULT *result, void *arg ) DECLSPEC_HIDDEN;
Alexandre Julliardd00d54e2007-08-07 21:01:55 +0200268
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100269extern INT_PTR WINPROC_CallDlgProc16( DLGPROC16 func, HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
270extern INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
271extern INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
Alexandre Julliard334ede42007-08-08 17:02:42 +0200272extern BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100273 LRESULT *result, BOOL unicode, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
Alexandre Julliardd00d54e2007-08-07 21:01:55 +0200274
Alexandre Julliard6b4c02e2005-04-27 10:23:24 +0000275/* message spy definitions */
276
277#define SPY_DISPATCHMESSAGE16 0x0100
278#define SPY_DISPATCHMESSAGE 0x0101
279#define SPY_SENDMESSAGE16 0x0102
280#define SPY_SENDMESSAGE 0x0103
281#define SPY_DEFWNDPROC16 0x0104
282#define SPY_DEFWNDPROC 0x0105
283
284#define SPY_RESULT_OK16 0x0000
285#define SPY_RESULT_OK 0x0001
286#define SPY_RESULT_INVALIDHWND16 0x0002
287#define SPY_RESULT_INVALIDHWND 0x0003
288#define SPY_RESULT_DEFWND16 0x0004
289#define SPY_RESULT_DEFWND 0x0005
290
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100291extern const char *SPY_GetClassLongOffsetName( INT offset ) DECLSPEC_HIDDEN;
292extern const char *SPY_GetMsgName( UINT msg, HWND hWnd ) DECLSPEC_HIDDEN;
293extern const char *SPY_GetVKeyName(WPARAM wParam) DECLSPEC_HIDDEN;
294extern void SPY_EnterMessage( INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
Alexandre Julliard6b4c02e2005-04-27 10:23:24 +0000295extern void SPY_ExitMessage( INT iFlag, HWND hwnd, UINT msg,
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100296 LRESULT lReturn, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
297extern int SPY_Init(void) DECLSPEC_HIDDEN;
Alexandre Julliard6b4c02e2005-04-27 10:23:24 +0000298
Michael Stefaniuc4a75c5c2002-08-28 00:39:39 +0000299/* HANDLE16 <-> HANDLE conversions */
Alexandre Julliarda8a422f2002-11-22 20:43:01 +0000300#define HCURSOR_16(h32) (LOWORD(h32))
301#define HICON_16(h32) (LOWORD(h32))
302#define HINSTANCE_16(h32) (LOWORD(h32))
Michael Stefaniucbc54d782002-10-10 21:22:09 +0000303
Alexandre Julliarda8a422f2002-11-22 20:43:01 +0000304#define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
305#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
306#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
307#define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
Michael Stefaniuc4a75c5c2002-08-28 00:39:39 +0000308
Alexandre Julliarddac19762005-07-20 10:31:37 +0000309#include "pshpack1.h"
310
311typedef struct
312{
313 BYTE bWidth;
314 BYTE bHeight;
315 BYTE bColorCount;
316 BYTE bReserved;
317} ICONRESDIR;
318
319typedef struct
320{
321 WORD wWidth;
322 WORD wHeight;
323} CURSORDIR;
324
325typedef struct
326{ union
327 { ICONRESDIR icon;
328 CURSORDIR cursor;
329 } ResInfo;
330 WORD wPlanes;
331 WORD wBitCount;
332 DWORD dwBytesInRes;
333 WORD wResId;
334} CURSORICONDIRENTRY;
335
336typedef struct
337{
338 WORD idReserved;
339 WORD idType;
340 WORD idCount;
341 CURSORICONDIRENTRY idEntries[1];
342} CURSORICONDIR;
343
344#include "poppack.h"
345
Alexandre Julliardc57b5052007-11-07 18:05:49 +0100346extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule ) DECLSPEC_HIDDEN;
Alexandre Julliarddac19762005-07-20 10:31:37 +0000347
Alexandre Julliard6a78c162004-12-08 18:06:14 +0000348#endif /* __WINE_USER_PRIVATE_H */