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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "wine/windef16.h"
32 #define WND_MAGIC 0x444e4957 /* 'WIND' */
36 struct tagMESSAGEQUEUE;
40 HWND hwndSelf; /* Handle of this window */
41 HWND parent; /* Window parent */
42 HWND owner; /* Window owner */
43 struct tagCLASS *class; /* Window class */
44 WNDPROC winproc; /* Window procedure */
45 DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
46 DWORD tid; /* Owner thread id */
47 HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */
48 RECT rectClient; /* Client area rel. to parent client area */
49 RECT rectWindow; /* Whole window rel. to parent client area */
50 LPWSTR text; /* Window text */
51 void *pVScroll; /* Vertical scroll-bar info */
52 void *pHScroll; /* Horizontal scroll-bar info */
53 struct tagDCE *dce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
54 HRGN hrgnUpdate; /* Update region */
55 HRGN hrgnWnd; /* window's region */
56 DWORD dwStyle; /* Window style (from CreateWindow) */
57 DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
58 DWORD clsStyle; /* Class style at window creation */
59 UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
60 DWORD helpContext; /* Help context ID */
61 UINT flags; /* Misc. flags (see below) */
62 HMENU hSysMenu; /* window's copy of System Menu */
63 int cbWndExtra; /* class cbWndExtra at window creation */
64 int irefCount; /* window's reference count*/
65 DWORD userdata; /* User private data */
66 void *pDriverData; /* Window driver data */
67 DWORD wExtra[1]; /* Window extra bytes */
76 } INTERNALPOS, *LPINTERNALPOS;
78 /* WND flags values */
79 #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
80 #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
81 #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
82 #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
83 #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
84 #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
85 #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
86 #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
87 #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
88 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
89 #define WIN_NEEDS_INTERNALSOP 0x1000 /* Window was hidden by WIN_InternalShowOwnedPopups */
91 /* Window functions */
92 extern WND *WIN_GetPtr( HWND hwnd );
93 extern int WIN_SuspendWndsLock( void );
94 extern void WIN_RestoreWndsLock(int ipreviousLock);
95 extern WND* WIN_FindWndPtr( HWND hwnd );
96 extern void WIN_ReleaseWndPtr(WND *wndPtr);
97 extern HWND WIN_Handle32( HWND16 hwnd16 );
98 extern HWND WIN_IsCurrentProcess( HWND hwnd );
99 extern HWND WIN_IsCurrentThread( HWND hwnd );
100 extern void WIN_LinkWindow( HWND hwnd, HWND parent, HWND hwndInsertAfter );
101 extern void WIN_UnlinkWindow( HWND hwnd );
102 extern HWND WIN_SetOwner( HWND hwnd, HWND owner );
103 extern LONG WIN_SetStyle( HWND hwnd, LONG style );
104 extern LONG WIN_SetExStyle( HWND hwnd, LONG style );
105 extern void WIN_SetRectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient );
106 extern BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient );
107 extern LRESULT WIN_DestroyWindow( HWND hwnd );
108 extern void WIN_DestroyThreadWindows( HWND hwnd );
109 extern BOOL WIN_CreateDesktopWindow(void);
110 extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL );
111 extern HWND *WIN_ListParents( HWND hwnd );
112 extern HWND *WIN_ListChildren( HWND hwnd );
113 extern BOOL WIN_InternalShowOwnedPopups( HWND owner, BOOL fShow, BOOL unmanagedOnly );
115 inline static HWND WIN_GetFullHandle( HWND hwnd )
117 if (!HIWORD(hwnd) && hwnd) hwnd = WIN_Handle32( LOWORD(hwnd) );
121 inline static WND *WIN_FindWndPtr16( HWND16 hwnd )
123 /* don't bother with full conversion */
124 return WIN_FindWndPtr( (HWND)(ULONG_PTR)hwnd );
127 /* to release pointers retrieved by WIN_GetPtr; do not confuse with WIN_ReleaseWndPtr!! */
128 inline static void WIN_ReleasePtr( WND *ptr )
133 #define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
135 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ); /* windows/defwnd.c */
137 extern BOOL FOCUS_MouseActivate( HWND hwnd );
139 #endif /* __WINE_WIN_H */