4 * Copyright 1993 Alexandre Julliard
15 #include "wine/windef16.h"
19 #define WND_MAGIC 0x444e4957 /* 'WIND' */
23 struct tagMESSAGEQUEUE
;
27 HWND hwndSelf
; /* Handle of this window */
28 HWND parent
; /* Window parent */
29 HWND owner
; /* Window owner */
30 struct tagCLASS
*class; /* Window class */
31 HWINDOWPROC winproc
; /* Window procedure */
32 DWORD dwMagic
; /* Magic number (must be WND_MAGIC) */
33 DWORD tid
; /* Owner thread id */
34 HINSTANCE hInstance
; /* Window hInstance (from CreateWindow) */
35 RECT rectClient
; /* Client area rel. to parent client area */
36 RECT rectWindow
; /* Whole window rel. to parent client area */
37 LPWSTR text
; /* Window text */
38 void *pVScroll
; /* Vertical scroll-bar info */
39 void *pHScroll
; /* Horizontal scroll-bar info */
40 struct tagDCE
*dce
; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
41 HGLOBAL16 hmemTaskQ
; /* Task queue global memory handle */
42 HRGN hrgnUpdate
; /* Update region */
43 HRGN hrgnWnd
; /* window's region */
44 HWND hwndLastActive
;/* Last active popup hwnd */
45 DWORD dwStyle
; /* Window style (from CreateWindow) */
46 DWORD dwExStyle
; /* Extended style (from CreateWindowEx) */
47 DWORD clsStyle
; /* Class style at window creation */
48 UINT wIDmenu
; /* ID or hmenu (from CreateWindow) */
49 DWORD helpContext
; /* Help context ID */
50 UINT flags
; /* Misc. flags (see below) */
51 HMENU16 hSysMenu
; /* window's copy of System Menu */
52 int cbWndExtra
; /* class cbWndExtra at window creation */
53 int irefCount
; /* window's reference count*/
54 DWORD userdata
; /* User private data */
55 void *pDriverData
; /* Window driver data */
56 DWORD wExtra
[1]; /* Window extra bytes */
65 } INTERNALPOS
, *LPINTERNALPOS
;
67 /* WND flags values */
68 #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
69 #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
70 #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
71 #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
72 #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
73 #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
74 #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
75 #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
76 #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
77 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
78 #define WIN_NEEDS_INTERNALSOP 0x1000 /* Window was hidden by WIN_InternalShowOwnedPopups */
80 /* Window functions */
81 extern WND
*WIN_GetPtr( HWND hwnd
);
82 extern int WIN_SuspendWndsLock( void );
83 extern void WIN_RestoreWndsLock(int ipreviousLock
);
84 extern WND
* WIN_FindWndPtr( HWND hwnd
);
85 extern void WIN_ReleaseWndPtr(WND
*wndPtr
);
86 extern HWND
WIN_Handle32( HWND16 hwnd16
);
87 extern HWND
WIN_IsCurrentProcess( HWND hwnd
);
88 extern HWND
WIN_IsCurrentThread( HWND hwnd
);
89 extern void WIN_LinkWindow( HWND hwnd
, HWND parent
, HWND hwndInsertAfter
);
90 extern void WIN_UnlinkWindow( HWND hwnd
);
91 extern void WIN_SetOwner( HWND hwnd
, HWND owner
);
92 extern LONG
WIN_SetStyle( HWND hwnd
, LONG style
);
93 extern LONG
WIN_SetExStyle( HWND hwnd
, LONG style
);
94 extern void WIN_SetRectangles( HWND hwnd
, const RECT
*rectWindow
, const RECT
*rectClient
);
95 extern BOOL
WIN_GetRectangles( HWND hwnd
, RECT
*rectWindow
, RECT
*rectClient
);
96 extern LRESULT
WIN_DestroyWindow( HWND hwnd
);
97 extern void WIN_DestroyThreadWindows( HWND hwnd
);
98 extern BOOL
WIN_CreateDesktopWindow(void);
99 extern BOOL
WIN_IsWindowDrawable( HWND hwnd
, BOOL
);
100 extern HWND
*WIN_ListParents( HWND hwnd
);
101 extern HWND
*WIN_ListChildren( HWND hwnd
);
102 extern BOOL
WIN_InternalShowOwnedPopups( HWND owner
, BOOL fShow
, BOOL unmanagedOnly
);
104 inline static HWND
WIN_GetFullHandle( HWND hwnd
)
106 if (!HIWORD(hwnd
) && hwnd
) hwnd
= WIN_Handle32( LOWORD(hwnd
) );
110 inline static HWND16
WIN_Handle16( HWND hwnd
)
115 inline static WND
*WIN_FindWndPtr16( HWND16 hwnd
)
117 /* don't bother with full conversion */
118 return WIN_FindWndPtr( (HWND
)(ULONG_PTR
)hwnd
);
121 /* to release pointers retrieved by WIN_GetPtr; do not confuse with WIN_ReleaseWndPtr!! */
122 inline static void WIN_ReleasePtr( WND
*ptr
)
127 #define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
129 extern HWND
CARET_GetHwnd(void);
130 extern void CARET_GetRect(LPRECT lprc
); /* windows/caret.c */
132 extern BOOL16
DRAG_QueryUpdate( HWND
, SEGPTR
, BOOL
);
133 extern HBRUSH
DEFWND_ControlColor( HDC hDC
, UINT ctlType
); /* windows/defwnd.c */
135 /* Classes functions */
136 struct tagCLASS
; /* opaque structure */
137 struct builtin_class_descr
;
138 extern ATOM
CLASS_RegisterBuiltinClass( const struct builtin_class_descr
*descr
);
139 extern struct tagCLASS
*CLASS_AddWindow( ATOM atom
, HINSTANCE inst
, WINDOWPROCTYPE type
,
140 INT
*winExtra
, WNDPROC
*winproc
,
141 DWORD
*style
, struct tagDCE
**dce
);
142 extern void CLASS_RemoveWindow( struct tagCLASS
*cls
);
143 extern void CLASS_FreeModuleClasses( HMODULE16 hModule
);
145 /* windows/focus.c */
146 extern void FOCUS_SwitchFocus( struct tagMESSAGEQUEUE
*pMsgQ
, HWND
, HWND
);
148 #endif /* __WINE_WIN_H */