4 * Copyright 1993 Alexandre Julliard
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.
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.
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
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "user_private.h"
31 #include "wine/server_protocol.h"
38 struct user_object obj
; /* object header */
39 HWND parent
; /* Window parent */
40 HWND owner
; /* Window owner */
41 struct tagCLASS
*class; /* Window class */
42 struct dce
*dce
; /* DCE pointer */
43 WNDPROC winproc
; /* Window procedure */
44 DWORD tid
; /* Owner thread id */
45 HINSTANCE hInstance
; /* Window hInstance (from CreateWindow) */
46 RECT client_rect
; /* Client area rel. to parent client area */
47 RECT window_rect
; /* Whole window rel. to parent client area */
48 RECT visible_rect
; /* Visible part of the whole rect, rel. to parent client area */
49 RECT normal_rect
; /* Normal window rect saved when maximized/minimized */
50 POINT min_pos
; /* Position for minimized window */
51 POINT max_pos
; /* Position for maximized window */
52 HWND icon_title
; /* Icon title window */
53 LPWSTR text
; /* Window text */
54 void *pScroll
; /* Scroll-bar info */
55 DWORD dwStyle
; /* Window style (from CreateWindow) */
56 DWORD dwExStyle
; /* Extended style (from CreateWindowEx) */
57 UINT_PTR wIDmenu
; /* ID or hmenu (from CreateWindow) */
58 DWORD helpContext
; /* Help context ID */
59 UINT flags
; /* Misc. flags (see below) */
60 HMENU hSysMenu
; /* window's copy of System Menu */
61 HICON hIcon
; /* window's icon */
62 HICON hIconSmall
; /* window's small icon */
63 HICON hIconSmall2
; /* window's secondary small icon, derived from hIcon */
64 UINT dpi
; /* window DPI */
65 DPI_AWARENESS dpi_awareness
; /* DPI awareness */
66 struct window_surface
*surface
; /* Window surface if any */
67 struct tagDIALOGINFO
*dlgInfo
;/* Dialog additional info (dialogs only) */
68 int pixel_format
; /* Pixel format set by the graphics driver */
69 int cbWndExtra
; /* class cbWndExtra at window creation */
70 DWORD_PTR userdata
; /* User private data */
71 DWORD wExtra
[1]; /* Window extra bytes */
74 /* WND flags values */
75 #define WIN_RESTORE_MAX 0x0001 /* Maximize when restoring */
76 #define WIN_NEED_SIZE 0x0002 /* Internal WM_SIZE is needed */
77 #define WIN_NCACTIVATED 0x0004 /* last WM_NCACTIVATE was positive */
78 #define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */
79 #define WIN_ISUNICODE 0x0010 /* Window is Unicode */
80 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
81 #define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */
82 #define WIN_HAS_IME_WIN 0x0080 /* the window has been registered with imm32 */
84 /* Window functions */
85 extern HWND
get_hwnd_message_parent(void) DECLSPEC_HIDDEN
;
86 extern BOOL
is_desktop_window( HWND hwnd
) DECLSPEC_HIDDEN
;
87 extern struct window_surface dummy_surface DECLSPEC_HIDDEN
;
88 extern void register_window_surface( struct window_surface
*old
, struct window_surface
*new ) DECLSPEC_HIDDEN
;
89 extern void flush_window_surfaces( BOOL idle
) DECLSPEC_HIDDEN
;
90 extern WND
*WIN_GetPtr( HWND hwnd
) DECLSPEC_HIDDEN
;
91 extern HWND
WIN_GetFullHandle( HWND hwnd
) DECLSPEC_HIDDEN
;
92 extern HWND
WIN_IsCurrentProcess( HWND hwnd
) DECLSPEC_HIDDEN
;
93 extern HWND
WIN_IsCurrentThread( HWND hwnd
) DECLSPEC_HIDDEN
;
94 extern UINT
win_set_flags( HWND hwnd
, UINT set_mask
, UINT clear_mask
) DECLSPEC_HIDDEN
;
95 extern HWND
WIN_SetOwner( HWND hwnd
, HWND owner
) DECLSPEC_HIDDEN
;
96 extern ULONG
WIN_SetStyle( HWND hwnd
, ULONG set_bits
, ULONG clear_bits
) DECLSPEC_HIDDEN
;
97 extern BOOL
WIN_GetRectangles( HWND hwnd
, enum coords_relative relative
, RECT
*rectWindow
, RECT
*rectClient
) DECLSPEC_HIDDEN
;
98 extern void map_window_region( HWND from
, HWND to
, HRGN hrgn
) DECLSPEC_HIDDEN
;
99 extern LRESULT
WIN_DestroyWindow( HWND hwnd
) DECLSPEC_HIDDEN
;
100 extern void destroy_thread_windows(void) DECLSPEC_HIDDEN
;
101 extern HWND
WIN_CreateWindowEx( CREATESTRUCTW
*cs
, LPCWSTR className
, HINSTANCE module
, BOOL unicode
) DECLSPEC_HIDDEN
;
102 extern BOOL
WIN_IsWindowDrawable( HWND hwnd
, BOOL
) DECLSPEC_HIDDEN
;
103 extern HWND
*WIN_ListChildren( HWND hwnd
) DECLSPEC_HIDDEN
;
104 extern LONG_PTR
WIN_SetWindowLong( HWND hwnd
, INT offset
, UINT size
, LONG_PTR newval
, BOOL unicode
) DECLSPEC_HIDDEN
;
105 extern void MDI_CalcDefaultChildPos( HWND hwndClient
, INT total
, LPPOINT lpPos
, INT delta
, UINT
*id
) DECLSPEC_HIDDEN
;
106 extern HDESK
open_winstation_desktop( HWINSTA hwinsta
, LPCWSTR name
, DWORD flags
, BOOL inherit
, ACCESS_MASK access
) DECLSPEC_HIDDEN
;
109 extern void USER_Lock(void) DECLSPEC_HIDDEN
;
110 extern void USER_Unlock(void) DECLSPEC_HIDDEN
;
112 /* to release pointers retrieved by WIN_GetPtr */
113 static inline void WIN_ReleasePtr( WND
*ptr
)
118 #define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
119 #define WND_DESKTOP ((WND *)2) /* returned by WIN_GetPtr on the desktop window */
121 extern LRESULT
HOOK_CallHooks( INT id
, INT code
, WPARAM wparam
, LPARAM lparam
, BOOL unicode
) DECLSPEC_HIDDEN
;
123 extern BOOL
WINPOS_RedrawIconTitle( HWND hWnd
) DECLSPEC_HIDDEN
;
124 extern MINMAXINFO
WINPOS_GetMinMaxInfo( HWND hwnd
) DECLSPEC_HIDDEN
;
125 extern LONG
WINPOS_HandleWindowPosChanging(HWND hwnd
, WINDOWPOS
*winpos
) DECLSPEC_HIDDEN
;
126 extern HWND
WINPOS_WindowFromPoint( HWND hwndScope
, POINT pt
, INT
*hittest
) DECLSPEC_HIDDEN
;
127 extern void WINPOS_ActivateOtherWindow( HWND hwnd
) DECLSPEC_HIDDEN
;
128 extern UINT
WINPOS_MinMaximize( HWND hwnd
, UINT cmd
, LPRECT rect
) DECLSPEC_HIDDEN
;
129 extern void WINPOS_SysCommandSizeMove( HWND hwnd
, WPARAM wParam
) DECLSPEC_HIDDEN
;
131 extern UINT
get_monitor_dpi( HMONITOR monitor
) DECLSPEC_HIDDEN
;
132 extern UINT
get_win_monitor_dpi( HWND hwnd
) DECLSPEC_HIDDEN
;
133 extern UINT
get_thread_dpi(void) DECLSPEC_HIDDEN
;
134 extern POINT
map_dpi_point( POINT pt
, UINT dpi_from
, UINT dpi_to
) DECLSPEC_HIDDEN
;
135 extern POINT
point_win_to_phys_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
136 extern POINT
point_phys_to_win_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
137 extern POINT
point_win_to_thread_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
138 extern POINT
point_thread_to_win_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
139 extern RECT
map_dpi_rect( RECT rect
, UINT dpi_from
, UINT dpi_to
) DECLSPEC_HIDDEN
;
140 extern RECT
rect_win_to_thread_dpi( HWND hwnd
, RECT rect
) DECLSPEC_HIDDEN
;
141 extern RECT
rect_thread_to_win_dpi( HWND hwnd
, RECT rect
) DECLSPEC_HIDDEN
;
143 extern BOOL
set_window_pos( HWND hwnd
, HWND insert_after
, UINT swp_flags
,
144 const RECT
*window_rect
, const RECT
*client_rect
,
145 const RECT
*valid_rects
) DECLSPEC_HIDDEN
;
147 static inline void mirror_rect( const RECT
*window_rect
, RECT
*rect
)
149 int width
= window_rect
->right
- window_rect
->left
;
150 int tmp
= rect
->left
;
151 rect
->left
= width
- rect
->right
;
152 rect
->right
= width
- tmp
;
155 static inline UINT
win_get_flags( HWND hwnd
)
157 return win_set_flags( hwnd
, 0, 0 );
160 #endif /* __WINE_WIN_H */