Removed -noimport on functions that are forwards to ntdll.
[wine/multimedia.git] / windows / winpos.c
blob673b4aa6e099e043ab32ebe87582b3b09a283ca0
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 %04x (%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 %x\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 %x\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 %04x %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 %x\n", ret );
409 return ret;
414 /* If nothing found, try the scope window */
415 if (!WIN_IsCurrentThread( hwndScope ))
417 *hittest = HTCLIENT;
418 TRACE( "returning %x\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 %x\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 = %04x\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 = %04x\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=%08x) semi stub\n",hwndshell );
642 hGlobalShellWindow = WIN_GetFullHandle( hwndshell );
643 return hGlobalShellWindow;
647 /*******************************************************************
648 * GetShellWindow (USER32.@)
650 HWND WINAPI GetShellWindow(void)
651 { WARN("(hWnd=%x) 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("%04x %d,%d %dx%d %d\n",
675 hwnd, x, y, cx, cy, repaint );
676 return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
679 /***********************************************************************
680 * WINPOS_InitInternalPos
682 static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *restoreRect )
684 LPINTERNALPOS lpPos = (LPINTERNALPOS) GetPropA( wnd->hwndSelf,
685 atomInternalPos );
686 if( !lpPos )
688 /* this happens when the window is minimized/maximized
689 * for the first time (rectWindow is not adjusted yet) */
691 lpPos = HeapAlloc( GetProcessHeap(), 0, sizeof(INTERNALPOS) );
692 if( !lpPos ) return NULL;
694 SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos );
695 lpPos->hwndIconTitle = 0; /* defer until needs to be shown */
696 CONV_RECT32TO16( &wnd->rectWindow, &lpPos->rectNormal );
697 *(UINT*)&lpPos->ptIconPos = *(UINT*)&lpPos->ptMaxPos = 0xFFFFFFFF;
700 if( wnd->dwStyle & WS_MINIMIZE )
701 CONV_POINT32TO16( &pt, &lpPos->ptIconPos );
702 else if( wnd->dwStyle & WS_MAXIMIZE )
703 CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );
704 else if( restoreRect )
705 CONV_RECT32TO16( restoreRect, &lpPos->rectNormal );
707 return lpPos;
710 /***********************************************************************
711 * WINPOS_RedrawIconTitle
713 BOOL WINPOS_RedrawIconTitle( HWND hWnd )
715 LPINTERNALPOS lpPos = (LPINTERNALPOS)GetPropA( hWnd, atomInternalPos );
716 if( lpPos )
718 if( lpPos->hwndIconTitle )
720 SendMessageA( lpPos->hwndIconTitle, WM_SHOWWINDOW, TRUE, 0);
721 InvalidateRect( lpPos->hwndIconTitle, NULL, TRUE );
722 return TRUE;
725 return FALSE;
728 /***********************************************************************
729 * WINPOS_ShowIconTitle
731 BOOL WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow )
733 LPINTERNALPOS lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
735 if( lpPos && !(GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_MANAGED))
737 HWND title = lpPos->hwndIconTitle;
739 TRACE("0x%04x %i\n", hwnd, (bShow != 0) );
741 if( !title )
742 lpPos->hwndIconTitle = title = ICONTITLE_Create( hwnd );
743 if( bShow )
745 if (!IsWindowVisible(title))
747 SendMessageA( title, WM_SHOWWINDOW, TRUE, 0 );
748 SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
749 SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
752 else ShowWindow( title, SW_HIDE );
754 return FALSE;
757 /*******************************************************************
758 * WINPOS_GetMinMaxInfo
760 * Get the minimized and maximized information for a window.
762 void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
763 POINT *minTrack, POINT *maxTrack )
765 LPINTERNALPOS lpPos;
766 MINMAXINFO MinMax;
767 INT xinc, yinc;
768 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
769 LONG exstyle = GetWindowLongA( hwnd, GWL_EXSTYLE );
771 /* Compute default values */
773 MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
774 MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
775 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
776 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
777 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN);
778 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN);
780 if (HAS_DLGFRAME( style, exstyle ))
782 xinc = GetSystemMetrics(SM_CXDLGFRAME);
783 yinc = GetSystemMetrics(SM_CYDLGFRAME);
785 else
787 xinc = yinc = 0;
788 if (HAS_THICKFRAME(style))
790 xinc += GetSystemMetrics(SM_CXFRAME);
791 yinc += GetSystemMetrics(SM_CYFRAME);
793 if (style & WS_BORDER)
795 xinc += GetSystemMetrics(SM_CXBORDER);
796 yinc += GetSystemMetrics(SM_CYBORDER);
799 MinMax.ptMaxSize.x += 2 * xinc;
800 MinMax.ptMaxSize.y += 2 * yinc;
802 lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
803 if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) )
804 CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
805 else
807 MinMax.ptMaxPosition.x = -xinc;
808 MinMax.ptMaxPosition.y = -yinc;
811 SendMessageA( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
813 /* Some sanity checks */
815 TRACE("%ld %ld / %ld %ld / %ld %ld / %ld %ld\n",
816 MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
817 MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
818 MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
819 MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y);
820 MinMax.ptMaxTrackSize.x = max( MinMax.ptMaxTrackSize.x,
821 MinMax.ptMinTrackSize.x );
822 MinMax.ptMaxTrackSize.y = max( MinMax.ptMaxTrackSize.y,
823 MinMax.ptMinTrackSize.y );
825 if (maxSize) *maxSize = MinMax.ptMaxSize;
826 if (maxPos) *maxPos = MinMax.ptMaxPosition;
827 if (minTrack) *minTrack = MinMax.ptMinTrackSize;
828 if (maxTrack) *maxTrack = MinMax.ptMaxTrackSize;
831 /***********************************************************************
832 * ShowWindowAsync (USER32.@)
834 * doesn't wait; returns immediately.
835 * used by threads to toggle windows in other (possibly hanging) threads
837 BOOL WINAPI ShowWindowAsync( HWND hwnd, INT cmd )
839 HWND full_handle;
841 if ((full_handle = WIN_IsCurrentThread( hwnd )))
842 return USER_Driver.pShowWindow( full_handle, cmd );
843 return SendNotifyMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 );
847 /***********************************************************************
848 * ShowWindow (USER32.@)
850 BOOL WINAPI ShowWindow( HWND hwnd, INT cmd )
852 HWND full_handle;
854 if ((full_handle = WIN_IsCurrentThread( hwnd )))
855 return USER_Driver.pShowWindow( full_handle, cmd );
856 return SendMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 );
860 /***********************************************************************
861 * GetInternalWindowPos (USER32.@)
863 UINT WINAPI GetInternalWindowPos( HWND hwnd, LPRECT rectWnd,
864 LPPOINT ptIcon )
866 WINDOWPLACEMENT wndpl;
867 if (GetWindowPlacement( hwnd, &wndpl ))
869 if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
870 if (ptIcon) *ptIcon = wndpl.ptMinPosition;
871 return wndpl.showCmd;
873 return 0;
877 /***********************************************************************
878 * GetWindowPlacement (USER32.@)
880 * Win95:
881 * Fails if wndpl->length of Win95 (!) apps is invalid.
883 BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
885 WND *pWnd = WIN_FindWndPtr( hwnd );
886 LPINTERNALPOS lpPos;
888 if(!pWnd ) return FALSE;
890 lpPos = WINPOS_InitInternalPos( pWnd, *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
891 wndpl->length = sizeof(*wndpl);
892 if( pWnd->dwStyle & WS_MINIMIZE )
893 wndpl->showCmd = SW_SHOWMINIMIZED;
894 else
895 wndpl->showCmd = ( pWnd->dwStyle & WS_MAXIMIZE ) ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL ;
896 if( pWnd->flags & WIN_RESTORE_MAX )
897 wndpl->flags = WPF_RESTORETOMAXIMIZED;
898 else
899 wndpl->flags = 0;
900 CONV_POINT16TO32( &lpPos->ptIconPos, &wndpl->ptMinPosition );
901 CONV_POINT16TO32( &lpPos->ptMaxPos, &wndpl->ptMaxPosition );
902 CONV_RECT16TO32( &lpPos->rectNormal, &wndpl->rcNormalPosition );
903 WIN_ReleaseWndPtr(pWnd);
904 return TRUE;
908 /***********************************************************************
909 * WINPOS_SetPlacement
911 static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT flags )
913 WND *pWnd = WIN_FindWndPtr( hwnd );
914 if( pWnd )
916 LPINTERNALPOS lpPos = (LPINTERNALPOS)WINPOS_InitInternalPos( pWnd,
917 *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
919 if( flags & PLACE_MIN ) CONV_POINT32TO16( &wndpl->ptMinPosition, &lpPos->ptIconPos );
920 if( flags & PLACE_MAX ) CONV_POINT32TO16( &wndpl->ptMaxPosition, &lpPos->ptMaxPos );
921 if( flags & PLACE_RECT) CONV_RECT32TO16( &wndpl->rcNormalPosition, &lpPos->rectNormal );
923 if( pWnd->dwStyle & WS_MINIMIZE )
925 WINPOS_ShowIconTitle( pWnd->hwndSelf, FALSE );
926 if( wndpl->flags & WPF_SETMINPOSITION && !EMPTYPOINT(lpPos->ptIconPos))
927 SetWindowPos( hwnd, 0, lpPos->ptIconPos.x, lpPos->ptIconPos.y,
928 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
930 else if( pWnd->dwStyle & WS_MAXIMIZE )
932 if( !EMPTYPOINT(lpPos->ptMaxPos) )
933 SetWindowPos( hwnd, 0, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y,
934 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
936 else if( flags & PLACE_RECT )
937 SetWindowPos( hwnd, 0, lpPos->rectNormal.left, lpPos->rectNormal.top,
938 lpPos->rectNormal.right - lpPos->rectNormal.left,
939 lpPos->rectNormal.bottom - lpPos->rectNormal.top,
940 SWP_NOZORDER | SWP_NOACTIVATE );
942 ShowWindow( hwnd, wndpl->showCmd );
943 if( IsWindow(hwnd) && pWnd->dwStyle & WS_MINIMIZE )
945 if( pWnd->dwStyle & WS_VISIBLE ) WINPOS_ShowIconTitle( pWnd->hwndSelf, TRUE );
947 /* SDK: ...valid only the next time... */
948 if( wndpl->flags & WPF_RESTORETOMAXIMIZED ) pWnd->flags |= WIN_RESTORE_MAX;
950 WIN_ReleaseWndPtr(pWnd);
951 return TRUE;
953 return FALSE;
957 /***********************************************************************
958 * SetWindowPlacement (USER32.@)
960 * Win95:
961 * Fails if wndpl->length of Win95 (!) apps is invalid.
963 BOOL WINAPI SetWindowPlacement( HWND hwnd, const WINDOWPLACEMENT *wpl )
965 if (!wpl) return FALSE;
966 return WINPOS_SetPlacement( hwnd, wpl, PLACE_MIN | PLACE_MAX | PLACE_RECT );
970 /***********************************************************************
971 * AnimateWindow (USER32.@)
972 * Shows/Hides a window with an animation
973 * NO ANIMATION YET
975 BOOL WINAPI AnimateWindow(HWND hwnd, DWORD dwTime, DWORD dwFlags)
977 FIXME("partial stub\n");
979 /* If trying to show/hide and it's already *
980 * shown/hidden or invalid window, fail with *
981 * invalid parameter */
982 if(!IsWindow(hwnd) ||
983 (IsWindowVisible(hwnd) && !(dwFlags & AW_HIDE)) ||
984 (!IsWindowVisible(hwnd) && (dwFlags & AW_HIDE)))
986 SetLastError(ERROR_INVALID_PARAMETER);
987 return FALSE;
990 ShowWindow(hwnd, (dwFlags & AW_HIDE) ? SW_HIDE : ((dwFlags & AW_ACTIVATE) ? SW_SHOW : SW_SHOWNA));
992 return TRUE;
995 /***********************************************************************
996 * SetInternalWindowPos (USER32.@)
998 void WINAPI SetInternalWindowPos( HWND hwnd, UINT showCmd,
999 LPRECT rect, LPPOINT pt )
1001 if( IsWindow(hwnd) )
1003 WINDOWPLACEMENT wndpl;
1004 UINT flags;
1006 wndpl.length = sizeof(wndpl);
1007 wndpl.showCmd = showCmd;
1008 wndpl.flags = flags = 0;
1010 if( pt )
1012 flags |= PLACE_MIN;
1013 wndpl.flags |= WPF_SETMINPOSITION;
1014 wndpl.ptMinPosition = *pt;
1016 if( rect )
1018 flags |= PLACE_RECT;
1019 wndpl.rcNormalPosition = *rect;
1021 WINPOS_SetPlacement( hwnd, &wndpl, flags );
1026 /*******************************************************************
1027 * can_activate_window
1029 * Check if we can activate the specified window.
1031 static BOOL can_activate_window( HWND hwnd )
1033 LONG style;
1035 if (!hwnd) return FALSE;
1036 style = GetWindowLongW( hwnd, GWL_STYLE );
1037 if (!(style & WS_VISIBLE)) return FALSE;
1038 if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
1039 return !(style & WS_DISABLED);
1043 /*******************************************************************
1044 * WINPOS_ActivateOtherWindow
1046 * Activates window other than pWnd.
1048 void WINPOS_ActivateOtherWindow(HWND hwnd)
1050 HWND hwndTo, fg;
1052 if ((GetWindowLongW( hwnd, GWL_STYLE ) & WS_POPUP) && (hwndTo = GetWindow( hwnd, GW_OWNER )))
1054 hwndTo = GetAncestor( hwndTo, GA_ROOT );
1055 if (can_activate_window( hwndTo )) goto done;
1058 hwndTo = hwnd;
1059 for (;;)
1061 if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break;
1062 if (can_activate_window( hwndTo )) break;
1065 done:
1066 fg = GetForegroundWindow();
1067 TRACE("win = %x fg = %x\n", hwndTo, fg);
1068 if (!fg || (hwnd == fg))
1070 if (SetForegroundWindow( hwndTo )) return;
1072 if (!SetActiveWindow( hwndTo )) SetActiveWindow(0);
1076 /***********************************************************************
1077 * WINPOS_HandleWindowPosChanging16
1079 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
1081 LONG WINPOS_HandleWindowPosChanging16( HWND hwnd, WINDOWPOS16 *winpos )
1083 POINT maxSize, minTrack;
1084 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
1086 if (winpos->flags & SWP_NOSIZE) return 0;
1087 if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
1089 WINPOS_GetMinMaxInfo( hwnd, &maxSize, NULL, &minTrack, NULL );
1090 if (maxSize.x < winpos->cx) winpos->cx = maxSize.x;
1091 if (maxSize.y < winpos->cy) winpos->cy = maxSize.y;
1092 if (!(style & WS_MINIMIZE))
1094 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
1095 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
1098 return 0;
1102 /***********************************************************************
1103 * WINPOS_HandleWindowPosChanging
1105 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
1107 LONG WINPOS_HandleWindowPosChanging( HWND hwnd, WINDOWPOS *winpos )
1109 POINT maxSize, minTrack;
1110 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
1112 if (winpos->flags & SWP_NOSIZE) return 0;
1113 if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
1115 WINPOS_GetMinMaxInfo( hwnd, &maxSize, NULL, &minTrack, NULL );
1116 winpos->cx = min( winpos->cx, maxSize.x );
1117 winpos->cy = min( winpos->cy, maxSize.y );
1118 if (!(style & WS_MINIMIZE))
1120 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
1121 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
1124 return 0;
1128 /***********************************************************************
1129 * dump_winpos_flags
1131 static void dump_winpos_flags(UINT flags)
1133 TRACE("flags:");
1134 if(flags & SWP_NOSIZE) DPRINTF(" SWP_NOSIZE");
1135 if(flags & SWP_NOMOVE) DPRINTF(" SWP_NOMOVE");
1136 if(flags & SWP_NOZORDER) DPRINTF(" SWP_NOZORDER");
1137 if(flags & SWP_NOREDRAW) DPRINTF(" SWP_NOREDRAW");
1138 if(flags & SWP_NOACTIVATE) DPRINTF(" SWP_NOACTIVATE");
1139 if(flags & SWP_FRAMECHANGED) DPRINTF(" SWP_FRAMECHANGED");
1140 if(flags & SWP_SHOWWINDOW) DPRINTF(" SWP_SHOWWINDOW");
1141 if(flags & SWP_HIDEWINDOW) DPRINTF(" SWP_HIDEWINDOW");
1142 if(flags & SWP_NOCOPYBITS) DPRINTF(" SWP_NOCOPYBITS");
1143 if(flags & SWP_NOOWNERZORDER) DPRINTF(" SWP_NOOWNERZORDER");
1144 if(flags & SWP_NOSENDCHANGING) DPRINTF(" SWP_NOSENDCHANGING");
1145 if(flags & SWP_DEFERERASE) DPRINTF(" SWP_DEFERERASE");
1146 if(flags & SWP_ASYNCWINDOWPOS) DPRINTF(" SWP_ASYNCWINDOWPOS");
1148 #define DUMPED_FLAGS \
1149 (SWP_NOSIZE | \
1150 SWP_NOMOVE | \
1151 SWP_NOZORDER | \
1152 SWP_NOREDRAW | \
1153 SWP_NOACTIVATE | \
1154 SWP_FRAMECHANGED | \
1155 SWP_SHOWWINDOW | \
1156 SWP_HIDEWINDOW | \
1157 SWP_NOCOPYBITS | \
1158 SWP_NOOWNERZORDER | \
1159 SWP_NOSENDCHANGING | \
1160 SWP_DEFERERASE | \
1161 SWP_ASYNCWINDOWPOS)
1163 if(flags & ~DUMPED_FLAGS) DPRINTF(" %08x", flags & ~DUMPED_FLAGS);
1164 DPRINTF("\n");
1165 #undef DUMPED_FLAGS
1168 /***********************************************************************
1169 * SetWindowPos (USER32.@)
1171 BOOL WINAPI SetWindowPos( HWND hwnd, HWND hwndInsertAfter,
1172 INT x, INT y, INT cx, INT cy, UINT flags )
1174 WINDOWPOS winpos;
1176 TRACE("hwnd %x, after %x, %d,%d (%dx%d), flags %08x\n",
1177 hwnd, hwndInsertAfter, x, y, cx, cy, flags);
1178 if(TRACE_ON(win)) dump_winpos_flags(flags);
1180 winpos.hwnd = WIN_GetFullHandle(hwnd);
1181 winpos.hwndInsertAfter = WIN_GetFullHandle(hwndInsertAfter);
1182 winpos.x = x;
1183 winpos.y = y;
1184 winpos.cx = cx;
1185 winpos.cy = cy;
1186 winpos.flags = flags;
1187 if (WIN_IsCurrentThread( hwnd )) return USER_Driver.pSetWindowPos( &winpos );
1188 return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
1192 /***********************************************************************
1193 * BeginDeferWindowPos (USER32.@)
1195 HDWP WINAPI BeginDeferWindowPos( INT count )
1197 HDWP handle;
1198 DWP *pDWP;
1200 if (count < 0)
1202 SetLastError(ERROR_INVALID_PARAMETER);
1203 return 0;
1205 /* Windows allows zero count, in which case it allocates context for 8 moves */
1206 if (count == 0) count = 8;
1208 handle = USER_HEAP_ALLOC( sizeof(DWP) + (count-1)*sizeof(WINDOWPOS) );
1209 if (!handle) return 0;
1210 pDWP = (DWP *) USER_HEAP_LIN_ADDR( handle );
1211 pDWP->actualCount = 0;
1212 pDWP->suggestedCount = count;
1213 pDWP->valid = TRUE;
1214 pDWP->wMagic = DWP_MAGIC;
1215 pDWP->hwndParent = 0;
1216 return handle;
1220 /***********************************************************************
1221 * DeferWindowPos (USER32.@)
1223 HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
1224 INT x, INT y, INT cx, INT cy,
1225 UINT flags )
1227 DWP *pDWP;
1228 int i;
1229 HDWP newhdwp = hdwp,retvalue;
1231 hwnd = WIN_GetFullHandle( hwnd );
1232 if (hwnd == GetDesktopWindow()) return 0;
1234 if (!(pDWP = USER_HEAP_LIN_ADDR( hdwp ))) return 0;
1236 USER_Lock();
1238 for (i = 0; i < pDWP->actualCount; i++)
1240 if (pDWP->winPos[i].hwnd == hwnd)
1242 /* Merge with the other changes */
1243 if (!(flags & SWP_NOZORDER))
1245 pDWP->winPos[i].hwndInsertAfter = WIN_GetFullHandle(hwndAfter);
1247 if (!(flags & SWP_NOMOVE))
1249 pDWP->winPos[i].x = x;
1250 pDWP->winPos[i].y = y;
1252 if (!(flags & SWP_NOSIZE))
1254 pDWP->winPos[i].cx = cx;
1255 pDWP->winPos[i].cy = cy;
1257 pDWP->winPos[i].flags &= flags | ~(SWP_NOSIZE | SWP_NOMOVE |
1258 SWP_NOZORDER | SWP_NOREDRAW |
1259 SWP_NOACTIVATE | SWP_NOCOPYBITS|
1260 SWP_NOOWNERZORDER);
1261 pDWP->winPos[i].flags |= flags & (SWP_SHOWWINDOW | SWP_HIDEWINDOW |
1262 SWP_FRAMECHANGED);
1263 retvalue = hdwp;
1264 goto END;
1267 if (pDWP->actualCount >= pDWP->suggestedCount)
1269 newhdwp = USER_HEAP_REALLOC( hdwp,
1270 sizeof(DWP) + pDWP->suggestedCount*sizeof(WINDOWPOS) );
1271 if (!newhdwp)
1273 retvalue = 0;
1274 goto END;
1276 pDWP = (DWP *) USER_HEAP_LIN_ADDR( newhdwp );
1277 pDWP->suggestedCount++;
1279 pDWP->winPos[pDWP->actualCount].hwnd = hwnd;
1280 pDWP->winPos[pDWP->actualCount].hwndInsertAfter = hwndAfter;
1281 pDWP->winPos[pDWP->actualCount].x = x;
1282 pDWP->winPos[pDWP->actualCount].y = y;
1283 pDWP->winPos[pDWP->actualCount].cx = cx;
1284 pDWP->winPos[pDWP->actualCount].cy = cy;
1285 pDWP->winPos[pDWP->actualCount].flags = flags;
1286 pDWP->actualCount++;
1287 retvalue = newhdwp;
1288 END:
1289 USER_Unlock();
1290 return retvalue;
1294 /***********************************************************************
1295 * EndDeferWindowPos (USER32.@)
1297 BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
1299 DWP *pDWP;
1300 WINDOWPOS *winpos;
1301 BOOL res = TRUE;
1302 int i;
1304 pDWP = (DWP *) USER_HEAP_LIN_ADDR( hdwp );
1305 if (!pDWP) return FALSE;
1306 for (i = 0, winpos = pDWP->winPos; i < pDWP->actualCount; i++, winpos++)
1308 if (!(res = USER_Driver.pSetWindowPos( winpos ))) break;
1310 USER_HEAP_FREE( hdwp );
1311 return res;
1315 /***********************************************************************
1316 * TileChildWindows (USER.199)
1318 void WINAPI TileChildWindows16( HWND16 parent, WORD action )
1320 FIXME("(%04x, %d): stub\n", parent, action);
1323 /***********************************************************************
1324 * CascadeChildWindows (USER.198)
1326 void WINAPI CascadeChildWindows16( HWND16 parent, WORD action )
1328 FIXME("(%04x, %d): stub\n", parent, action);
1331 /***********************************************************************
1332 * SetProgmanWindow (USER32.@)
1334 HWND WINAPI SetProgmanWindow ( HWND hwnd )
1336 hGlobalProgmanWindow = hwnd;
1337 return hGlobalProgmanWindow;
1340 /***********************************************************************
1341 * GetProgmanWindow (USER32.@)
1343 HWND WINAPI GetProgmanWindow(void)
1345 return hGlobalProgmanWindow;
1348 /***********************************************************************
1349 * SetShellWindowEx (USER32.@)
1350 * hwndProgman = Progman[Program Manager]
1351 * |-> SHELLDLL_DefView
1352 * hwndListView = | |-> SysListView32
1353 * | | |-> tooltips_class32
1354 * | |
1355 * | |-> SysHeader32
1357 * |-> ProxyTarget
1359 HWND WINAPI SetShellWindowEx ( HWND hwndProgman, HWND hwndListView )
1361 FIXME("0x%08x 0x%08x stub\n",hwndProgman ,hwndListView );
1362 hGlobalShellWindow = hwndProgman;
1363 return hGlobalShellWindow;
1367 /***********************************************************************
1368 * SetTaskmanWindow (USER32.@)
1369 * NOTES
1370 * hwnd = MSTaskSwWClass
1371 * |-> SysTabControl32
1373 HWND WINAPI SetTaskmanWindow ( HWND hwnd )
1375 hGlobalTaskmanWindow = hwnd;
1376 return hGlobalTaskmanWindow;
1379 /***********************************************************************
1380 * GetTaskmanWindow (USER32.@)
1382 HWND WINAPI GetTaskmanWindow(void)
1384 return hGlobalTaskmanWindow;