4 * Copyright 1993 Alexandre Julliard
15 #include "wine/windef16.h"
17 #define WND_MAGIC 0x444e4957 /* 'WIND' */
19 /* PAINT_RedrawWindow() control flags */
20 #define RDW_EX_USEHRGN 0x0001
21 #define RDW_EX_DELETEHRGN 0x0002
22 #define RDW_EX_XYWINDOW 0x0004
23 #define RDW_EX_TOPFRAME 0x0010
24 #define RDW_EX_DELAY_NCPAINT 0x0020
28 struct tagMESSAGEQUEUE
;
33 struct tagWND
*next
; /* Next sibling */
34 struct tagWND
*child
; /* First child */
35 struct tagWND
*parent
; /* Window parent (from CreateWindow) */
36 struct tagWND
*owner
; /* Window owner */
37 struct tagCLASS
*class; /* Window class */
38 HWINDOWPROC winproc
; /* Window procedure */
39 DWORD dwMagic
; /* Magic number (must be WND_MAGIC) */
40 HWND hwndSelf
; /* Handle of this window */
41 HINSTANCE hInstance
; /* Window hInstance (from CreateWindow) */
42 RECT rectClient
; /* Client area rel. to parent client area */
43 RECT rectWindow
; /* Whole window rel. to parent client area */
44 LPWSTR text
; /* Window text */
45 void *pVScroll
; /* Vertical scroll-bar info */
46 void *pHScroll
; /* Horizontal scroll-bar info */
47 void *pProp
; /* Pointer to properties list */
48 struct tagDCE
*dce
; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
49 HGLOBAL16 hmemTaskQ
; /* Task queue global memory handle */
50 HRGN16 hrgnUpdate
; /* Update region */
51 HRGN hrgnWnd
; /* window's region */
52 HWND hwndLastActive
;/* Last active popup hwnd */
53 DWORD dwStyle
; /* Window style (from CreateWindow) */
54 DWORD dwExStyle
; /* Extended style (from CreateWindowEx) */
55 DWORD clsStyle
; /* Class style at window creation */
56 UINT wIDmenu
; /* ID or hmenu (from CreateWindow) */
57 DWORD helpContext
; /* Help context ID */
58 WORD flags
; /* Misc. flags (see below) */
59 HMENU16 hSysMenu
; /* window's copy of System Menu */
60 int cbWndExtra
; /* class cbWndExtra at window creation */
61 int irefCount
; /* window's reference count*/
62 DWORD userdata
; /* User private data */
63 struct tagWND_DRIVER
*pDriver
; /* Window driver */
64 void *pDriverData
; /* Window driver data */
65 DWORD wExtra
[1]; /* Window extra bytes */
69 #define HAK_ICONICSTATE 3
71 typedef struct tagWND_DRIVER
73 void (*pForceWindowRaise
)(WND
*);
74 void (*pSurfaceCopy
)(WND
*, HDC
, INT
, INT
, const RECT
*, BOOL
);
75 BOOL (*pSetHostAttr
)(WND
*, INT haKey
, INT value
);
78 extern WND_DRIVER
*WND_Driver
;
86 } INTERNALPOS
, *LPINTERNALPOS
;
88 /* WND flags values */
89 #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
90 #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
91 #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
92 #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
93 #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
94 #define WIN_NATIVE 0x0020 /* Directly mapped to the window provided by the driver */
95 #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
96 #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
97 #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
98 #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
99 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
100 #define WIN_NEEDS_INTERNALSOP 0x1000 /* Window was hidden by WIN_InternalShowOwnedPopups */
102 /* BuildWinArray() flags */
103 #define BWA_SKIPDISABLED 0x0001
104 #define BWA_SKIPHIDDEN 0x0002
105 #define BWA_SKIPOWNED 0x0004
106 #define BWA_SKIPICONIC 0x0008
108 /* WIN_UpdateNCRgn() flags */
109 #define UNC_CHECK 0x0001
110 #define UNC_ENTIRE 0x0002
111 #define UNC_REGION 0x0004
112 #define UNC_UPDATE 0x0008
113 #define UNC_DELAY_NCPAINT 0x0010
114 #define UNC_IN_BEGINPAINT 0x0020
116 /* Window functions */
117 extern void WIN_LockWnds( void );
118 extern void WIN_UnlockWnds( void );
119 extern int WIN_SuspendWndsLock( void );
120 extern void WIN_RestoreWndsLock(int ipreviousLock
);
121 extern WND
* WIN_FindWndPtr( HWND hwnd
);
122 extern WND
* WIN_LockWndPtr(WND
*wndPtr
);
123 extern void WIN_ReleaseWndPtr(WND
*wndPtr
);
124 extern void WIN_UpdateWndPtr(WND
**oldPtr
,WND
*newPtr
);
125 extern WND
* WIN_GetDesktop(void);
126 extern void WIN_ReleaseDesktop(void);
127 extern void WIN_DumpWindow( HWND hwnd
);
128 extern void WIN_WalkWindows( HWND hwnd
, int indent
);
129 extern BOOL
WIN_UnlinkWindow( HWND hwnd
);
130 extern BOOL
WIN_LinkWindow( HWND hwnd
, HWND hwndInsertAfter
);
131 extern HWND
WIN_FindWinToRepaint( HWND hwnd
, HQUEUE16 hQueue
);
132 extern BOOL
WIN_ResetQueueWindows( WND
* wnd
, HQUEUE16 hQueue
, HQUEUE16 hNew
);
133 extern BOOL
WIN_CreateDesktopWindow(void);
134 extern HWND
WIN_GetTopParent( HWND hwnd
);
135 extern WND
* WIN_GetTopParentPtr( WND
* pWnd
);
136 extern BOOL
WIN_IsWindowDrawable(WND
*, BOOL
);
137 extern WND
** WIN_BuildWinArray( WND
*wndPtr
, UINT bwa
, UINT
* pnum
);
138 extern void WIN_ReleaseWinArray(WND
**wndArray
);
139 extern BOOL
WIN_InternalShowOwnedPopups( HWND owner
, BOOL fShow
, BOOL unmanagedOnly
);
141 extern HICON16
NC_IconForWindow( WND
*wndPtr
);
143 extern HWND
CARET_GetHwnd(void);
144 extern void CARET_GetRect(LPRECT lprc
); /* windows/caret.c */
146 extern BOOL16
DRAG_QueryUpdate( HWND
, SEGPTR
, BOOL
);
147 extern void DEFWND_SetTextA( WND
*wndPtr
, LPCSTR text
);
148 extern void DEFWND_SetTextW( WND
*wndPtr
, LPCWSTR text
);
149 extern HBRUSH
DEFWND_ControlColor( HDC hDC
, UINT ctlType
); /* windows/defwnd.c */
151 extern void PROPERTY_RemoveWindowProps( WND
*pWnd
); /* windows/property.c */
153 extern BOOL
PAINT_RedrawWindow( HWND hwnd
, const RECT
*rectUpdate
,
154 HRGN hrgnUpdate
, UINT flags
,
155 UINT control
); /* windows/painting.c */
156 extern HRGN
WIN_UpdateNCRgn(WND
* wnd
, HRGN hRgn
, UINT flags
); /* windows/painting.c */
158 /* Classes functions */
159 struct tagCLASS
; /* opaque structure */
160 struct builtin_class_descr
;
161 extern ATOM
CLASS_RegisterBuiltinClass( const struct builtin_class_descr
*descr
);
162 extern struct tagCLASS
*CLASS_AddWindow( ATOM atom
, HINSTANCE inst
, WINDOWPROCTYPE type
,
163 INT
*winExtra
, WNDPROC
*winproc
,
164 DWORD
*style
, struct tagDCE
**dce
);
165 extern void CLASS_RemoveWindow( struct tagCLASS
*cls
);
166 extern void CLASS_FreeModuleClasses( HMODULE16 hModule
);
168 /* windows/focus.c */
169 extern void FOCUS_SwitchFocus( struct tagMESSAGEQUEUE
*pMsgQ
, HWND
, HWND
);
171 /* generic method that returns TRUE if the window properties ask for a
172 window manager type of border */
173 extern BOOL
WIN_WindowNeedsWMBorder( DWORD style
, DWORD exStyle
);
175 #endif /* __WINE_WIN_H */