4 * Copyright 1993 Alexandre Julliard
5 * Copyright 2022 Jacek Caban
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef __WINE_NTUSER_PRIVATE_H
23 #define __WINE_NTUSER_PRIVATE_H
26 #include "wine/list.h"
32 HANDLE (WINAPI
*pCopyImage
)( HANDLE
, UINT
, INT
, INT
, UINT
);
33 HWND (WINAPI
*pGetDesktopWindow
)(void);
34 BOOL (WINAPI
*pGetWindowRect
)( HWND hwnd
, LPRECT rect
);
35 BOOL (WINAPI
*pIsChild
)( HWND
, HWND
);
36 BOOL (WINAPI
*pRedrawWindow
)( HWND
, const RECT
*, HRGN
, UINT
);
37 LRESULT (WINAPI
*pSendMessageTimeoutW
)( HWND
, UINT
, WPARAM
, LPARAM
, UINT
, UINT
, PDWORD_PTR
);
38 HWND (WINAPI
*pWindowFromDC
)( HDC
);
39 void (WINAPI
*free_dce
)( struct dce
*dce
, HWND hwnd
);
40 LRESULT (WINAPI
*send_ll_message
)( DWORD
, DWORD
, UINT
, WPARAM
, LPARAM
, UINT
, UINT
, PDWORD_PTR
);
49 #define OBJ_OTHER_PROCESS ((void *)1) /* returned by get_user_handle_ptr on unknown handles */
51 HANDLE
alloc_user_handle( struct user_object
*ptr
, unsigned int type
) DECLSPEC_HIDDEN
;
52 void *get_user_handle_ptr( HANDLE handle
, unsigned int type
) DECLSPEC_HIDDEN
;
53 void set_user_handle_ptr( HANDLE handle
, struct user_object
*ptr
) DECLSPEC_HIDDEN
;
54 void release_user_handle_ptr( void *ptr
) DECLSPEC_HIDDEN
;
55 void *free_user_handle( HANDLE handle
, unsigned int type
) DECLSPEC_HIDDEN
;
59 struct user_object obj
; /* object header */
60 HWND parent
; /* Window parent */
61 HWND owner
; /* Window owner */
62 struct tagCLASS
*class; /* Window class */
63 struct dce
*dce
; /* DCE pointer */
64 WNDPROC winproc
; /* Window procedure */
65 DWORD tid
; /* Owner thread id */
66 HINSTANCE hInstance
; /* Window hInstance (from CreateWindow) */
67 RECT client_rect
; /* Client area rel. to parent client area */
68 RECT window_rect
; /* Whole window rel. to parent client area */
69 RECT visible_rect
; /* Visible part of the whole rect, rel. to parent client area */
70 RECT normal_rect
; /* Normal window rect saved when maximized/minimized */
71 POINT min_pos
; /* Position for minimized window */
72 POINT max_pos
; /* Position for maximized window */
73 WCHAR
*text
; /* Window text */
74 void *pScroll
; /* Scroll-bar info */
75 DWORD dwStyle
; /* Window style (from CreateWindow) */
76 DWORD dwExStyle
; /* Extended style (from CreateWindowEx) */
77 UINT_PTR wIDmenu
; /* ID or hmenu (from CreateWindow) */
78 DWORD helpContext
; /* Help context ID */
79 UINT flags
; /* Misc. flags (see below) */
80 HMENU hSysMenu
; /* window's copy of System Menu */
81 HICON hIcon
; /* window's icon */
82 HICON hIconSmall
; /* window's small icon */
83 HICON hIconSmall2
; /* window's secondary small icon, derived from hIcon */
84 UINT dpi
; /* window DPI */
85 DPI_AWARENESS dpi_awareness
; /* DPI awareness */
86 struct window_surface
*surface
; /* Window surface if any */
87 struct tagDIALOGINFO
*dlgInfo
; /* Dialog additional info (dialogs only) */
88 int pixel_format
; /* Pixel format set by the graphics driver */
89 int cbWndExtra
; /* class cbWndExtra at window creation */
90 DWORD_PTR userdata
; /* User private data */
91 DWORD wExtra
[1]; /* Window extra bytes */
94 #define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
95 #define WND_DESKTOP ((WND *)2) /* returned by WIN_GetPtr on the desktop window */
97 WND
*next_thread_window_ptr( HWND
*hwnd
);
99 /* this is the structure stored in TEB->Win32ClientInfo */
100 /* no attempt is made to keep the layout compatible with the Windows one */
101 struct user_thread_info
103 HANDLE server_queue
; /* Handle to server-side queue */
104 DWORD wake_mask
; /* Current queue wake mask */
105 DWORD changed_mask
; /* Current queue changed mask */
106 WORD recursion_count
; /* SendMessage recursion counter */
107 WORD message_count
; /* Get/PeekMessage loop counter */
108 WORD hook_call_depth
; /* Number of recursively called hook procs */
109 WORD hook_unicode
; /* Is current hook unicode? */
110 HHOOK hook
; /* Current hook */
111 UINT active_hooks
; /* Bitmap of active hooks */
112 DPI_AWARENESS dpi_awareness
; /* DPI awareness */
113 INPUT_MESSAGE_SOURCE msg_source
; /* Message source for current message */
114 struct received_message_info
*receive_info
; /* Message being currently received */
115 struct wm_char_mapping_data
*wmchar_data
; /* Data for WM_CHAR mappings */
116 DWORD GetMessageTimeVal
; /* Value for GetMessageTime */
117 DWORD GetMessagePosVal
; /* Value for GetMessagePos */
118 ULONG_PTR GetMessageExtraInfoVal
; /* Value for GetMessageExtraInfo */
119 struct user_key_state_info
*key_state
; /* Cache of global key state */
120 HKL kbd_layout
; /* Current keyboard layout */
121 DWORD kbd_layout_id
; /* Current keyboard layout ID */
122 HWND top_window
; /* Desktop window */
123 HWND msg_window
; /* HWND_MESSAGE parent window */
124 struct rawinput_thread_data
*rawinput
; /* RawInput thread local data / buffer */
127 C_ASSERT( sizeof(struct user_thread_info
) <= sizeof(((TEB
*)0)->Win32ClientInfo
) );
129 struct user_key_state_info
131 UINT time
; /* Time of last key state refresh */
132 INT counter
; /* Counter to invalidate the key state */
133 BYTE state
[256]; /* State for each key */
136 struct hook_extra_info
142 enum builtin_winprocs
155 /* unicode-only procs */
161 NB_BUILTIN_AW_WINPROCS
= WINPROC_DESKTOP
164 /* FIXME: make it private to class.c */
165 typedef struct tagWINDOWPROC
167 WNDPROC procA
; /* ANSI window proc */
168 WNDPROC procW
; /* Unicode window proc */
171 #define WINPROC_HANDLE (~0u >> 16)
172 #define BUILTIN_WINPROC(index) ((WNDPROC)(ULONG_PTR)((index) | (WINPROC_HANDLE << 16)))
174 #define MAX_ATOM_LEN 255
176 /* Built-in class names (see _Undocumented_Windows_ p.418) */
177 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
178 #define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
179 #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
180 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
181 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
183 typedef struct tagCLASS
185 struct list entry
; /* Entry in class list */
186 UINT style
; /* Class style */
187 BOOL local
; /* Local class? */
188 WNDPROC winproc
; /* Window procedure */
189 INT cbClsExtra
; /* Class extra bytes */
190 INT cbWndExtra
; /* Window extra bytes */
191 struct client_menu_name menu_name
; /* Default menu name */
192 struct dce
*dce
; /* Opaque pointer to class DCE */
193 UINT_PTR instance
; /* Module that created the task */
194 HICON hIcon
; /* Default icon */
195 HICON hIconSm
; /* Default small icon */
196 HICON hIconSmIntern
; /* Internal small icon, derived from hIcon */
197 HCURSOR hCursor
; /* Default cursor */
198 HBRUSH hbrBackground
; /* Default background */
199 ATOM atomName
; /* Name of the class */
200 WCHAR name
[MAX_ATOM_LEN
+ 1];
201 WCHAR
*basename
; /* Base name for redirected classes, pointer within 'name'. */
205 WNDPROC
alloc_winproc( WNDPROC func
, BOOL ansi
) DECLSPEC_HIDDEN
;
206 WINDOWPROC
*get_winproc_ptr( WNDPROC handle
) DECLSPEC_HIDDEN
;
207 DWORD
get_class_long( HWND hwnd
, INT offset
, BOOL ansi
) DECLSPEC_HIDDEN
;
208 ULONG_PTR
get_class_long_ptr( HWND hwnd
, INT offset
, BOOL ansi
) DECLSPEC_HIDDEN
;
209 WORD
get_class_word( HWND hwnd
, INT offset
) DECLSPEC_HIDDEN
;
212 HICON
alloc_cursoricon_handle( BOOL is_icon
) DECLSPEC_HIDDEN
;
215 LRESULT
handle_internal_message( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
218 HANDLE
alloc_user_handle( struct user_object
*ptr
, unsigned int type
) DECLSPEC_HIDDEN
;
219 void *free_user_handle( HANDLE handle
, unsigned int type
) DECLSPEC_HIDDEN
;
220 void *get_user_handle_ptr( HANDLE handle
, unsigned int type
) DECLSPEC_HIDDEN
;
221 void release_user_handle_ptr( void *ptr
) DECLSPEC_HIDDEN
;
223 WND
*get_win_ptr( HWND hwnd
) DECLSPEC_HIDDEN
;
224 BOOL
is_window( HWND hwnd
) DECLSPEC_HIDDEN
;
226 #endif /* __WINE_NTUSER_PRIVATE_H */