Add WM_GETOBJECT definition, remove WM_OTHERWINDOWCREATED define.
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 struct tagDCE;
35 struct tagMESSAGEQUEUE;
36
37 typedef struct tagWND
38 {
39     HWND           hwndSelf;      /* Handle of this window */
40     HWND           parent;        /* Window parent */
41     HWND           owner;         /* Window owner */
42     struct tagCLASS *class;       /* Window class */
43     WNDPROC        winproc;       /* Window procedure */
44     DWORD          dwMagic;       /* Magic number (must be WND_MAGIC) */
45     DWORD          tid;           /* Owner thread id */
46     HINSTANCE      hInstance;     /* Window hInstance (from CreateWindow) */
47     RECT           rectClient;    /* Client area rel. to parent client area */
48     RECT           rectWindow;    /* Whole window rel. to parent client area */
49     LPWSTR         text;          /* Window text */
50     void          *pVScroll;      /* Vertical scroll-bar info */
51     void          *pHScroll;      /* Horizontal scroll-bar info */
52     struct tagDCE *dce;           /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
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     UINT           flags;         /* Misc. flags (see below) */
59     HMENU          hSysMenu;      /* window's copy of System Menu */
60     HICON          hIcon;         /* window's icon */
61     HICON          hIconSmall;    /* window's small icon */
62     int            cbWndExtra;    /* class cbWndExtra at window creation */
63     int            irefCount;     /* window's reference count*/
64     DWORD          userdata;      /* User private data */
65     void          *pDriverData;   /* Window driver data */
66     DWORD          wExtra[1];     /* Window extra bytes */
67 } WND;
68
69   /* WND flags values */
70 #define WIN_RESTORE_MAX           0x0001 /* Maximize when restoring */
71 #define WIN_NEED_SIZE             0x0002 /* Internal WM_SIZE is needed */
72 #define WIN_NCACTIVATED           0x0004 /* last WM_NCACTIVATE was positive */
73 #define WIN_ISMDICLIENT           0x0008 /* Window is an MDIClient */
74 #define WIN_ISDIALOG              0x0010 /* Window is a dialog */
75 #define WIN_ISWIN32               0x0020 /* Understands Win32 messages */
76 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0040 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
77 #define WIN_NEEDS_INTERNALSOP     0x0080 /* Window was hidden by WIN_InternalShowOwnedPopups */
78
79   /* Window functions */
80 extern WND *WIN_GetPtr( HWND hwnd );
81 extern int    WIN_SuspendWndsLock( void );
82 extern void   WIN_RestoreWndsLock(int ipreviousLock);
83 extern WND*   WIN_FindWndPtr( HWND hwnd );
84 extern void   WIN_ReleaseWndPtr(WND *wndPtr);
85 extern HWND WIN_Handle32( HWND16 hwnd16 );
86 extern HWND WIN_IsCurrentProcess( HWND hwnd );
87 extern HWND WIN_IsCurrentThread( HWND hwnd );
88 extern void WIN_LinkWindow( HWND hwnd, HWND parent, HWND hwndInsertAfter );
89 extern void WIN_UnlinkWindow( HWND hwnd );
90 extern HWND WIN_SetOwner( HWND hwnd, HWND owner );
91 extern LONG WIN_SetStyle( HWND hwnd, LONG style );
92 extern LONG WIN_SetExStyle( HWND hwnd, LONG style );
93 extern BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient );
94 extern LRESULT WIN_DestroyWindow( HWND hwnd );
95 extern void WIN_DestroyThreadWindows( HWND hwnd );
96 extern BOOL WIN_CreateDesktopWindow(void);
97 extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL );
98 extern HWND *WIN_ListParents( HWND hwnd );
99 extern HWND *WIN_ListChildren( HWND hwnd );
100 extern BOOL WIN_InternalShowOwnedPopups( HWND owner, BOOL fShow, BOOL unmanagedOnly );
101 extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta );
102
103 /* internal SendInput codes (FIXME) */
104 #define WINE_INTERNAL_INPUT_MOUSE    (16+INPUT_MOUSE)
105 #define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
106
107 /* user lock */
108 extern void USER_Lock(void);
109 extern void USER_Unlock(void);
110
111 inline static HWND WIN_GetFullHandle( HWND hwnd )
112 {
113     if (!HIWORD(hwnd) && hwnd) hwnd = WIN_Handle32( LOWORD(hwnd) );
114     return hwnd;
115 }
116
117 /* to release pointers retrieved by WIN_GetPtr; do not confuse with WIN_ReleaseWndPtr!! */
118 inline static void WIN_ReleasePtr( WND *ptr )
119 {
120     USER_Unlock();
121 }
122
123 #define WND_OTHER_PROCESS ((WND *)1)  /* returned by WIN_GetPtr on unknown window handles */
124
125 extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode );
126
127 #endif  /* __WINE_WIN_H */