GetControlBrush16: avoid potentially releasing the same pointer
[wine/multimedia.git] / include / win.h
blobc5a2616c445876e4a10665536147e22c17eb2d7b
1 /*
2 * Window definitions
4 * Copyright 1993 Alexandre Julliard
5 */
7 #ifndef __WINE_WIN_H
8 #define __WINE_WIN_H
10 #include "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winproc.h"
14 #include "winuser.h"
15 #include "wine/windef16.h"
17 #define WND_MAGIC 0x444e4957 /* 'WIND' */
19 struct tagCLASS;
20 struct tagDCE;
21 struct tagMESSAGEQUEUE;
23 typedef struct tagWND
25 struct tagWND *next; /* Next sibling */
26 struct tagWND *child; /* First child */
27 struct tagWND *parent; /* Window parent (from CreateWindow) */
28 struct tagWND *owner; /* Window owner */
29 struct tagCLASS *class; /* Window class */
30 HWINDOWPROC winproc; /* Window procedure */
31 DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
32 HWND hwndSelf; /* Handle of this window */
33 HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */
34 RECT rectClient; /* Client area rel. to parent client area */
35 RECT rectWindow; /* Whole window rel. to parent client area */
36 LPWSTR text; /* Window text */
37 void *pVScroll; /* Vertical scroll-bar info */
38 void *pHScroll; /* Horizontal scroll-bar info */
39 void *pProp; /* Pointer to properties list */
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 */
57 } WND;
59 typedef struct
61 RECT16 rectNormal;
62 POINT16 ptIconPos;
63 POINT16 ptMaxPos;
64 HWND16 hwndIconTitle;
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 /* BuildWinArray() flags */
81 #define BWA_SKIPDISABLED 0x0001
82 #define BWA_SKIPHIDDEN 0x0002
83 #define BWA_SKIPOWNED 0x0004
84 #define BWA_SKIPICONIC 0x0008
86 /* Window functions */
87 extern void WIN_LockWnds( void );
88 extern void WIN_UnlockWnds( void );
89 extern int WIN_SuspendWndsLock( void );
90 extern void WIN_RestoreWndsLock(int ipreviousLock);
91 extern WND* WIN_FindWndPtr( HWND hwnd );
92 extern WND* WIN_LockWndPtr(WND *wndPtr);
93 extern void WIN_ReleaseWndPtr(WND *wndPtr);
94 extern void WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
95 extern WND* WIN_GetDesktop(void);
96 extern void WIN_ReleaseDesktop(void);
97 extern void WIN_DumpWindow( HWND hwnd );
98 extern void WIN_WalkWindows( HWND hwnd, int indent );
99 extern BOOL WIN_UnlinkWindow( HWND hwnd );
100 extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
101 extern HWND WIN_FindWinToRepaint( HWND hwnd );
102 extern BOOL WIN_DestroyThreadWindows( HWND hwnd );
103 extern BOOL WIN_CreateDesktopWindow(void);
104 extern HWND WIN_GetTopParent( HWND hwnd );
105 extern WND* WIN_GetTopParentPtr( WND* pWnd );
106 extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
107 extern WND** WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
108 extern void WIN_ReleaseWinArray(WND **wndArray);
109 extern BOOL WIN_InternalShowOwnedPopups( HWND owner, BOOL fShow, BOOL unmanagedOnly );
111 extern HWND CARET_GetHwnd(void);
112 extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
114 extern BOOL16 DRAG_QueryUpdate( HWND, SEGPTR, BOOL );
115 extern void DEFWND_SetTextA( WND *wndPtr, LPCSTR text );
116 extern void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text );
117 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ); /* windows/defwnd.c */
119 extern void PROPERTY_RemoveWindowProps( WND *pWnd ); /* windows/property.c */
121 /* Classes functions */
122 struct tagCLASS; /* opaque structure */
123 struct builtin_class_descr;
124 extern ATOM CLASS_RegisterBuiltinClass( const struct builtin_class_descr *descr );
125 extern struct tagCLASS *CLASS_AddWindow( ATOM atom, HINSTANCE inst, WINDOWPROCTYPE type,
126 INT *winExtra, WNDPROC *winproc,
127 DWORD *style, struct tagDCE **dce );
128 extern void CLASS_RemoveWindow( struct tagCLASS *cls );
129 extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
131 /* windows/focus.c */
132 extern void FOCUS_SwitchFocus( struct tagMESSAGEQUEUE *pMsgQ, HWND , HWND );
134 #endif /* __WINE_WIN_H */