comparison os2/dw.c @ 190:f4c9fa77136a

A cleaner way of finding the toplevel window.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 10 Jan 2003 19:19:56 +0000
parents f55677513954
children d946e329670c
comparison
equal deleted inserted replaced
189:230686a7eba9 190:f4c9fa77136a
43 LONG _foreground = 0xAAAAAA, _background = 0; 43 LONG _foreground = 0xAAAAAA, _background = 0;
44 44
45 HWND hwndBubble = NULLHANDLE, hwndBubbleLast = NULLHANDLE, hwndEmph = NULLHANDLE; 45 HWND hwndBubble = NULLHANDLE, hwndBubbleLast = NULLHANDLE, hwndEmph = NULLHANDLE;
46 PRECORDCORE pCore = NULL, pCoreEmph = NULL; 46 PRECORDCORE pCore = NULL, pCoreEmph = NULL;
47 ULONG aulBuffer[4]; 47 ULONG aulBuffer[4];
48 HWND lasthcnr = 0, lastitem = 0, popup = 0; 48 HWND lasthcnr = 0, lastitem = 0, popup = 0, desktop;
49 49
50 #define IS_WARP4() (aulBuffer[0] == 20 && aulBuffer[1] >= 40) 50 #define IS_WARP4() (aulBuffer[0] == 20 && aulBuffer[1] >= 40)
51 51
52 #ifndef min 52 #ifndef min
53 #define min(a, b) (((a < b) ? a : b)) 53 #define min(a, b) (((a < b) ? a : b))
164 HWND _toplevel_window(HWND handle) 164 HWND _toplevel_window(HWND handle)
165 { 165 {
166 HWND box, lastbox = WinQueryWindow(handle, QW_PARENT); 166 HWND box, lastbox = WinQueryWindow(handle, QW_PARENT);
167 167
168 /* Find the toplevel window */ 168 /* Find the toplevel window */
169 while((box = WinQueryWindow(lastbox, QW_PARENT)) > 0x80000001 && box > 0) 169 while((box = WinQueryWindow(lastbox, QW_PARENT)) != desktop && box > 0)
170 { 170 {
171 lastbox = box; 171 lastbox = box;
172 } 172 }
173 if(box > 0) 173 if(box > 0)
174 return lastbox; 174 return lastbox;
2997 rc = WinRegisterClass(dwhab, SplitbarClassName, _splitwndproc, 0L, 32); 2997 rc = WinRegisterClass(dwhab, SplitbarClassName, _splitwndproc, 0L, 32);
2998 2998
2999 /* Get the OS/2 version. */ 2999 /* Get the OS/2 version. */
3000 DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG)); 3000 DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG));
3001 3001
3002 desktop = WinQueryDesktopWindow(dwhab, NULLHANDLE);
3003
3002 return rc; 3004 return rc;
3003 } 3005 }
3004 3006
3005 /* 3007 /*
3006 * Runs a message loop for Dynamic Windows. 3008 * Runs a message loop for Dynamic Windows.