4 * Copyright 1993 Alexandre Julliard
13 #define WND_MAGIC 0x444e4957 /* 'WIND' */
15 /* Built-in class names (see _Undocumented_Windows_ p.418) */
16 #define POPUPMENU_CLASS_NAME "#32768" /* PopupMenu */
17 #define DESKTOP_CLASS_NAME "#32769" /* Desktop */
18 #define DIALOG_CLASS_NAME "#32770" /* Dialog */
19 #define WINSWITCH_CLASS_NAME "#32771" /* WinSwitch */
20 #define ICONTITLE_CLASS_NAME "#32772" /* IconTitle */
22 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
23 #define DESKTOP_CLASS_ATOM ((ATOM)32769) /* Desktop */
24 #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
25 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
26 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
28 /* Built-in 32-bit classes */
46 /* PAINT_RedrawWindow() control flags */
47 #define RDW_EX_USEHRGN 0x0001
48 #define RDW_EX_DELETEHRGN 0x0002
49 #define RDW_EX_XYWINDOW 0x0004
50 #define RDW_EX_TOPFRAME 0x0010
59 struct tagWND *next; /* Next sibling */
60 struct tagWND *child; /* First child */
61 struct tagWND *parent; /* Window parent (from CreateWindow) */
62 struct tagWND *owner; /* Window owner */
63 struct tagCLASS *class; /* Window class */
64 HWINDOWPROC winproc; /* Window procedure */
65 DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
66 HWND hwndSelf; /* Handle of this window */
67 HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */
68 RECT rectClient; /* Client area rel. to parent client area */
69 RECT rectWindow; /* Whole window rel. to parent client area */
70 LPSTR text; /* Window text */
71 void *pVScroll; /* Vertical scroll-bar info */
72 void *pHScroll; /* Horizontal scroll-bar info */
73 void *pProp; /* Pointer to properties list */
74 struct tagDCE *dce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
75 HGLOBAL16 hmemTaskQ; /* Task queue global memory handle */
76 HRGN16 hrgnUpdate; /* Update region */
77 HWND hwndLastActive;/* Last active popup hwnd */
78 DWORD dwStyle; /* Window style (from CreateWindow) */
79 DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
80 UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
81 DWORD helpContext; /* Help context ID */
82 WORD flags; /* Misc. flags (see below) */
83 HMENU16 hSysMenu; /* window's copy of System Menu */
84 int irefCount; /* window's reference count*/
85 DWORD userdata; /* User private data */
86 struct tagWND_DRIVER *pDriver; /* Window driver */
87 void *pDriverData; /* Window driver data */
88 DWORD wExtra[1]; /* Window extra bytes */
93 #define HAK_BITGRAVITY 1
94 #define HAK_ACCEPTFOCUS 2
95 #define HAK_ICONICSTATE 3
100 #define BGNorthWest 1
102 #define BGNorthEast 3
106 #define BGSouthWest 7
108 #define BGSouthEast 9
111 typedef struct tagWND_DRIVER
113 void (*pInitialize)(WND *);
114 void (*pFinalize)(WND *);
115 BOOL (*pCreateDesktopWindow)(WND *, struct tagCLASS *, BOOL);
116 BOOL (*pCreateWindow)(WND *, struct tagCLASS *, CREATESTRUCTA *, BOOL);
117 BOOL (*pDestroyWindow)(WND *);
118 WND* (*pSetParent)(WND *, WND *);
119 void (*pForceWindowRaise)(WND *);
120 void (*pSetWindowPos)(WND *, const WINDOWPOS *, BOOL);
121 void (*pSetText)(WND *, LPCSTR);
122 void (*pSetFocus)(WND *);
123 void (*pPreSizeMove)(WND *);
124 void (*pPostSizeMove)(WND *);
125 void (*pSurfaceCopy)(WND *, struct tagDC *, INT, INT, const RECT *, BOOL);
126 void (*pSetDrawable)(WND *, struct tagDC *, WORD, BOOL);
127 BOOL (*pSetHostAttr)(WND *, INT haKey, INT value);
128 BOOL (*pIsSelfClipping)(WND *);
131 extern WND_DRIVER *WND_Driver;
138 HWND16 hwndIconTitle;
139 } INTERNALPOS, *LPINTERNALPOS;
141 /* WND flags values */
142 #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
143 #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
144 #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
145 #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
146 #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
147 #define WIN_NATIVE 0x0020 /* Directly mapped to the window provided by the driver */
148 #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
149 #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
150 #define WIN_MANAGED 0x0100 /* Window managed by the window system */
151 #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
152 #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
154 /* BuildWinArray() flags */
155 #define BWA_SKIPDISABLED 0x0001
156 #define BWA_SKIPHIDDEN 0x0002
157 #define BWA_SKIPOWNED 0x0004
158 #define BWA_SKIPICONIC 0x0008
160 /* WIN_UpdateNCRgn() flags */
161 #define UNC_CHECK 0x0001
162 #define UNC_ENTIRE 0x0002
163 #define UNC_REGION 0x0004
164 #define UNC_UPDATE 0x0008
166 /* Window functions */
167 extern void WIN_Init( void );
168 extern void WIN_LockWnds();
169 extern void WIN_UnlockWnds();
170 extern int WIN_SuspendWndsLock();
171 extern void WIN_RestoreWndsLock(int ipreviousLock);
172 extern WND* WIN_FindWndPtr( HWND hwnd );
173 extern WND* WIN_LockWndPtr(WND *wndPtr);
174 extern void WIN_ReleaseWndPtr(WND *wndPtr);
175 extern void WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
176 extern WND* WIN_GetDesktop(void);
177 extern void WIN_ReleaseDesktop(void);
178 extern void WIN_DumpWindow( HWND hwnd );
179 extern void WIN_WalkWindows( HWND hwnd, int indent );
180 extern BOOL WIN_UnlinkWindow( HWND hwnd );
181 extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
182 extern HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE16 hQueue );
183 extern BOOL WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
184 extern BOOL WIN_CreateDesktopWindow(void);
185 extern HWND WIN_GetTopParent( HWND hwnd );
186 extern WND* WIN_GetTopParentPtr( WND* pWnd );
187 extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
188 extern WND** WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
189 extern void WIN_ReleaseWinArray(WND **wndArray);
191 extern HWND CARET_GetHwnd(void);
192 extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
194 extern BOOL16 DRAG_QueryUpdate( HWND, SEGPTR, BOOL );
195 extern void DEFWND_SetText( WND *wndPtr, LPCSTR text );
196 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT16 ctlType ); /* windows/defwnd.c */
198 extern void PROPERTY_RemoveWindowProps( WND *pWnd ); /* windows/property.c */
200 extern BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
201 HRGN hrgnUpdate, UINT flags,
202 UINT control ); /* windows/painting.c */
203 extern HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT flags); /* windows/painting.c */
205 /* controls/widgets.c */
206 extern BOOL WIDGETS_Init( void );
207 extern BOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS32 cls );
209 /* controls/icontitle.c */
210 extern HWND ICONTITLE_Create( WND* );
211 extern BOOL ICONTITLE_Init( void );
213 /* windows/focus.c */
214 extern void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND , HWND );
216 #endif /* __WINE_WIN_H */