Converted implementation of _lseek to _lseeki64, implemented _lseek by
[wine/multimedia.git] / windows / winpos.c
blob45f7e90c3b1584366e594809d86f879e69967a0c
1 /*
2 * Window position related functions.
4 * Copyright 1993, 1994, 1995 Alexandre Julliard
5 * 1995, 1996, 1999 Alex Korobka
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <string.h>
23 #include "winerror.h"
24 #include "windef.h"
25 #include "wingdi.h"
26 #include "winerror.h"
27 #include "wine/winuser16.h"
28 #include "wine/server.h"
29 #include "controls.h"
30 #include "user.h"
31 #include "win.h"
32 #include "message.h"
33 #include "queue.h"
34 #include "winpos.h"
35 #include "dce.h"
36 #include "nonclient.h"
37 #include "wine/debug.h"
38 #include "input.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(win);
42 #define HAS_DLGFRAME(style,exStyle) \
43 (((exStyle) & WS_EX_DLGMODALFRAME) || \
44 (((style) & WS_DLGFRAME) && !((style) & WS_BORDER)))
46 #define HAS_THICKFRAME(style) \
47 (((style) & WS_THICKFRAME) && \
48 !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
50 #define EMPTYPOINT(pt) ((*(LONG*)&(pt)) == -1)
52 #define PLACE_MIN 0x0001
53 #define PLACE_MAX 0x0002
54 #define PLACE_RECT 0x0004
57 #define DWP_MAGIC ((INT)('W' | ('P' << 8) | ('O' << 16) | ('S' << 24)))
59 typedef struct
61 INT actualCount;
62 INT suggestedCount;
63 BOOL valid;
64 INT wMagic;
65 HWND hwndParent;
66 WINDOWPOS winPos[1];
67 } DWP;
69 /* ----- internal variables ----- */
71 static HWND hGlobalShellWindow=0; /*the shell*/
72 static HWND hGlobalTaskmanWindow=0;
73 static HWND hGlobalProgmanWindow=0;
75 static LPCSTR atomInternalPos;
78 /***********************************************************************
79 * WINPOS_CreateInternalPosAtom
81 BOOL WINPOS_CreateInternalPosAtom()
83 LPSTR str = "SysIP";
84 atomInternalPos = (LPCSTR)(DWORD)GlobalAddAtomA(str);
85 return (atomInternalPos) ? TRUE : FALSE;
88 /***********************************************************************
89 * WINPOS_CheckInternalPos
91 * Called when a window is destroyed.
93 void WINPOS_CheckInternalPos( HWND hwnd )
95 LPINTERNALPOS lpPos = (LPINTERNALPOS) GetPropA( hwnd, atomInternalPos );
97 if( lpPos )
99 if( IsWindow(lpPos->hwndIconTitle) )
100 DestroyWindow( lpPos->hwndIconTitle );
101 HeapFree( GetProcessHeap(), 0, lpPos );
105 /***********************************************************************
106 * ArrangeIconicWindows (USER32.@)
108 UINT WINAPI ArrangeIconicWindows( HWND parent )
110 RECT rectParent;
111 HWND hwndChild;
112 INT x, y, xspacing, yspacing;
114 GetClientRect( parent, &rectParent );
115 x = rectParent.left;
116 y = rectParent.bottom;
117 xspacing = GetSystemMetrics(SM_CXICONSPACING);
118 yspacing = GetSystemMetrics(SM_CYICONSPACING);
120 hwndChild = GetWindow( parent, GW_CHILD );
121 while (hwndChild)
123 if( IsIconic( hwndChild ) )
125 WINPOS_ShowIconTitle( hwndChild, FALSE );
127 SetWindowPos( hwndChild, 0, x + (xspacing - GetSystemMetrics(SM_CXICON)) / 2,
128 y - yspacing - GetSystemMetrics(SM_CYICON)/2, 0, 0,
129 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
130 if( IsWindow(hwndChild) )
131 WINPOS_ShowIconTitle(hwndChild , TRUE );
133 if (x <= rectParent.right - xspacing) x += xspacing;
134 else
136 x = rectParent.left;
137 y -= yspacing;
140 hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
142 return yspacing;
146 /***********************************************************************
147 * SwitchToThisWindow (USER32.@)
149 void WINAPI SwitchToThisWindow( HWND hwnd, BOOL restore )
151 ShowWindow( hwnd, restore ? SW_RESTORE : SW_SHOWMINIMIZED );
155 /***********************************************************************
156 * GetWindowRect (USER32.@)
158 BOOL WINAPI GetWindowRect( HWND hwnd, LPRECT rect )
160 BOOL ret = WIN_GetRectangles( hwnd, rect, NULL );
161 if (ret)
163 MapWindowPoints( GetAncestor( hwnd, GA_PARENT ), 0, (POINT *)rect, 2 );
164 TRACE( "hwnd %p (%d,%d)-(%d,%d)\n",
165 hwnd, rect->left, rect->top, rect->right, rect->bottom);
167 return ret;
171 /***********************************************************************
172 * GetWindowRgn (USER32.@)
174 int WINAPI GetWindowRgn ( HWND hwnd, HRGN hrgn )
176 int nRet = ERROR;
177 WND *wndPtr = WIN_GetPtr( hwnd );
179 if (wndPtr == WND_OTHER_PROCESS)
181 if (IsWindow( hwnd ))
182 FIXME( "not supported on other process window %p\n", hwnd );
183 wndPtr = NULL;
185 if (!wndPtr)
187 SetLastError( ERROR_INVALID_WINDOW_HANDLE );
188 return ERROR;
190 if (wndPtr->hrgnWnd) nRet = CombineRgn( hrgn, wndPtr->hrgnWnd, 0, RGN_COPY );
191 WIN_ReleasePtr( wndPtr );
192 return nRet;
196 /***********************************************************************
197 * SetWindowRgn (USER32.@)
199 int WINAPI SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL bRedraw )
201 RECT rect;
202 WND *wndPtr;
204 if (hrgn) /* verify that region really exists */
206 if (GetRgnBox( hrgn, &rect ) == ERROR) return FALSE;
209 if (USER_Driver.pSetWindowRgn)
210 return USER_Driver.pSetWindowRgn( hwnd, hrgn, bRedraw );
212 if ((wndPtr = WIN_GetPtr( hwnd )) == WND_OTHER_PROCESS)
214 if (IsWindow( hwnd ))
215 FIXME( "not supported on other process window %p\n", hwnd );
216 wndPtr = NULL;
218 if (!wndPtr)
220 SetLastError( ERROR_INVALID_WINDOW_HANDLE );
221 return FALSE;
224 if (wndPtr->hrgnWnd == hrgn)
226 WIN_ReleasePtr( wndPtr );
227 return TRUE;
230 if (wndPtr->hrgnWnd)
232 /* delete previous region */
233 DeleteObject(wndPtr->hrgnWnd);
234 wndPtr->hrgnWnd = 0;
236 wndPtr->hrgnWnd = hrgn;
237 WIN_ReleasePtr( wndPtr );
239 /* Size the window to the rectangle of the new region (if it isn't NULL) */
240 if (hrgn) SetWindowPos( hwnd, 0, rect.left, rect.top,
241 rect.right - rect.left, rect.bottom - rect.top,
242 SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOACTIVATE |
243 SWP_NOZORDER | (bRedraw ? 0 : SWP_NOREDRAW) );
244 return TRUE;
248 /***********************************************************************
249 * GetClientRect (USER32.@)
251 BOOL WINAPI GetClientRect( HWND hwnd, LPRECT rect )
253 BOOL ret;
255 rect->right = rect->bottom = 0;
256 if ((ret = WIN_GetRectangles( hwnd, NULL, rect )))
258 rect->right -= rect->left;
259 rect->bottom -= rect->top;
261 rect->left = rect->top = 0;
262 return ret;
266 /*******************************************************************
267 * ClientToScreen (USER32.@)
269 BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
271 MapWindowPoints( hwnd, 0, lppnt, 1 );
272 return TRUE;
276 /*******************************************************************
277 * ScreenToClient (USER32.@)
279 BOOL WINAPI ScreenToClient( HWND hwnd, LPPOINT lppnt )
281 MapWindowPoints( 0, hwnd, lppnt, 1 );
282 return TRUE;
286 /***********************************************************************
287 * find_child_from_point
289 * Find the child that contains pt. Helper for WindowFromPoint.
290 * pt is in parent client coordinates.
291 * lparam is the param to pass in the WM_NCHITTEST message.
293 static HWND find_child_from_point( HWND parent, POINT pt, INT *hittest, LPARAM lparam )
295 int i, res;
296 LONG style, exstyle;
297 RECT rectWindow, rectClient;
298 WND *wndPtr;
299 HWND *list = WIN_ListChildren( parent );
300 HWND retvalue = 0;
302 if (!list) return 0;
303 for (i = 0; list[i]; i++)
305 /* If point is in window, and window is visible, and it */
306 /* is enabled (or it's a top-level window), then explore */
307 /* its children. Otherwise, go to the next window. */
309 style = GetWindowLongW( list[i], GWL_STYLE );
310 if (!(style & WS_VISIBLE)) continue; /* not visible -> skip */
311 if ((style & (WS_POPUP | WS_CHILD | WS_DISABLED)) == (WS_CHILD | WS_DISABLED))
312 continue; /* disabled child -> skip */
313 exstyle = GetWindowLongW( list[i], GWL_EXSTYLE );
314 if ((exstyle & (WS_EX_LAYERED | WS_EX_TRANSPARENT)) == (WS_EX_LAYERED | WS_EX_TRANSPARENT))
315 continue; /* transparent -> skip */
317 if (!WIN_GetRectangles( list[i], &rectWindow, &rectClient )) continue;
318 if (!PtInRect( &rectWindow, pt )) continue; /* not in window -> skip */
320 /* FIXME: check window region for other processes too */
321 if ((wndPtr = WIN_GetPtr( list[i] )) && wndPtr != WND_OTHER_PROCESS)
323 if (wndPtr->hrgnWnd && !PtInRegion( wndPtr->hrgnWnd,
324 pt.x - rectWindow.left, pt.y - rectWindow.top ))
326 WIN_ReleasePtr( wndPtr );
327 continue; /* point outside window region -> skip */
329 WIN_ReleasePtr( wndPtr );
332 /* If window is minimized or disabled, return at once */
333 if (style & WS_MINIMIZE)
335 *hittest = HTCAPTION;
336 retvalue = list[i];
337 break;
339 if (style & WS_DISABLED)
341 *hittest = HTERROR;
342 retvalue = list[i];
343 break;
346 /* If point is in client area, explore children */
347 if (PtInRect( &rectClient, pt ))
349 POINT new_pt;
351 new_pt.x = pt.x - rectClient.left;
352 new_pt.y = pt.y - rectClient.top;
353 if ((retvalue = find_child_from_point( list[i], new_pt, hittest, lparam ))) break;
356 /* Now it's inside window, send WM_NCCHITTEST (if same thread) */
357 if (!WIN_IsCurrentThread( list[i] ))
359 *hittest = HTCLIENT;
360 retvalue = list[i];
361 break;
363 if ((res = SendMessageA( list[i], WM_NCHITTEST, 0, lparam )) != HTTRANSPARENT)
365 *hittest = res; /* Found the window */
366 retvalue = list[i];
367 break;
369 /* continue search with next sibling */
371 HeapFree( GetProcessHeap(), 0, list );
372 return retvalue;
376 /***********************************************************************
377 * WINPOS_WindowFromPoint
379 * Find the window and hittest for a given point.
381 HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest )
383 POINT xy = pt;
384 int res;
385 LONG style;
387 TRACE("scope %p %ld,%ld\n", hwndScope, pt.x, pt.y);
389 if (!hwndScope) hwndScope = GetDesktopWindow();
390 style = GetWindowLongW( hwndScope, GWL_STYLE );
392 *hittest = HTERROR;
393 if (style & WS_DISABLED) return 0;
395 MapWindowPoints( GetDesktopWindow(), GetAncestor( hwndScope, GA_PARENT ), &xy, 1 );
397 if (!(style & WS_MINIMIZE))
399 RECT rectClient;
400 if (WIN_GetRectangles( hwndScope, NULL, &rectClient ) && PtInRect( &rectClient, xy ))
402 HWND ret;
404 xy.x -= rectClient.left;
405 xy.y -= rectClient.top;
406 if ((ret = find_child_from_point( hwndScope, xy, hittest, MAKELONG( pt.x, pt.y ) )))
408 TRACE( "found child %p\n", ret );
409 return ret;
414 /* If nothing found, try the scope window */
415 if (!WIN_IsCurrentThread( hwndScope ))
417 *hittest = HTCLIENT;
418 TRACE( "returning %p\n", hwndScope );
419 return hwndScope;
421 res = SendMessageA( hwndScope, WM_NCHITTEST, 0, MAKELONG( pt.x, pt.y ) );
422 if (res != HTTRANSPARENT)
424 *hittest = res; /* Found the window */
425 TRACE( "returning %p\n", hwndScope );
426 return hwndScope;
428 *hittest = HTNOWHERE;
429 TRACE( "nothing found\n" );
430 return 0;
434 /*******************************************************************
435 * WindowFromPoint (USER32.@)
437 HWND WINAPI WindowFromPoint( POINT pt )
439 INT hittest;
440 return WINPOS_WindowFromPoint( 0, pt, &hittest );
444 /*******************************************************************
445 * ChildWindowFromPoint (USER32.@)
447 HWND WINAPI ChildWindowFromPoint( HWND hwndParent, POINT pt )
449 return ChildWindowFromPointEx( hwndParent, pt, CWP_ALL );
452 /*******************************************************************
453 * ChildWindowFromPointEx (USER32.@)
455 HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
457 /* pt is in the client coordinates */
458 HWND *list;
459 int i;
460 RECT rect;
461 HWND retvalue;
463 GetClientRect( hwndParent, &rect );
464 if (!PtInRect( &rect, pt )) return 0;
465 if (!(list = WIN_ListChildren( hwndParent ))) return 0;
467 for (i = 0; list[i]; i++)
469 if (!WIN_GetRectangles( list[i], &rect, NULL )) continue;
470 if (!PtInRect( &rect, pt )) continue;
471 if (uFlags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED))
473 LONG style = GetWindowLongW( list[i], GWL_STYLE );
474 if ((uFlags & CWP_SKIPINVISIBLE) && !(style & WS_VISIBLE)) continue;
475 if ((uFlags & CWP_SKIPDISABLED) && (style & WS_DISABLED)) continue;
477 if (uFlags & CWP_SKIPTRANSPARENT)
479 if (GetWindowLongW( list[i], GWL_EXSTYLE ) & WS_EX_TRANSPARENT) continue;
481 break;
483 retvalue = list[i];
484 HeapFree( GetProcessHeap(), 0, list );
485 if (!retvalue) retvalue = hwndParent;
486 return retvalue;
490 /*******************************************************************
491 * WINPOS_GetWinOffset
493 * Calculate the offset between the origin of the two windows. Used
494 * to implement MapWindowPoints.
496 static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
498 WND * wndPtr;
500 offset->x = offset->y = 0;
502 /* Translate source window origin to screen coords */
503 if (hwndFrom)
505 HWND hwnd = hwndFrom;
507 while (hwnd)
509 if (hwnd == hwndTo) return;
510 if (!(wndPtr = WIN_GetPtr( hwnd )))
512 ERR( "bad hwndFrom = %p\n", hwnd );
513 return;
515 if (wndPtr == WND_OTHER_PROCESS) goto other_process;
516 offset->x += wndPtr->rectClient.left;
517 offset->y += wndPtr->rectClient.top;
518 hwnd = wndPtr->parent;
519 WIN_ReleasePtr( wndPtr );
523 /* Translate origin to destination window coords */
524 if (hwndTo)
526 HWND hwnd = hwndTo;
528 while (hwnd)
530 if (!(wndPtr = WIN_GetPtr( hwnd )))
532 ERR( "bad hwndTo = %p\n", hwnd );
533 return;
535 if (wndPtr == WND_OTHER_PROCESS) goto other_process;
536 offset->x -= wndPtr->rectClient.left;
537 offset->y -= wndPtr->rectClient.top;
538 hwnd = wndPtr->parent;
539 WIN_ReleasePtr( wndPtr );
542 return;
544 other_process: /* one of the parents may belong to another process, do it the hard way */
545 offset->x = offset->y = 0;
546 SERVER_START_REQ( get_windows_offset )
548 req->from = hwndFrom;
549 req->to = hwndTo;
550 if (!wine_server_call( req ))
552 offset->x = reply->x;
553 offset->y = reply->y;
556 SERVER_END_REQ;
560 /*******************************************************************
561 * MapWindowPoints (USER.258)
563 void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo,
564 LPPOINT16 lppt, UINT16 count )
566 POINT offset;
568 WINPOS_GetWinOffset( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), &offset );
569 while (count--)
571 lppt->x += offset.x;
572 lppt->y += offset.y;
573 lppt++;
578 /*******************************************************************
579 * MapWindowPoints (USER32.@)
581 INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count )
583 POINT offset;
585 WINPOS_GetWinOffset( hwndFrom, hwndTo, &offset );
586 while (count--)
588 lppt->x += offset.x;
589 lppt->y += offset.y;
590 lppt++;
592 return MAKELONG( LOWORD(offset.x), LOWORD(offset.y) );
596 /***********************************************************************
597 * IsIconic (USER32.@)
599 BOOL WINAPI IsIconic(HWND hWnd)
601 return (GetWindowLongW( hWnd, GWL_STYLE ) & WS_MINIMIZE) != 0;
605 /***********************************************************************
606 * IsZoomed (USER32.@)
608 BOOL WINAPI IsZoomed(HWND hWnd)
610 return (GetWindowLongW( hWnd, GWL_STYLE ) & WS_MAXIMIZE) != 0;
614 /*******************************************************************
615 * AllowSetForegroundWindow (USER32.@)
617 BOOL WINAPI AllowSetForegroundWindow( DWORD procid )
619 /* FIXME: If Win98/2000 style SetForegroundWindow behavior is
620 * implemented, then fix this function. */
621 return TRUE;
625 /*******************************************************************
626 * LockSetForegroundWindow (USER32.@)
628 BOOL WINAPI LockSetForegroundWindow( UINT lockcode )
630 /* FIXME: If Win98/2000 style SetForegroundWindow behavior is
631 * implemented, then fix this function. */
632 return TRUE;
636 /*******************************************************************
637 * SetShellWindow (USER32.@)
639 HWND WINAPI SetShellWindow(HWND hwndshell)
640 { WARN("(hWnd=%p) semi stub\n",hwndshell );
642 hGlobalShellWindow = WIN_GetFullHandle( hwndshell );
643 return hGlobalShellWindow;
647 /*******************************************************************
648 * GetShellWindow (USER32.@)
650 HWND WINAPI GetShellWindow(void)
651 { WARN("(hWnd=%p) semi stub\n",hGlobalShellWindow );
653 return hGlobalShellWindow;
657 /***********************************************************************
658 * BringWindowToTop (USER32.@)
660 BOOL WINAPI BringWindowToTop( HWND hwnd )
662 return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
666 /***********************************************************************
667 * MoveWindow (USER32.@)
669 BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
670 BOOL repaint )
672 int flags = SWP_NOZORDER | SWP_NOACTIVATE;
673 if (!repaint) flags |= SWP_NOREDRAW;
674 TRACE("%p %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint );
675 return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
678 /***********************************************************************
679 * WINPOS_InitInternalPos
681 static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *restoreRect )
683 LPINTERNALPOS lpPos = (LPINTERNALPOS) GetPropA( wnd->hwndSelf,
684 atomInternalPos );
685 if( !lpPos )
687 /* this happens when the window is minimized/maximized
688 * for the first time (rectWindow is not adjusted yet) */
690 lpPos = HeapAlloc( GetProcessHeap(), 0, sizeof(INTERNALPOS) );
691 if( !lpPos ) return NULL;
693 SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos );
694 lpPos->hwndIconTitle = 0; /* defer until needs to be shown */
695 CONV_RECT32TO16( &wnd->rectWindow, &lpPos->rectNormal );
696 *(UINT*)&lpPos->ptIconPos = *(UINT*)&lpPos->ptMaxPos = 0xFFFFFFFF;
699 if( wnd->dwStyle & WS_MINIMIZE )
700 CONV_POINT32TO16( &pt, &lpPos->ptIconPos );
701 else if( wnd->dwStyle & WS_MAXIMIZE )
702 CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );
703 else if( restoreRect )
704 CONV_RECT32TO16( restoreRect, &lpPos->rectNormal );
706 return lpPos;
709 /***********************************************************************
710 * WINPOS_RedrawIconTitle
712 BOOL WINPOS_RedrawIconTitle( HWND hWnd )
714 LPINTERNALPOS lpPos = (LPINTERNALPOS)GetPropA( hWnd, atomInternalPos );
715 if( lpPos )
717 if( lpPos->hwndIconTitle )
719 SendMessageA( lpPos->hwndIconTitle, WM_SHOWWINDOW, TRUE, 0);
720 InvalidateRect( lpPos->hwndIconTitle, NULL, TRUE );
721 return TRUE;
724 return FALSE;
727 /***********************************************************************
728 * WINPOS_ShowIconTitle
730 BOOL WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow )
732 LPINTERNALPOS lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
734 if( lpPos && !(GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_MANAGED))
736 HWND title = lpPos->hwndIconTitle;
738 TRACE("%p %i\n", hwnd, (bShow != 0) );
740 if( !title )
741 lpPos->hwndIconTitle = title = ICONTITLE_Create( hwnd );
742 if( bShow )
744 if (!IsWindowVisible(title))
746 SendMessageA( title, WM_SHOWWINDOW, TRUE, 0 );
747 SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
748 SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
751 else ShowWindow( title, SW_HIDE );
753 return FALSE;
756 /*******************************************************************
757 * WINPOS_GetMinMaxInfo
759 * Get the minimized and maximized information for a window.
761 void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
762 POINT *minTrack, POINT *maxTrack )
764 LPINTERNALPOS lpPos;
765 MINMAXINFO MinMax;
766 INT xinc, yinc;
767 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
768 LONG exstyle = GetWindowLongA( hwnd, GWL_EXSTYLE );
770 /* Compute default values */
772 MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
773 MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
774 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
775 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
776 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN);
777 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN);
779 if (HAS_DLGFRAME( style, exstyle ))
781 xinc = GetSystemMetrics(SM_CXDLGFRAME);
782 yinc = GetSystemMetrics(SM_CYDLGFRAME);
784 else
786 xinc = yinc = 0;
787 if (HAS_THICKFRAME(style))
789 xinc += GetSystemMetrics(SM_CXFRAME);
790 yinc += GetSystemMetrics(SM_CYFRAME);
792 if (style & WS_BORDER)
794 xinc += GetSystemMetrics(SM_CXBORDER);
795 yinc += GetSystemMetrics(SM_CYBORDER);
798 MinMax.ptMaxSize.x += 2 * xinc;
799 MinMax.ptMaxSize.y += 2 * yinc;
801 lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
802 if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) )
803 CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
804 else
806 MinMax.ptMaxPosition.x = -xinc;
807 MinMax.ptMaxPosition.y = -yinc;
810 SendMessageA( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
812 /* Some sanity checks */
814 TRACE("%ld %ld / %ld %ld / %ld %ld / %ld %ld\n",
815 MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
816 MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
817 MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
818 MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y);
819 MinMax.ptMaxTrackSize.x = max( MinMax.ptMaxTrackSize.x,
820 MinMax.ptMinTrackSize.x );
821 MinMax.ptMaxTrackSize.y = max( MinMax.ptMaxTrackSize.y,
822 MinMax.ptMinTrackSize.y );
824 if (maxSize) *maxSize = MinMax.ptMaxSize;
825 if (maxPos) *maxPos = MinMax.ptMaxPosition;
826 if (minTrack) *minTrack = MinMax.ptMinTrackSize;
827 if (maxTrack) *maxTrack = MinMax.ptMaxTrackSize;
830 /***********************************************************************
831 * ShowWindowAsync (USER32.@)
833 * doesn't wait; returns immediately.
834 * used by threads to toggle windows in other (possibly hanging) threads
836 BOOL WINAPI ShowWindowAsync( HWND hwnd, INT cmd )
838 HWND full_handle;
840 if ((full_handle = WIN_IsCurrentThread( hwnd )))
841 return USER_Driver.pShowWindow( full_handle, cmd );
842 return SendNotifyMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 );
846 /***********************************************************************
847 * ShowWindow (USER32.@)
849 BOOL WINAPI ShowWindow( HWND hwnd, INT cmd )
851 HWND full_handle;
853 if ((full_handle = WIN_IsCurrentThread( hwnd )))
854 return USER_Driver.pShowWindow( full_handle, cmd );
855 return SendMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 );
859 /***********************************************************************
860 * GetInternalWindowPos (USER32.@)
862 UINT WINAPI GetInternalWindowPos( HWND hwnd, LPRECT rectWnd,
863 LPPOINT ptIcon )
865 WINDOWPLACEMENT wndpl;
866 if (GetWindowPlacement( hwnd, &wndpl ))
868 if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
869 if (ptIcon) *ptIcon = wndpl.ptMinPosition;
870 return wndpl.showCmd;
872 return 0;
876 /***********************************************************************
877 * GetWindowPlacement (USER32.@)
879 * Win95:
880 * Fails if wndpl->length of Win95 (!) apps is invalid.
882 BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
884 WND *pWnd = WIN_FindWndPtr( hwnd );
885 LPINTERNALPOS lpPos;
887 if(!pWnd ) return FALSE;
889 lpPos = WINPOS_InitInternalPos( pWnd, *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
890 wndpl->length = sizeof(*wndpl);
891 if( pWnd->dwStyle & WS_MINIMIZE )
892 wndpl->showCmd = SW_SHOWMINIMIZED;
893 else
894 wndpl->showCmd = ( pWnd->dwStyle & WS_MAXIMIZE ) ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL ;
895 if( pWnd->flags & WIN_RESTORE_MAX )
896 wndpl->flags = WPF_RESTORETOMAXIMIZED;
897 else
898 wndpl->flags = 0;
899 CONV_POINT16TO32( &lpPos->ptIconPos, &wndpl->ptMinPosition );
900 CONV_POINT16TO32( &lpPos->ptMaxPos, &wndpl->ptMaxPosition );
901 CONV_RECT16TO32( &lpPos->rectNormal, &wndpl->rcNormalPosition );
902 WIN_ReleaseWndPtr(pWnd);
903 return TRUE;
907 /***********************************************************************
908 * WINPOS_SetPlacement
910 static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT flags )
912 WND *pWnd = WIN_FindWndPtr( hwnd );
913 if( pWnd )
915 LPINTERNALPOS lpPos = (LPINTERNALPOS)WINPOS_InitInternalPos( pWnd,
916 *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
918 if( flags & PLACE_MIN ) CONV_POINT32TO16( &wndpl->ptMinPosition, &lpPos->ptIconPos );
919 if( flags & PLACE_MAX ) CONV_POINT32TO16( &wndpl->ptMaxPosition, &lpPos->ptMaxPos );
920 if( flags & PLACE_RECT) CONV_RECT32TO16( &wndpl->rcNormalPosition, &lpPos->rectNormal );
922 if( pWnd->dwStyle & WS_MINIMIZE )
924 WINPOS_ShowIconTitle( pWnd->hwndSelf, FALSE );
925 if( wndpl->flags & WPF_SETMINPOSITION && !EMPTYPOINT(lpPos->ptIconPos))
926 SetWindowPos( hwnd, 0, lpPos->ptIconPos.x, lpPos->ptIconPos.y,
927 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
929 else if( pWnd->dwStyle & WS_MAXIMIZE )
931 if( !EMPTYPOINT(lpPos->ptMaxPos) )
932 SetWindowPos( hwnd, 0, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y,
933 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
935 else if( flags & PLACE_RECT )
936 SetWindowPos( hwnd, 0, lpPos->rectNormal.left, lpPos->rectNormal.top,
937 lpPos->rectNormal.right - lpPos->rectNormal.left,
938 lpPos->rectNormal.bottom - lpPos->rectNormal.top,
939 SWP_NOZORDER | SWP_NOACTIVATE );
941 ShowWindow( hwnd, wndpl->showCmd );
942 if( IsWindow(hwnd) && pWnd->dwStyle & WS_MINIMIZE )
944 if( pWnd->dwStyle & WS_VISIBLE ) WINPOS_ShowIconTitle( pWnd->hwndSelf, TRUE );
946 /* SDK: ...valid only the next time... */
947 if( wndpl->flags & WPF_RESTORETOMAXIMIZED ) pWnd->flags |= WIN_RESTORE_MAX;
949 WIN_ReleaseWndPtr(pWnd);
950 return TRUE;
952 return FALSE;
956 /***********************************************************************
957 * SetWindowPlacement (USER32.@)
959 * Win95:
960 * Fails if wndpl->length of Win95 (!) apps is invalid.
962 BOOL WINAPI SetWindowPlacement( HWND hwnd, const WINDOWPLACEMENT *wpl )
964 if (!wpl) return FALSE;
965 return WINPOS_SetPlacement( hwnd, wpl, PLACE_MIN | PLACE_MAX | PLACE_RECT );
969 /***********************************************************************
970 * AnimateWindow (USER32.@)
971 * Shows/Hides a window with an animation
972 * NO ANIMATION YET
974 BOOL WINAPI AnimateWindow(HWND hwnd, DWORD dwTime, DWORD dwFlags)
976 FIXME("partial stub\n");
978 /* If trying to show/hide and it's already *
979 * shown/hidden or invalid window, fail with *
980 * invalid parameter */
981 if(!IsWindow(hwnd) ||
982 (IsWindowVisible(hwnd) && !(dwFlags & AW_HIDE)) ||
983 (!IsWindowVisible(hwnd) && (dwFlags & AW_HIDE)))
985 SetLastError(ERROR_INVALID_PARAMETER);
986 return FALSE;
989 ShowWindow(hwnd, (dwFlags & AW_HIDE) ? SW_HIDE : ((dwFlags & AW_ACTIVATE) ? SW_SHOW : SW_SHOWNA));
991 return TRUE;
994 /***********************************************************************
995 * SetInternalWindowPos (USER32.@)
997 void WINAPI SetInternalWindowPos( HWND hwnd, UINT showCmd,
998 LPRECT rect, LPPOINT pt )
1000 if( IsWindow(hwnd) )
1002 WINDOWPLACEMENT wndpl;
1003 UINT flags;
1005 wndpl.length = sizeof(wndpl);
1006 wndpl.showCmd = showCmd;
1007 wndpl.flags = flags = 0;
1009 if( pt )
1011 flags |= PLACE_MIN;
1012 wndpl.flags |= WPF_SETMINPOSITION;
1013 wndpl.ptMinPosition = *pt;
1015 if( rect )
1017 flags |= PLACE_RECT;
1018 wndpl.rcNormalPosition = *rect;
1020 WINPOS_SetPlacement( hwnd, &wndpl, flags );
1025 /*******************************************************************
1026 * can_activate_window
1028 * Check if we can activate the specified window.
1030 static BOOL can_activate_window( HWND hwnd )
1032 LONG style;
1034 if (!hwnd) return FALSE;
1035 style = GetWindowLongW( hwnd, GWL_STYLE );
1036 if (!(style & WS_VISIBLE)) return FALSE;
1037 if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
1038 return !(style & WS_DISABLED);
1042 /*******************************************************************
1043 * WINPOS_ActivateOtherWindow
1045 * Activates window other than pWnd.
1047 void WINPOS_ActivateOtherWindow(HWND hwnd)
1049 HWND hwndTo, fg;
1051 if ((GetWindowLongW( hwnd, GWL_STYLE ) & WS_POPUP) && (hwndTo = GetWindow( hwnd, GW_OWNER )))
1053 hwndTo = GetAncestor( hwndTo, GA_ROOT );
1054 if (can_activate_window( hwndTo )) goto done;
1057 hwndTo = hwnd;
1058 for (;;)
1060 if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break;
1061 if (can_activate_window( hwndTo )) break;
1064 done:
1065 fg = GetForegroundWindow();
1066 TRACE("win = %p fg = %p\n", hwndTo, fg);
1067 if (!fg || (hwnd == fg))
1069 if (SetForegroundWindow( hwndTo )) return;
1071 if (!SetActiveWindow( hwndTo )) SetActiveWindow(0);
1075 /***********************************************************************
1076 * WINPOS_HandleWindowPosChanging16
1078 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
1080 LONG WINPOS_HandleWindowPosChanging16( HWND hwnd, WINDOWPOS16 *winpos )
1082 POINT maxSize, minTrack;
1083 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
1085 if (winpos->flags & SWP_NOSIZE) return 0;
1086 if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
1088 WINPOS_GetMinMaxInfo( hwnd, &maxSize, NULL, &minTrack, NULL );
1089 if (maxSize.x < winpos->cx) winpos->cx = maxSize.x;
1090 if (maxSize.y < winpos->cy) winpos->cy = maxSize.y;
1091 if (!(style & WS_MINIMIZE))
1093 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
1094 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
1097 return 0;
1101 /***********************************************************************
1102 * WINPOS_HandleWindowPosChanging
1104 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
1106 LONG WINPOS_HandleWindowPosChanging( HWND hwnd, WINDOWPOS *winpos )
1108 POINT maxSize, minTrack;
1109 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
1111 if (winpos->flags & SWP_NOSIZE) return 0;
1112 if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
1114 WINPOS_GetMinMaxInfo( hwnd, &maxSize, NULL, &minTrack, NULL );
1115 winpos->cx = min( winpos->cx, maxSize.x );
1116 winpos->cy = min( winpos->cy, maxSize.y );
1117 if (!(style & WS_MINIMIZE))
1119 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
1120 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
1123 return 0;
1127 /***********************************************************************
1128 * dump_winpos_flags
1130 static void dump_winpos_flags(UINT flags)
1132 TRACE("flags:");
1133 if(flags & SWP_NOSIZE) DPRINTF(" SWP_NOSIZE");
1134 if(flags & SWP_NOMOVE) DPRINTF(" SWP_NOMOVE");
1135 if(flags & SWP_NOZORDER) DPRINTF(" SWP_NOZORDER");
1136 if(flags & SWP_NOREDRAW) DPRINTF(" SWP_NOREDRAW");
1137 if(flags & SWP_NOACTIVATE) DPRINTF(" SWP_NOACTIVATE");
1138 if(flags & SWP_FRAMECHANGED) DPRINTF(" SWP_FRAMECHANGED");
1139 if(flags & SWP_SHOWWINDOW) DPRINTF(" SWP_SHOWWINDOW");
1140 if(flags & SWP_HIDEWINDOW) DPRINTF(" SWP_HIDEWINDOW");
1141 if(flags & SWP_NOCOPYBITS) DPRINTF(" SWP_NOCOPYBITS");
1142 if(flags & SWP_NOOWNERZORDER) DPRINTF(" SWP_NOOWNERZORDER");
1143 if(flags & SWP_NOSENDCHANGING) DPRINTF(" SWP_NOSENDCHANGING");
1144 if(flags & SWP_DEFERERASE) DPRINTF(" SWP_DEFERERASE");
1145 if(flags & SWP_ASYNCWINDOWPOS) DPRINTF(" SWP_ASYNCWINDOWPOS");
1147 #define DUMPED_FLAGS \
1148 (SWP_NOSIZE | \
1149 SWP_NOMOVE | \
1150 SWP_NOZORDER | \
1151 SWP_NOREDRAW | \
1152 SWP_NOACTIVATE | \
1153 SWP_FRAMECHANGED | \
1154 SWP_SHOWWINDOW | \
1155 SWP_HIDEWINDOW | \
1156 SWP_NOCOPYBITS | \
1157 SWP_NOOWNERZORDER | \
1158 SWP_NOSENDCHANGING | \
1159 SWP_DEFERERASE | \
1160 SWP_ASYNCWINDOWPOS)
1162 if(flags & ~DUMPED_FLAGS) DPRINTF(" %08x", flags & ~DUMPED_FLAGS);
1163 DPRINTF("\n");
1164 #undef DUMPED_FLAGS
1167 /***********************************************************************
1168 * SetWindowPos (USER32.@)
1170 BOOL WINAPI SetWindowPos( HWND hwnd, HWND hwndInsertAfter,
1171 INT x, INT y, INT cx, INT cy, UINT flags )
1173 WINDOWPOS winpos;
1175 TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
1176 hwnd, hwndInsertAfter, x, y, cx, cy, flags);
1177 if(TRACE_ON(win)) dump_winpos_flags(flags);
1179 winpos.hwnd = WIN_GetFullHandle(hwnd);
1180 winpos.hwndInsertAfter = WIN_GetFullHandle(hwndInsertAfter);
1181 winpos.x = x;
1182 winpos.y = y;
1183 winpos.cx = cx;
1184 winpos.cy = cy;
1185 winpos.flags = flags;
1186 if (WIN_IsCurrentThread( hwnd )) return USER_Driver.pSetWindowPos( &winpos );
1187 return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
1191 /***********************************************************************
1192 * BeginDeferWindowPos (USER32.@)
1194 HDWP WINAPI BeginDeferWindowPos( INT count )
1196 HDWP handle;
1197 DWP *pDWP;
1199 if (count < 0)
1201 SetLastError(ERROR_INVALID_PARAMETER);
1202 return 0;
1204 /* Windows allows zero count, in which case it allocates context for 8 moves */
1205 if (count == 0) count = 8;
1207 handle = USER_HEAP_ALLOC( sizeof(DWP) + (count-1)*sizeof(WINDOWPOS) );
1208 if (!handle) return 0;
1209 pDWP = (DWP *) USER_HEAP_LIN_ADDR( handle );
1210 pDWP->actualCount = 0;
1211 pDWP->suggestedCount = count;
1212 pDWP->valid = TRUE;
1213 pDWP->wMagic = DWP_MAGIC;
1214 pDWP->hwndParent = 0;
1215 return handle;
1219 /***********************************************************************
1220 * DeferWindowPos (USER32.@)
1222 HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
1223 INT x, INT y, INT cx, INT cy,
1224 UINT flags )
1226 DWP *pDWP;
1227 int i;
1228 HDWP newhdwp = hdwp,retvalue;
1230 hwnd = WIN_GetFullHandle( hwnd );
1231 if (hwnd == GetDesktopWindow()) return 0;
1233 if (!(pDWP = USER_HEAP_LIN_ADDR( hdwp ))) return 0;
1235 USER_Lock();
1237 for (i = 0; i < pDWP->actualCount; i++)
1239 if (pDWP->winPos[i].hwnd == hwnd)
1241 /* Merge with the other changes */
1242 if (!(flags & SWP_NOZORDER))
1244 pDWP->winPos[i].hwndInsertAfter = WIN_GetFullHandle(hwndAfter);
1246 if (!(flags & SWP_NOMOVE))
1248 pDWP->winPos[i].x = x;
1249 pDWP->winPos[i].y = y;
1251 if (!(flags & SWP_NOSIZE))
1253 pDWP->winPos[i].cx = cx;
1254 pDWP->winPos[i].cy = cy;
1256 pDWP->winPos[i].flags &= flags | ~(SWP_NOSIZE | SWP_NOMOVE |
1257 SWP_NOZORDER | SWP_NOREDRAW |
1258 SWP_NOACTIVATE | SWP_NOCOPYBITS|
1259 SWP_NOOWNERZORDER);
1260 pDWP->winPos[i].flags |= flags & (SWP_SHOWWINDOW | SWP_HIDEWINDOW |
1261 SWP_FRAMECHANGED);
1262 retvalue = hdwp;
1263 goto END;
1266 if (pDWP->actualCount >= pDWP->suggestedCount)
1268 newhdwp = USER_HEAP_REALLOC( hdwp,
1269 sizeof(DWP) + pDWP->suggestedCount*sizeof(WINDOWPOS) );
1270 if (!newhdwp)
1272 retvalue = 0;
1273 goto END;
1275 pDWP = (DWP *) USER_HEAP_LIN_ADDR( newhdwp );
1276 pDWP->suggestedCount++;
1278 pDWP->winPos[pDWP->actualCount].hwnd = hwnd;
1279 pDWP->winPos[pDWP->actualCount].hwndInsertAfter = hwndAfter;
1280 pDWP->winPos[pDWP->actualCount].x = x;
1281 pDWP->winPos[pDWP->actualCount].y = y;
1282 pDWP->winPos[pDWP->actualCount].cx = cx;
1283 pDWP->winPos[pDWP->actualCount].cy = cy;
1284 pDWP->winPos[pDWP->actualCount].flags = flags;
1285 pDWP->actualCount++;
1286 retvalue = newhdwp;
1287 END:
1288 USER_Unlock();
1289 return retvalue;
1293 /***********************************************************************
1294 * EndDeferWindowPos (USER32.@)
1296 BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
1298 DWP *pDWP;
1299 WINDOWPOS *winpos;
1300 BOOL res = TRUE;
1301 int i;
1303 pDWP = (DWP *) USER_HEAP_LIN_ADDR( hdwp );
1304 if (!pDWP) return FALSE;
1305 for (i = 0, winpos = pDWP->winPos; i < pDWP->actualCount; i++, winpos++)
1307 if (!(res = USER_Driver.pSetWindowPos( winpos ))) break;
1309 USER_HEAP_FREE( hdwp );
1310 return res;
1314 /***********************************************************************
1315 * TileChildWindows (USER.199)
1317 void WINAPI TileChildWindows16( HWND16 parent, WORD action )
1319 FIXME("(%04x, %d): stub\n", parent, action);
1322 /***********************************************************************
1323 * CascadeChildWindows (USER.198)
1325 void WINAPI CascadeChildWindows16( HWND16 parent, WORD action )
1327 FIXME("(%04x, %d): stub\n", parent, action);
1330 /***********************************************************************
1331 * SetProgmanWindow (USER32.@)
1333 HWND WINAPI SetProgmanWindow ( HWND hwnd )
1335 hGlobalProgmanWindow = hwnd;
1336 return hGlobalProgmanWindow;
1339 /***********************************************************************
1340 * GetProgmanWindow (USER32.@)
1342 HWND WINAPI GetProgmanWindow(void)
1344 return hGlobalProgmanWindow;
1347 /***********************************************************************
1348 * SetShellWindowEx (USER32.@)
1349 * hwndProgman = Progman[Program Manager]
1350 * |-> SHELLDLL_DefView
1351 * hwndListView = | |-> SysListView32
1352 * | | |-> tooltips_class32
1353 * | |
1354 * | |-> SysHeader32
1356 * |-> ProxyTarget
1358 HWND WINAPI SetShellWindowEx ( HWND hwndProgman, HWND hwndListView )
1360 FIXME("%p %p stub\n",hwndProgman ,hwndListView );
1361 hGlobalShellWindow = hwndProgman;
1362 return hGlobalShellWindow;
1366 /***********************************************************************
1367 * SetTaskmanWindow (USER32.@)
1368 * NOTES
1369 * hwnd = MSTaskSwWClass
1370 * |-> SysTabControl32
1372 HWND WINAPI SetTaskmanWindow ( HWND hwnd )
1374 hGlobalTaskmanWindow = hwnd;
1375 return hGlobalTaskmanWindow;
1378 /***********************************************************************
1379 * GetTaskmanWindow (USER32.@)
1381 HWND WINAPI GetTaskmanWindow(void)
1383 return hGlobalTaskmanWindow;