setupapi: Add missing prototypes and definitions, and change function prototypes...
[wine] / include / win.h
1 /*
2  * Window definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  *
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.
10  *
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.
15  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #ifndef __WINE_WIN_H
22 #define __WINE_WIN_H
23
24 #include <stdarg.h>
25 #include <windef.h>
26 #include <winbase.h>
27 #include <wingdi.h>
28 #include <winuser.h>
29 #include <wine/windef16.h>
30
31 #define WND_MAGIC     0x444e4957  /* 'WIND' */
32
33 struct tagCLASS;
34
35 typedef struct tagWND
36 {
37     HWND           hwndSelf;      /* Handle of this window */
38     HWND           parent;        /* Window parent */
39     HWND           owner;         /* Window owner */
40     struct tagCLASS *class;       /* Window class */
41     WNDPROC        winproc;       /* Window procedure */
42     DWORD          dwMagic;       /* Magic number (must be WND_MAGIC) */
43     DWORD          tid;           /* Owner thread id */
44     HINSTANCE      hInstance;     /* Window hInstance (from CreateWindow) */
45     RECT           rectClient;    /* Client area rel. to parent client area */
46     RECT           rectWindow;    /* Whole window rel. to parent client area */
47     LPWSTR         text;          /* Window text */
48     void          *pVScroll;      /* Vertical scroll-bar info */
49     void          *pHScroll;      /* Horizontal scroll-bar info */
50     DWORD          dwStyle;       /* Window style (from CreateWindow) */
51     DWORD          dwExStyle;     /* Extended style (from CreateWindowEx) */
52     DWORD          clsStyle;      /* Class style at window creation */
53     UINT_PTR       wIDmenu;       /* ID or hmenu (from CreateWindow) */
54     DWORD          helpContext;   /* Help context ID */
55     UINT           flags;         /* Misc. flags (see below) */
56     HMENU          hSysMenu;      /* window's copy of System Menu */
57     HICON          hIcon;         /* window's icon */
58     HICON          hIconSmall;    /* window's small icon */
59     int            cbWndExtra;    /* class cbWndExtra at window creation */
60     DWORD_PTR      userdata;      /* User private data */
61     DWORD          wExtra[1];     /* Window extra bytes */
62 } WND;
63
64   /* WND flags values */
65 #define WIN_RESTORE_MAX           0x0001 /* Maximize when restoring */
66 #define WIN_NEED_SIZE             0x0002 /* Internal WM_SIZE is needed */
67 #define WIN_NCACTIVATED           0x0004 /* last WM_NCACTIVATE was positive */
68 #define WIN_ISMDICLIENT           0x0008 /* Window is an MDIClient */
69 #define WIN_ISDIALOG              0x0010 /* Window is a dialog */
70 #define WIN_ISWIN32               0x0020 /* Understands Win32 messages */
71 #define WIN_ISUNICODE             0x0040 /* Window is Unicode */
72 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0080 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
73
74   /* Window functions */
75 extern WND *WIN_GetPtr( HWND hwnd );
76 extern HWND WIN_Handle32( HWND16 hwnd16 );
77 extern HWND WIN_IsCurrentProcess( HWND hwnd );
78 extern HWND WIN_IsCurrentThread( HWND hwnd );
79 extern HWND WIN_SetOwner( HWND hwnd, HWND owner );
80 extern ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits );
81 extern BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient );
82 extern LRESULT WIN_DestroyWindow( HWND hwnd );
83 extern void WIN_DestroyThreadWindows( HWND hwnd );
84 extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL );
85 extern HWND *WIN_ListChildren( HWND hwnd );
86 extern LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL unicode );
87 extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id );
88
89 /* user lock */
90 extern void USER_Lock(void);
91 extern void USER_Unlock(void);
92
93 static inline HWND WIN_GetFullHandle( HWND hwnd )
94 {
95     if (!HIWORD(hwnd) && hwnd) hwnd = WIN_Handle32( LOWORD(hwnd) );
96     return hwnd;
97 }
98
99 /* to release pointers retrieved by WIN_GetPtr */
100 static inline void WIN_ReleasePtr( WND *ptr )
101 {
102     USER_Unlock();
103 }
104
105 #define WND_OTHER_PROCESS ((WND *)1)  /* returned by WIN_GetPtr on unknown window handles */
106 #define WND_DESKTOP       ((WND *)2)  /* returned by WIN_GetPtr on the desktop window */
107
108 extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode );
109
110 extern BOOL WINPOS_RedrawIconTitle( HWND hWnd );
111 extern BOOL WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow );
112 extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos, POINT *minTrack,
113                                   POINT *maxTrack );
114 extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos);
115 extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest );
116 extern void WINPOS_CheckInternalPos( HWND hwnd );
117 extern void WINPOS_ActivateOtherWindow( HWND hwnd );
118
119 #endif  /* __WINE_WIN_H */