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
29 #include <wine/windef16.h>
31 #define WND_MAGIC 0x444e4957 /* 'WIND' */
37 HWND hwndSelf
; /* Handle of this window */
38 HWND parent
; /* Window parent */
39 HWND owner
; /* Window owner */
40 struct tagCLASS
*class; /* Window class */
41 struct dce
*dce
; /* DCE pointer */
42 WNDPROC winproc
; /* Window procedure */
43 DWORD dwMagic
; /* Magic number (must be WND_MAGIC) */
44 DWORD tid
; /* Owner thread id */
45 HINSTANCE hInstance
; /* Window hInstance (from CreateWindow) */
46 RECT rectClient
; /* Client area rel. to parent client area */
47 RECT rectWindow
; /* Whole window rel. to parent client area */
48 RECT normal_rect
; /* Normal window rect saved when maximized/minimized */
49 POINT min_pos
; /* Position for minimized window */
50 POINT max_pos
; /* Position for maximized window */
51 HWND icon_title
; /* Icon title window */
52 LPWSTR text
; /* Window text */
53 void *pVScroll
; /* Vertical scroll-bar info */
54 void *pHScroll
; /* Horizontal 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 int cbWndExtra
; /* class cbWndExtra at window creation */
64 DWORD_PTR userdata
; /* User private data */
65 DWORD wExtra
[1]; /* Window extra bytes */
68 /* WND flags values */
69 #define WIN_RESTORE_MAX 0x0001 /* Maximize when restoring */
70 #define WIN_NEED_SIZE 0x0002 /* Internal WM_SIZE is needed */
71 #define WIN_NCACTIVATED 0x0004 /* last WM_NCACTIVATE was positive */
72 #define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */
73 #define WIN_ISDIALOG 0x0010 /* Window is a dialog */
74 #define WIN_ISWIN32 0x0020 /* Understands Win32 messages */
75 #define WIN_ISUNICODE 0x0040 /* Window is Unicode */
76 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0080 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
78 /* Window functions */
79 extern HWND
get_hwnd_message_parent(void) DECLSPEC_HIDDEN
;
80 extern BOOL
is_desktop_window( HWND hwnd
) DECLSPEC_HIDDEN
;
81 extern WND
*WIN_GetPtr( HWND hwnd
) DECLSPEC_HIDDEN
;
82 extern HWND
WIN_Handle32( HWND16 hwnd16
) DECLSPEC_HIDDEN
;
83 extern HWND
WIN_IsCurrentProcess( HWND hwnd
) DECLSPEC_HIDDEN
;
84 extern HWND
WIN_IsCurrentThread( HWND hwnd
) DECLSPEC_HIDDEN
;
85 extern HWND
WIN_SetOwner( HWND hwnd
, HWND owner
) DECLSPEC_HIDDEN
;
86 extern ULONG
WIN_SetStyle( HWND hwnd
, ULONG set_bits
, ULONG clear_bits
) DECLSPEC_HIDDEN
;
87 extern BOOL
WIN_GetRectangles( HWND hwnd
, RECT
*rectWindow
, RECT
*rectClient
) DECLSPEC_HIDDEN
;
88 extern LRESULT
WIN_DestroyWindow( HWND hwnd
) DECLSPEC_HIDDEN
;
89 extern void WIN_DestroyThreadWindows( HWND hwnd
) DECLSPEC_HIDDEN
;
90 extern BOOL
WIN_IsWindowDrawable( HWND hwnd
, BOOL
) DECLSPEC_HIDDEN
;
91 extern HWND
*WIN_ListChildren( HWND hwnd
) DECLSPEC_HIDDEN
;
92 extern LONG_PTR
WIN_SetWindowLong( HWND hwnd
, INT offset
, UINT size
, LONG_PTR newval
, BOOL unicode
) DECLSPEC_HIDDEN
;
93 extern void MDI_CalcDefaultChildPos( HWND hwndClient
, INT total
, LPPOINT lpPos
, INT delta
, UINT
*id
) DECLSPEC_HIDDEN
;
94 extern HDESK
open_winstation_desktop( HWINSTA hwinsta
, LPCWSTR name
, DWORD flags
, BOOL inherit
, ACCESS_MASK access
) DECLSPEC_HIDDEN
;
97 extern void USER_Lock(void) DECLSPEC_HIDDEN
;
98 extern void USER_Unlock(void) DECLSPEC_HIDDEN
;
100 static inline HWND
WIN_GetFullHandle( HWND hwnd
)
102 if (!HIWORD(hwnd
) && hwnd
) hwnd
= WIN_Handle32( LOWORD(hwnd
) );
106 /* to release pointers retrieved by WIN_GetPtr */
107 static inline void WIN_ReleasePtr( WND
*ptr
)
112 #define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
113 #define WND_DESKTOP ((WND *)2) /* returned by WIN_GetPtr on the desktop window */
115 extern LRESULT
HOOK_CallHooks( INT id
, INT code
, WPARAM wparam
, LPARAM lparam
, BOOL unicode
) DECLSPEC_HIDDEN
;
117 extern BOOL
WINPOS_RedrawIconTitle( HWND hWnd
) DECLSPEC_HIDDEN
;
118 extern void WINPOS_GetMinMaxInfo( HWND hwnd
, POINT
*maxSize
, POINT
*maxPos
, POINT
*minTrack
,
119 POINT
*maxTrack
) DECLSPEC_HIDDEN
;
120 extern LONG
WINPOS_HandleWindowPosChanging(HWND hwnd
, WINDOWPOS
*winpos
) DECLSPEC_HIDDEN
;
121 extern HWND
WINPOS_WindowFromPoint( HWND hwndScope
, POINT pt
, INT
*hittest
) DECLSPEC_HIDDEN
;
122 extern void WINPOS_ActivateOtherWindow( HWND hwnd
) DECLSPEC_HIDDEN
;
123 extern UINT
WINPOS_MinMaximize( HWND hwnd
, UINT cmd
, LPRECT rect
) DECLSPEC_HIDDEN
;
124 extern void WINPOS_SysCommandSizeMove( HWND hwnd
, WPARAM wParam
) DECLSPEC_HIDDEN
;
126 extern BOOL
set_window_pos( HWND hwnd
, HWND insert_after
, UINT swp_flags
,
127 const RECT
*window_rect
, const RECT
*client_rect
,
128 const RECT
*valid_rects
) DECLSPEC_HIDDEN
;
130 #endif /* __WINE_WIN_H */