1 | /* $Id: win32wbase.h,v 1.152 2003-03-29 16:38:01 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Win32 Window Base Class for OS/2
|
---|
4 | *
|
---|
5 | *
|
---|
6 | * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | * Copyright 1999 Daniela Engert (dani@ngrt.de)
|
---|
8 | *
|
---|
9 | *
|
---|
10 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
11 | *
|
---|
12 | */
|
---|
13 | #ifndef __WIN32WNDBASE_H__
|
---|
14 | #define __WIN32WNDBASE_H__
|
---|
15 |
|
---|
16 | #ifdef __cplusplus
|
---|
17 |
|
---|
18 | #include <win32class.h>
|
---|
19 | #include <gen_object.h>
|
---|
20 | #include <win32wndchild.h>
|
---|
21 | #include <winuser32.h>
|
---|
22 | #include <winres.h>
|
---|
23 | #include <scroll.h>
|
---|
24 |
|
---|
25 | class Win32BaseWindow;
|
---|
26 |
|
---|
27 | #define OFFSET_RESERVED 0 //reserved for odin apps (such as Opera)
|
---|
28 | #define OFFSET_WIN32WNDPTR 4
|
---|
29 | #define OFFSET_WIN32PM_MAGIC 8
|
---|
30 | #define OFFSET_WIN32FLAGS 12
|
---|
31 | #define NROF_WIN32WNDBYTES 16
|
---|
32 |
|
---|
33 | #define WINDOWFLAG_ACTIVE 1
|
---|
34 |
|
---|
35 | #define WIN32PM_MAGIC 0x12345678
|
---|
36 | #define CheckMagicDword(a) (a==WIN32PM_MAGIC)
|
---|
37 |
|
---|
38 | #define TYPE_ASCII 0
|
---|
39 | #define TYPE_UNICODE 1
|
---|
40 |
|
---|
41 | #define GW_HWNDNEXTCHILD (0x10000 | GW_HWNDNEXT)
|
---|
42 | #define GW_HWNDPREVCHILD (0x10000 | GW_HWNDPREV)
|
---|
43 | #define GW_HWNDFIRSTCHILD (0x10000 | GW_CHILD)
|
---|
44 | #define GW_HWNDLASTCHILD (0x10000 | GW_HWNDLAST)
|
---|
45 |
|
---|
46 | #ifdef DEBUG
|
---|
47 | #define RELEASE_WNDOBJ(a) { a->release(__FUNCTION__, __LINE__); a = NULL; }
|
---|
48 | #else
|
---|
49 | #define RELEASE_WNDOBJ(a) { a->release(); a = NULL; }
|
---|
50 | #endif
|
---|
51 |
|
---|
52 | typedef struct {
|
---|
53 | USHORT cb;
|
---|
54 | Win32BaseWindow *win32wnd;
|
---|
55 | ULONG win32CreateStruct; //or dialog create dword
|
---|
56 | } CUSTOMWNDDATA;
|
---|
57 |
|
---|
58 | typedef struct tagPROPERTY
|
---|
59 | {
|
---|
60 | struct tagPROPERTY *next; /* Next property in window list */
|
---|
61 | HANDLE handle; /* User's data */
|
---|
62 | LPSTR string; /* Property string (or atom) */
|
---|
63 | } PROPERTY;
|
---|
64 |
|
---|
65 | #define HAS_DLGFRAME(style,exStyle) \
|
---|
66 | (((exStyle) & WS_EX_DLGMODALFRAME) || \
|
---|
67 | (((style) & WS_DLGFRAME) && !((style) & WS_THICKFRAME)))
|
---|
68 |
|
---|
69 | #define HAS_THICKFRAME(style,exStyle) \
|
---|
70 | (((style) & WS_THICKFRAME) && \
|
---|
71 | !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
|
---|
72 | #if 0
|
---|
73 | (((style) & WS_THICKFRAME) && \
|
---|
74 | !((exStyle) & WS_EX_DLGMODALFRAME) && \
|
---|
75 | !((style) & WS_CHILD))
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | #define HAS_THINFRAME(style) \
|
---|
79 | (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP)))
|
---|
80 |
|
---|
81 | #define HAS_BIGFRAME(style,exStyle) \
|
---|
82 | (((style) & (WS_THICKFRAME | WS_DLGFRAME)) || \
|
---|
83 | ((exStyle) & WS_EX_DLGMODALFRAME))
|
---|
84 |
|
---|
85 | #define HAS_ANYFRAME(style,exStyle) \
|
---|
86 | (((style) & (WS_THICKFRAME | WS_DLGFRAME | WS_BORDER)) || \
|
---|
87 | ((exStyle) & WS_EX_DLGMODALFRAME) || \
|
---|
88 | !((style) & (WS_CHILD | WS_POPUP)))
|
---|
89 |
|
---|
90 | #define HAS_3DFRAME(exStyle) \
|
---|
91 | ((exStyle & WS_EX_CLIENTEDGE) || (exStyle & WS_EX_STATICEDGE) || (exStyle & WS_EX_WINDOWEDGE))
|
---|
92 |
|
---|
93 | #define HAS_BORDER(style, exStyle) \
|
---|
94 | ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle))
|
---|
95 |
|
---|
96 | #define IS_OVERLAPPED(style) \
|
---|
97 | !(style & (WS_CHILD | WS_POPUP))
|
---|
98 |
|
---|
99 | #define HAS_MENU() (!(getStyle() & WS_CHILD) && (getWindowId() != 0))
|
---|
100 |
|
---|
101 | #define STATE_INIT 0 //initial state
|
---|
102 | #define STATE_PRE_WMNCCREATE 1 //before WM_NCCREATE
|
---|
103 | #define STATE_POST_WMNCCREATE 2 //after WM_NCCREATE
|
---|
104 | #define STATE_PRE_WMCREATE 3 //before WM_CREATE
|
---|
105 | #define STATE_POST_WMCREATE 4 //after WM_CREATE
|
---|
106 | #define STATE_CREATED 5 //after successful return of WinCreateWindow
|
---|
107 | #define STATE_DESTROYED 6 //DestroyWindow called for window
|
---|
108 |
|
---|
109 |
|
---|
110 | class Win32BaseWindow : public GenericObject, public ChildWindow
|
---|
111 | {
|
---|
112 | public:
|
---|
113 | Win32BaseWindow();
|
---|
114 | Win32BaseWindow(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
|
---|
115 |
|
---|
116 | virtual ~Win32BaseWindow();
|
---|
117 |
|
---|
118 | virtual ULONG MsgCreate(HWND hwndOS2);
|
---|
119 | ULONG MsgQuit();
|
---|
120 | ULONG MsgClose();
|
---|
121 | ULONG MsgDestroy();
|
---|
122 | virtual ULONG MsgEnable(BOOL fEnable);
|
---|
123 | ULONG MsgShow(BOOL fShow);
|
---|
124 | ULONG MsgPosChanging(LPARAM lp);
|
---|
125 | ULONG MsgPosChanged(LPARAM lp);
|
---|
126 | ULONG MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd, HWND hwndOS2Win);
|
---|
127 | ULONG MsgChildActivate(BOOL fActivate);
|
---|
128 | ULONG MsgSetFocus(HWND hwnd);
|
---|
129 | ULONG MsgKillFocus(HWND hwnd);
|
---|
130 | ULONG MsgScroll(ULONG msg, ULONG scrollCode, ULONG scrollPos);
|
---|
131 | ULONG MsgButton(MSG *msg);
|
---|
132 | ULONG MsgMouseMove(MSG *msg);
|
---|
133 | ULONG MsgChar(MSG *msg);
|
---|
134 | ULONG MsgPaint(ULONG tmp1, BOOL select = TRUE);
|
---|
135 | ULONG MsgEraseBackGround(HDC hdc);
|
---|
136 | ULONG MsgNCPaint(PRECT pUpdateRect);
|
---|
137 | ULONG MsgFormatFrame(WINDOWPOS *lpWndPos);
|
---|
138 | ULONG DispatchMsgA(MSG *msg);
|
---|
139 | ULONG DispatchMsgW(MSG *msg);
|
---|
140 |
|
---|
141 | ULONG MsgSetText(LPSTR lpsz, LONG cch);
|
---|
142 | ULONG MsgGetTextLength();
|
---|
143 | void MsgGetText(char *wndtext, ULONG textlength);
|
---|
144 |
|
---|
145 | virtual LONG SetWindowLong(int index, ULONG value, BOOL fUnicode);
|
---|
146 | virtual ULONG GetWindowLong(int index, BOOL fUnicode);
|
---|
147 | virtual WORD SetWindowWord(int index, WORD value);
|
---|
148 | virtual WORD GetWindowWord(int index);
|
---|
149 |
|
---|
150 | DWORD getStyle() { return dwStyle; };
|
---|
151 | DWORD getOldStyle() { return dwOldStyle; };
|
---|
152 | void setStyle(DWORD newstyle) { dwStyle = newstyle; };
|
---|
153 | void setOldStyle(DWORD oldStyle) { dwOldStyle = oldStyle; };
|
---|
154 | DWORD getExStyle() { return dwExStyle; };
|
---|
155 | void setExStyle(DWORD newexstyle) { dwExStyle = newexstyle; };
|
---|
156 | ULONG getInstance() { return hInstance; };
|
---|
157 | void setInstance(ULONG newinstance) { hInstance = newinstance; };
|
---|
158 | HWND getWindowHandle() { return Win32Hwnd; };
|
---|
159 | HWND getOS2WindowHandle() { return OS2Hwnd; };
|
---|
160 | HWND getOS2FrameWindowHandle() { return OS2HwndFrame; };
|
---|
161 | HWND getLastActive() { return hwndLastActive; };
|
---|
162 | void setLastActive(HWND _hwndLastActive)
|
---|
163 | { hwndLastActive = _hwndLastActive; };
|
---|
164 | BOOL isDragDropActive() { return fIsDragDropActive; };
|
---|
165 | void setDragDropActive(BOOL fActive) { fIsDragDropActive = fActive; };
|
---|
166 |
|
---|
167 | Win32WndClass *getWindowClass() { return windowClass; };
|
---|
168 |
|
---|
169 | LONG getLastHitTestVal() { return lastHitTestVal; }
|
---|
170 | void setLastHitTestVal(LONG hittest) { lastHitTestVal = hittest; }
|
---|
171 |
|
---|
172 | DWORD getWindowContextHelpId() { return contextHelpId; };
|
---|
173 | void setWindowContextHelpId(DWORD id){ contextHelpId = id; };
|
---|
174 |
|
---|
175 | BOOL isFrameWindow();
|
---|
176 | virtual BOOL isMDIClient();
|
---|
177 | virtual BOOL isMDIChild();
|
---|
178 | virtual BOOL isDesktopWindow();
|
---|
179 | virtual BOOL isFakeWindow();
|
---|
180 |
|
---|
181 | BOOL fHasParentDC() { return fParentDC; };
|
---|
182 |
|
---|
183 | Win32BaseWindow *getParent();
|
---|
184 | void setParent(Win32BaseWindow *pwindow) { setParentOfChild((ChildWindow *)pwindow); };
|
---|
185 | WNDPROC getWindowProc() { return win32wndproc; };
|
---|
186 | void setWindowProc(WNDPROC newproc) { win32wndproc = newproc; };
|
---|
187 | DWORD getWindowId() { return dwIDMenu; };
|
---|
188 | void setWindowId(DWORD id) { dwIDMenu = id; };
|
---|
189 | ULONG getWindowHeight() { return rectWindow.bottom - rectWindow.top; };
|
---|
190 | ULONG getWindowWidth() { return rectWindow.right - rectWindow.left; };
|
---|
191 | ULONG getClientHeight() { return rectClient.bottom - rectClient.top; };
|
---|
192 | ULONG getClientWidth() { return rectClient.right - rectClient.left; };
|
---|
193 | BOOL isChild();
|
---|
194 | PRECT getClientRectPtr() { return &rectClient; };
|
---|
195 | void getClientRect(PRECT rect)
|
---|
196 | {
|
---|
197 | *rect = rectClient;
|
---|
198 | rect->right -= rect->left;
|
---|
199 | rect->bottom -= rect->top;
|
---|
200 | rect->left = rect->top = 0;
|
---|
201 | }
|
---|
202 | void setClientRect(PRECT rect) { rectClient = *rect; };
|
---|
203 | virtual PRECT getWindowRect();
|
---|
204 | void setClientRect(LONG left, LONG top, LONG right, LONG bottom)
|
---|
205 | {
|
---|
206 | rectClient.left = left; rectClient.top = top;
|
---|
207 | rectClient.right = right; rectClient.bottom = bottom;
|
---|
208 | };
|
---|
209 | void setWindowRect(LONG left, LONG top, LONG right, LONG bottom)
|
---|
210 | {
|
---|
211 | rectWindow.left = left; rectWindow.top = top;
|
---|
212 | rectWindow.right = right; rectWindow.bottom = bottom;
|
---|
213 | };
|
---|
214 | void setWindowRect(PRECT rect) { rectWindow = *rect; };
|
---|
215 | DWORD getFlags() { return flags; };
|
---|
216 | void setFlags(DWORD newflags) { flags = newflags; };
|
---|
217 |
|
---|
218 | DWORD getCBExtra() { return cbExtra; };
|
---|
219 | PVOID getExtraPtr() { return pExtra; };
|
---|
220 |
|
---|
221 | void SetSysMenu(HMENU hSystemMenu) { hSysMenu = hSystemMenu; };
|
---|
222 | HMENU GetSysMenu() { return hSysMenu; }
|
---|
223 |
|
---|
224 | HICON IconForWindow(WPARAM fType);
|
---|
225 |
|
---|
226 | void SetWindowRegion(HRGN hRegion) { hWindowRegion = hRegion; };
|
---|
227 | HRGN GetWindowRegion() { return hWindowRegion; };
|
---|
228 |
|
---|
229 | //Save old clip region for CS_OWNDC windows (in BeginPaint)
|
---|
230 | HRGN GetClipRegion() { return hClipRegion; };
|
---|
231 | void SetClipRegion(HRGN hRegion) { hClipRegion = hRegion; };
|
---|
232 |
|
---|
233 | void saveAndValidateUpdateRegion();
|
---|
234 | void checkForDirtyUpdateRegion();
|
---|
235 | BOOL hasDirtUpdateRegion() { return fDirtyUpdateRegion; };
|
---|
236 |
|
---|
237 | BOOL ShowWindow(ULONG nCmdShow);
|
---|
238 | virtual BOOL SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags, BOOL fShowWindow = FALSE);
|
---|
239 | BOOL SetWindowPlacement(WINDOWPLACEMENT *winpos);
|
---|
240 | BOOL GetWindowPlacement(LPWINDOWPLACEMENT winpos);
|
---|
241 | BOOL ScrollWindow(int dx, int dy);
|
---|
242 | virtual BOOL DestroyWindow();
|
---|
243 | HWND SetActiveWindow();
|
---|
244 | BOOL DeactivateChildWindow();
|
---|
245 | HWND GetParent();
|
---|
246 | HWND SetParent(HWND hwndNewParent);
|
---|
247 |
|
---|
248 | BOOL IsChild(HWND hwndParent);
|
---|
249 |
|
---|
250 | HWND GetTopWindow();
|
---|
251 | HWND GetTopParent();
|
---|
252 |
|
---|
253 | PVOID getOldPMWindowProc() { return pfnOldPMWndProc; };
|
---|
254 | void setOldPMWindowProc(PVOID pfnPMWndProc) { pfnOldPMWndProc = pfnPMWndProc; };
|
---|
255 |
|
---|
256 | HWND GetWindow(UINT uCmd);
|
---|
257 | virtual BOOL EnableWindow(BOOL fEnable);
|
---|
258 | BOOL CloseWindow();
|
---|
259 | static HWND GetActiveWindow();
|
---|
260 | //Window handle has already been verified, so just return true
|
---|
261 | BOOL IsWindow() { return TRUE; };
|
---|
262 | BOOL IsDialog() { return fIsDialog; };
|
---|
263 | BOOL IsModalDialog() { return fIsModalDialog; };
|
---|
264 | BOOL IsModalDialogOwner() { return fIsModalDialogOwner; };
|
---|
265 | VOID setModalDialogOwner(BOOL fMDO) { fIsModalDialogOwner = fMDO; };
|
---|
266 | VOID setOS2HwndModalDialog(HWND aHwnd) { OS2HwndModalDialog = aHwnd; };
|
---|
267 | HWND getOS2HwndModalDialog() { return OS2HwndModalDialog; };
|
---|
268 | BOOL CanReceiveSizeMsgs() { return state >= STATE_PRE_WMCREATE; };
|
---|
269 | BOOL IsParentChanging() { return fParentChange; };
|
---|
270 | BOOL IsWindowCreated() { return state >= STATE_PRE_WMNCCREATE; }
|
---|
271 | BOOL IsWindowDestroyed() { return state >= STATE_DESTROYED; };
|
---|
272 | BOOL IsWindowIconic();
|
---|
273 |
|
---|
274 | //hack alert (see DestroyWindow)
|
---|
275 | BOOL IsChildDestructionInProgress() { return fChildDestructionInProgress; };
|
---|
276 | void SetChildDestructionInProgress(BOOL fDestuctionInProgress)
|
---|
277 | {
|
---|
278 | fChildDestructionInProgress = fDestuctionInProgress;
|
---|
279 | };
|
---|
280 | //hack end
|
---|
281 |
|
---|
282 | //Window procedure type
|
---|
283 | BOOL IsWindowUnicode();
|
---|
284 | BOOL IsMixMaxStateChanging() { return fMinMaxChange; };
|
---|
285 |
|
---|
286 | void SetVisibleRegionChanged(BOOL changed) { fVisibleRegionChanged = changed; };
|
---|
287 | BOOL IsVisibleRegionChanged() { return fVisibleRegionChanged; };
|
---|
288 | BOOL setVisibleRgnNotifyProc(VISRGN_NOTIFY_PROC lpNotifyProc, DWORD dwUserData);
|
---|
289 | void callVisibleRgnNotifyProc(BOOL fDrawingAllowed);
|
---|
290 |
|
---|
291 | int GetWindowTextLength(BOOL fUnicode);
|
---|
292 | int GetWindowTextLengthA() { return GetWindowTextLength(FALSE); };
|
---|
293 | int GetWindowTextLengthW() { return GetWindowTextLength(TRUE); };
|
---|
294 |
|
---|
295 | int GetWindowTextA(LPSTR lpsz, int cch);
|
---|
296 | int GetWindowTextW(LPWSTR lpsz, int cch);
|
---|
297 | BOOL SetWindowTextA(LPSTR lpsz);
|
---|
298 | BOOL SetWindowTextW(LPWSTR lpsz);
|
---|
299 | BOOL hasWindowName(LPSTR wndname, BOOL fUnicode = 0);
|
---|
300 | CHAR *getWindowNamePtrA();
|
---|
301 | WCHAR *getWindowNamePtrW();
|
---|
302 | VOID freeWindowNamePtr(PVOID namePtr);
|
---|
303 | CHAR *getWindowNameA() { return windowNameA; }; //only for MDI windows!
|
---|
304 | WCHAR *getWindowNameW() { return windowNameW; }; //only for MDI windows!
|
---|
305 | int getWindowNameLength() { return windowNameLength; };
|
---|
306 | Win32WndClass *getClass() { return windowClass; };
|
---|
307 | Win32BaseWindow *getOwner() { return owner; };
|
---|
308 | void setOwner(Win32BaseWindow *newOwner) { owner = newOwner; };
|
---|
309 |
|
---|
310 |
|
---|
311 | DWORD getThreadId() { return dwThreadId; };
|
---|
312 | DWORD getProcessId() { return dwProcessId; };
|
---|
313 |
|
---|
314 | SCROLLBAR_INFO *getScrollInfo(int nBar);
|
---|
315 |
|
---|
316 | LRESULT DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam);
|
---|
317 | LRESULT DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);
|
---|
318 |
|
---|
319 | LRESULT DefWndControlColor(UINT ctlType, HDC hdc);
|
---|
320 | LRESULT DefWndPrint(HDC hdc,ULONG uFlags);
|
---|
321 |
|
---|
322 | void NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
|
---|
323 |
|
---|
324 | HWND FindWindowById(int id);
|
---|
325 |
|
---|
326 | static HWND FindWindowEx(HWND hwndParent, HWND hwndChildAfter, ATOM atom, LPSTR lpszWindow);
|
---|
327 |
|
---|
328 | BOOL EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam);
|
---|
329 | BOOL EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam);
|
---|
330 | BOOL EnumWindows(WNDENUMPROC lpfn, LPARAM lParam);
|
---|
331 |
|
---|
332 |
|
---|
333 | BOOL isComingToTop() { return fComingToTop; };
|
---|
334 | void setComingToTop(BOOL fTop) { fComingToTop = fTop; };
|
---|
335 | BOOL isInTasklist() { return fTaskList; };
|
---|
336 |
|
---|
337 | //window property methods
|
---|
338 | HANDLE getProp(LPCSTR str);
|
---|
339 | BOOL setProp(LPCSTR str, HANDLE handle);
|
---|
340 | HANDLE removeProp(LPCSTR str);
|
---|
341 | INT enumPropsExA(PROPENUMPROCEXA func, LPARAM lParam);
|
---|
342 | INT enumPropsExW(PROPENUMPROCEXW func, LPARAM lParam);
|
---|
343 |
|
---|
344 | #ifdef DEBUG
|
---|
345 | LONG addRef();
|
---|
346 | LONG release(char *function = __FUNCTION__, int line = __LINE__ );
|
---|
347 | #endif
|
---|
348 |
|
---|
349 | //Locates window in linked list and increases reference count (if found)
|
---|
350 | //Window object must be unreferenced after usage
|
---|
351 | static Win32BaseWindow *GetWindowFromHandle(HWND hwnd);
|
---|
352 | static Win32BaseWindow *GetWindowFromOS2Handle(HWND hwnd);
|
---|
353 | static Win32BaseWindow *GetWindowFromOS2FrameHandle(HWND hwnd);
|
---|
354 |
|
---|
355 | static void DestroyAll();
|
---|
356 |
|
---|
357 | protected:
|
---|
358 | #ifndef OS2_INCLUDED
|
---|
359 | BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
|
---|
360 | #endif
|
---|
361 | void Init();
|
---|
362 |
|
---|
363 | void NotifyFrameChanged(WINDOWPOS *wpos, RECT *oldClientRect);
|
---|
364 |
|
---|
365 | //called in destructor to remove all (if any) window properties
|
---|
366 | void removeWindowProps();
|
---|
367 | PROPERTY *findWindowProperty(LPCSTR str);
|
---|
368 |
|
---|
369 | HWND OS2Hwnd, OS2HwndFrame;
|
---|
370 | HMENU hSysMenu;
|
---|
371 | HWND Win32Hwnd;
|
---|
372 |
|
---|
373 | int posx, posy, width, height;
|
---|
374 |
|
---|
375 | // values normally contained in the standard window words
|
---|
376 | ULONG dwExStyle; //GWL_EXSTYLE
|
---|
377 | ULONG dwStyle; //GWL_STYLE
|
---|
378 | ULONG dwOldStyle; //Used to determine which frame control buttons to change (OS/2 mode)
|
---|
379 | WNDPROC win32wndproc; //GWL_WNDPROC
|
---|
380 | ULONG hInstance; //GWL_HINSTANCE
|
---|
381 | //Moved in ChildWindow class
|
---|
382 | ///// Win32BaseWindow *parent; //GWL_HWNDPARENT
|
---|
383 | ULONG dwIDMenu; //GWL_ID
|
---|
384 | ULONG userData; //GWL_USERDATA
|
---|
385 | HWND hwndLastActive; // last active popup handle
|
---|
386 |
|
---|
387 | ULONG cbExtra;
|
---|
388 | PVOID pExtra;
|
---|
389 |
|
---|
390 | HWND hwndLinkAfter;
|
---|
391 | DWORD flags;
|
---|
392 | DWORD contextHelpId;
|
---|
393 | DWORD hotkey;
|
---|
394 | LONG lastHitTestVal; //Last value returned by WM_NCHITTEST handler
|
---|
395 |
|
---|
396 | HWND OS2HwndModalDialog;
|
---|
397 |
|
---|
398 | ULONG fFirstShow:1,
|
---|
399 | fIsDialog:1,
|
---|
400 | fIsModalDialog:1,
|
---|
401 | fIsModalDialogOwner:1,
|
---|
402 | fParentChange:1,
|
---|
403 | fDestroyWindowCalled:1, //DestroyWindow was called for this window
|
---|
404 | fChildDestructionInProgress:1,
|
---|
405 | fTaskList:1, //should be listed in PM tasklist or not
|
---|
406 | fXDefault:1,
|
---|
407 | fCXDefault:1,
|
---|
408 | fParentDC:1,
|
---|
409 | fComingToTop:1,
|
---|
410 | isUnicode:1,
|
---|
411 | fMinMaxChange:1, //set when switching between min/max/restored state
|
---|
412 | fVisibleRegionChanged:1, //set when visible region has changed -> erase background must be sent during next BeginPaint
|
---|
413 | fEraseBkgndFlag:1,
|
---|
414 | fIsDragDropActive:1,
|
---|
415 | fDirtyUpdateRegion:1,
|
---|
416 | fWindowLocked:1;
|
---|
417 |
|
---|
418 | ULONG state;
|
---|
419 | HRGN hWindowRegion;
|
---|
420 | HRGN hClipRegion;
|
---|
421 | HRGN hUpdateRegion;
|
---|
422 |
|
---|
423 | DWORD dwThreadId; //id of thread that created this window
|
---|
424 | DWORD dwProcessId; //id of process that created this window
|
---|
425 |
|
---|
426 | Win32BaseWindow *owner;
|
---|
427 | HICON hIcon,hIconSm;
|
---|
428 |
|
---|
429 | char *windowNameA;
|
---|
430 | WCHAR *windowNameW;
|
---|
431 | int windowNameLength;
|
---|
432 |
|
---|
433 | char *userWindowBytes;
|
---|
434 | ULONG nrUserWindowBytes;
|
---|
435 |
|
---|
436 | RECT rectWindow; //relative to parent
|
---|
437 | RECT rectClient; //relative to frame
|
---|
438 | WINDOWPLACEMENT windowpos;
|
---|
439 |
|
---|
440 | PVOID pfnOldPMWndProc;
|
---|
441 |
|
---|
442 | PROPERTY *propertyList;
|
---|
443 |
|
---|
444 | VISRGN_NOTIFY_PROC lpVisRgnNotifyProc;
|
---|
445 | DWORD dwVisRgnNotifyParam;
|
---|
446 |
|
---|
447 | HANDLE hTaskList; //PM specific (switchentry handle)
|
---|
448 |
|
---|
449 | CREATESTRUCTA *tmpcs; //temporary pointer to CREATESTRUCT used in CreateWindowEx
|
---|
450 | ULONG sw; //set in CreateWindowExA, used in MsgCreate method
|
---|
451 |
|
---|
452 | SCROLLBAR_INFO *vertScrollInfo;
|
---|
453 | SCROLLBAR_INFO *horzScrollInfo;
|
---|
454 |
|
---|
455 | Win32WndClass *windowClass;
|
---|
456 |
|
---|
457 | static GenericObject *windows;
|
---|
458 | static CRITICAL_SECTION critsect;
|
---|
459 |
|
---|
460 | private:
|
---|
461 | #ifndef OS2_INCLUDED
|
---|
462 | void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
|
---|
463 | UINT MinMaximize(UINT cmd, LPRECT lpRect);
|
---|
464 | LONG HandleWindowPosChanging(WINDOWPOS *winpos);
|
---|
465 | LONG HandleNCActivate(WPARAM wParam);
|
---|
466 | VOID TrackMinMaxHelpBox(WORD wParam);
|
---|
467 | VOID TrackCloseButton(WORD wParam);
|
---|
468 | VOID TrackScrollBar(WPARAM wParam,POINT pt);
|
---|
469 | LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam);
|
---|
470 | LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam);
|
---|
471 | LONG HandleNCRButtonUp(WPARAM wParam,LPARAM lParam);
|
---|
472 | VOID AdjustRectOuter(LPRECT rect,BOOL menu);
|
---|
473 | VOID AdjustRectInner(LPRECT rect);
|
---|
474 | LONG HandleNCCalcSize(BOOL calcValidRects,RECT *winRect);
|
---|
475 | VOID DrawFrame(HDC hdc,RECT *rect,BOOL dlgFrame,BOOL active);
|
---|
476 | public:
|
---|
477 | VOID GetInsideRect(RECT *rect);
|
---|
478 | LONG HandleNCHitTest(POINT pt);
|
---|
479 | BOOL GetSysPopupPos(RECT* rect);
|
---|
480 | BOOL DrawSysButton(HDC hdc,RECT *rect);
|
---|
481 | private:
|
---|
482 | BOOL DrawGrayButton(HDC hdc,int x,int y);
|
---|
483 | VOID DrawCloseButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
|
---|
484 | VOID DrawMaxButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
|
---|
485 | VOID DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
|
---|
486 | VOID DrawContextHelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed);
|
---|
487 | VOID DrawCaption(HDC hdc,RECT *rect,BOOL active);
|
---|
488 | VOID DoNCPaint(HRGN clip,BOOL suppress_menupaint);
|
---|
489 | LONG HandleNCPaint(HRGN clip);
|
---|
490 | LONG HandleSysCommand(WPARAM wParam, POINT *pt32);
|
---|
491 |
|
---|
492 | LONG SendNCCalcSize(BOOL calcValidRect,
|
---|
493 | RECT *newWindowRect, RECT *oldWindowRect,
|
---|
494 | RECT *oldClientRect, WINDOWPOS *winpos,
|
---|
495 | RECT *newClientRect );
|
---|
496 |
|
---|
497 | #else
|
---|
498 | friend BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fTranslateExtraMsgs);
|
---|
499 | #endif
|
---|
500 |
|
---|
501 | public:
|
---|
502 |
|
---|
503 | VOID AdjustMaximizedRect(LPRECT rect);
|
---|
504 | VOID AdjustTrackInfo(PPOINT minTrackSize,PPOINT maxTrackSize);
|
---|
505 |
|
---|
506 | //Temporary hack for CS_CLASSDC style (do the same as for CS_OWNDC)
|
---|
507 | #ifndef OS2_INCLUDED
|
---|
508 | BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC)); }
|
---|
509 | #else
|
---|
510 | BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W)); }
|
---|
511 | #endif
|
---|
512 |
|
---|
513 | HDC getOwnDC() { return ownDC; }
|
---|
514 | void setOwnDC(HDC hdc) { ownDC = hdc; }
|
---|
515 | protected:
|
---|
516 | HDC ownDC;
|
---|
517 |
|
---|
518 | public:
|
---|
519 | VOID setEraseBkgnd (BOOL erase) { fEraseBkgndFlag = erase; }
|
---|
520 | BOOL needsEraseBkgnd() { return fEraseBkgndFlag; }
|
---|
521 | };
|
---|
522 |
|
---|
523 | #endif //__cplusplus
|
---|
524 |
|
---|
525 | #endif //__WIN32WNDBASE_H__
|
---|