blob: d64a269bd65d0ce87dd9479865ccbc86740bab19 [file] [log] [blame]
Alexandre Julliard5f721f81994-01-04 20:14:34 +00001/*
2 * Window position related functions.
3 *
Alexandre Julliard22945d51995-03-02 17:44:29 +00004 * Copyright 1993, 1994, 1995 Alexandre Julliard
Alex Korobka4f1ac051999-03-28 09:37:57 +00005 * 1995, 1996, 1999 Alex Korobka
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00006 *
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.
11 *
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.
16 *
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
Alexandre Julliard5f721f81994-01-04 20:14:34 +000020 */
21
Steven Edwardscfcc4492003-11-26 22:29:30 +000022#include "config.h"
23#include "wine/port.h"
24
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000025#include <stdarg.h>
Alexandre Julliarddadf78f1998-05-17 17:13:43 +000026#include <string.h>
Francois Jacques5b6879c2000-07-28 23:04:54 +000027#include "winerror.h"
Jeremy Whited3e22d92000-02-10 19:03:02 +000028#include "windef.h"
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000029#include "winbase.h"
Jeremy Whited3e22d92000-02-10 19:03:02 +000030#include "wingdi.h"
Slava Monichcdbe6442000-07-08 12:44:09 +000031#include "winerror.h"
Michael Veksler9d14a001999-05-08 12:40:24 +000032#include "wine/winuser16.h"
Alexandre Julliardfb0ff052001-10-16 21:58:58 +000033#include "wine/server.h"
Alexandre Julliard91222da2000-12-10 23:01:33 +000034#include "controls.h"
Alexandre Julliarddba420a1994-02-02 06:48:31 +000035#include "user.h"
Alexandre Julliard5f721f81994-01-04 20:14:34 +000036#include "win.h"
Alexandre Julliard8d24ae61994-04-05 21:42:43 +000037#include "message.h"
Alexandre Julliardaca05781994-10-17 18:12:41 +000038#include "winpos.h"
Alexandre Julliard22945d51995-03-02 17:44:29 +000039#include "nonclient.h"
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000040#include "wine/debug.h"
Alexandre Julliard5f721f81994-01-04 20:14:34 +000041
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000042WINE_DEFAULT_DEBUG_CHANNEL(win);
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000043
Alexandre Julliard23946ad1997-06-16 17:43:53 +000044#define HAS_DLGFRAME(style,exStyle) \
45 (((exStyle) & WS_EX_DLGMODALFRAME) || \
46 (((style) & WS_DLGFRAME) && !((style) & WS_BORDER)))
47
48#define HAS_THICKFRAME(style) \
49 (((style) & WS_THICKFRAME) && \
50 !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
51
Alexandre Julliard23946ad1997-06-16 17:43:53 +000052#define EMPTYPOINT(pt) ((*(LONG*)&(pt)) == -1)
53
54#define PLACE_MIN 0x0001
55#define PLACE_MAX 0x0002
56#define PLACE_RECT 0x0004
57
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +000058
59#define DWP_MAGIC ((INT)('W' | ('P' << 8) | ('O' << 16) | ('S' << 24)))
60
61typedef struct
62{
63 INT actualCount;
64 INT suggestedCount;
65 BOOL valid;
66 INT wMagic;
67 HWND hwndParent;
68 WINDOWPOS winPos[1];
69} DWP;
70
Alexandre Julliardd4719651995-12-12 18:49:11 +000071/* ----- internal variables ----- */
72
Alexandre Julliard23946ad1997-06-16 17:43:53 +000073static LPCSTR atomInternalPos;
74
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +000075
76/***********************************************************************
Alexandre Julliard23946ad1997-06-16 17:43:53 +000077 * WINPOS_CreateInternalPosAtom
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +000078 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000079BOOL WINPOS_CreateInternalPosAtom()
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +000080{
Daniel Marmier03486492003-10-06 21:03:32 +000081 LPCSTR str = "SysIP";
Alexandre Julliarda3960291999-02-26 11:11:13 +000082 atomInternalPos = (LPCSTR)(DWORD)GlobalAddAtomA(str);
Alexandre Julliard23946ad1997-06-16 17:43:53 +000083 return (atomInternalPos) ? TRUE : FALSE;
84}
85
86/***********************************************************************
87 * WINPOS_CheckInternalPos
88 *
89 * Called when a window is destroyed.
90 */
Alexandre Julliardde424282001-08-10 22:51:42 +000091void WINPOS_CheckInternalPos( HWND hwnd )
Alexandre Julliard23946ad1997-06-16 17:43:53 +000092{
Alexandre Julliard5030bda2002-10-11 23:41:06 +000093 LPINTERNALPOS lpPos = (LPINTERNALPOS) GetPropA( hwnd, atomInternalPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +000094
95 if( lpPos )
96 {
Vincent BĂ©ron9a624912002-05-31 23:06:46 +000097 if( IsWindow(lpPos->hwndIconTitle) )
Alexandre Julliarda3960291999-02-26 11:11:13 +000098 DestroyWindow( lpPos->hwndIconTitle );
Alexandre Julliardda2892c2001-02-23 01:13:42 +000099 HeapFree( GetProcessHeap(), 0, lpPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000100 }
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +0000101}
102
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000103/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000104 * ArrangeIconicWindows (USER32.@)
Alexandre Julliard22945d51995-03-02 17:44:29 +0000105 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000106UINT WINAPI ArrangeIconicWindows( HWND parent )
Alexandre Julliard22945d51995-03-02 17:44:29 +0000107{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000108 RECT rectParent;
109 HWND hwndChild;
110 INT x, y, xspacing, yspacing;
Alexandre Julliard22945d51995-03-02 17:44:29 +0000111
Alexandre Julliarda3960291999-02-26 11:11:13 +0000112 GetClientRect( parent, &rectParent );
Alexandre Julliard22945d51995-03-02 17:44:29 +0000113 x = rectParent.left;
114 y = rectParent.bottom;
Marcus Meissnerddca3151999-05-22 11:33:23 +0000115 xspacing = GetSystemMetrics(SM_CXICONSPACING);
116 yspacing = GetSystemMetrics(SM_CYICONSPACING);
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000117
Alexandre Julliarda3960291999-02-26 11:11:13 +0000118 hwndChild = GetWindow( parent, GW_CHILD );
Alexandre Julliard22945d51995-03-02 17:44:29 +0000119 while (hwndChild)
120 {
Alexandre Julliarda3960291999-02-26 11:11:13 +0000121 if( IsIconic( hwndChild ) )
Alexandre Julliard22945d51995-03-02 17:44:29 +0000122 {
Alexandre Julliardde424282001-08-10 22:51:42 +0000123 WINPOS_ShowIconTitle( hwndChild, FALSE );
124
Marcus Meissnerddca3151999-05-22 11:33:23 +0000125 SetWindowPos( hwndChild, 0, x + (xspacing - GetSystemMetrics(SM_CXICON)) / 2,
126 y - yspacing - GetSystemMetrics(SM_CYICON)/2, 0, 0,
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000127 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
Alexandre Julliarda3960291999-02-26 11:11:13 +0000128 if( IsWindow(hwndChild) )
Alexandre Julliardde424282001-08-10 22:51:42 +0000129 WINPOS_ShowIconTitle(hwndChild , TRUE );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000130
Alexandre Julliard22945d51995-03-02 17:44:29 +0000131 if (x <= rectParent.right - xspacing) x += xspacing;
132 else
133 {
134 x = rectParent.left;
135 y -= yspacing;
136 }
137 }
Alexandre Julliarda3960291999-02-26 11:11:13 +0000138 hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
Alexandre Julliard22945d51995-03-02 17:44:29 +0000139 }
140 return yspacing;
141}
142
143
144/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000145 * SwitchToThisWindow (USER32.@)
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000146 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000147void WINAPI SwitchToThisWindow( HWND hwnd, BOOL restore )
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000148{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000149 ShowWindow( hwnd, restore ? SW_RESTORE : SW_SHOWMINIMIZED );
Alexandre Julliarddf2673b1997-03-29 17:20:20 +0000150}
151
152
153/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000154 * GetWindowRect (USER32.@)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000155 */
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000156BOOL WINAPI GetWindowRect( HWND hwnd, LPRECT rect )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000157{
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000158 BOOL ret = WIN_GetRectangles( hwnd, rect, NULL );
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000159 if (ret)
160 {
161 MapWindowPoints( GetAncestor( hwnd, GA_PARENT ), 0, (POINT *)rect, 2 );
Dan Kegel0fd521f2003-01-08 21:09:25 +0000162 TRACE( "hwnd %p (%ld,%ld)-(%ld,%ld)\n",
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000163 hwnd, rect->left, rect->top, rect->right, rect->bottom);
164 }
165 return ret;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000166}
167
168
169/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000170 * GetWindowRgn (USER32.@)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000171 */
Francois Jacques5b6879c2000-07-28 23:04:54 +0000172int WINAPI GetWindowRgn ( HWND hwnd, HRGN hrgn )
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000173{
Francois Jacques5b6879c2000-07-28 23:04:54 +0000174 int nRet = ERROR;
Alexandre Julliardddc33172001-10-22 19:08:33 +0000175 WND *wndPtr = WIN_GetPtr( hwnd );
176
177 if (wndPtr == WND_OTHER_PROCESS)
Francois Jacques5b6879c2000-07-28 23:04:54 +0000178 {
Alexandre Julliardddc33172001-10-22 19:08:33 +0000179 if (IsWindow( hwnd ))
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000180 FIXME( "not supported on other process window %p\n", hwnd );
Alexandre Julliardddc33172001-10-22 19:08:33 +0000181 wndPtr = NULL;
Francois Jacques5b6879c2000-07-28 23:04:54 +0000182 }
Alexandre Julliardddc33172001-10-22 19:08:33 +0000183 if (!wndPtr)
184 {
185 SetLastError( ERROR_INVALID_WINDOW_HANDLE );
186 return ERROR;
187 }
188 if (wndPtr->hrgnWnd) nRet = CombineRgn( hrgn, wndPtr->hrgnWnd, 0, RGN_COPY );
189 WIN_ReleasePtr( wndPtr );
Francois Jacques5b6879c2000-07-28 23:04:54 +0000190 return nRet;
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000191}
192
Alexandre Julliardddc33172001-10-22 19:08:33 +0000193
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000194/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000195 * SetWindowRgn (USER32.@)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000196 */
Francois Jacques5b6879c2000-07-28 23:04:54 +0000197int WINAPI SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL bRedraw )
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000198{
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +0000199 RECT rect;
200 WND *wndPtr;
Alexandre Julliardddc33172001-10-22 19:08:33 +0000201
202 if (hrgn) /* verify that region really exists */
203 {
204 if (GetRgnBox( hrgn, &rect ) == ERROR) return FALSE;
205 }
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000206
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +0000207 if (USER_Driver.pSetWindowRgn)
208 return USER_Driver.pSetWindowRgn( hwnd, hrgn, bRedraw );
Francois Jacques5b6879c2000-07-28 23:04:54 +0000209
Alexandre Julliardddc33172001-10-22 19:08:33 +0000210 if ((wndPtr = WIN_GetPtr( hwnd )) == WND_OTHER_PROCESS)
211 {
212 if (IsWindow( hwnd ))
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000213 FIXME( "not supported on other process window %p\n", hwnd );
Alexandre Julliardddc33172001-10-22 19:08:33 +0000214 wndPtr = NULL;
215 }
216 if (!wndPtr)
217 {
218 SetLastError( ERROR_INVALID_WINDOW_HANDLE );
219 return FALSE;
220 }
Francois Jacques5b6879c2000-07-28 23:04:54 +0000221
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +0000222 if (wndPtr->hrgnWnd == hrgn)
Francois Jacques5b6879c2000-07-28 23:04:54 +0000223 {
Alexandre Julliardddc33172001-10-22 19:08:33 +0000224 WIN_ReleasePtr( wndPtr );
225 return TRUE;
Francois Jacques5b6879c2000-07-28 23:04:54 +0000226 }
227
James Hatheway34899972000-09-12 23:59:57 +0000228 if (wndPtr->hrgnWnd)
229 {
230 /* delete previous region */
231 DeleteObject(wndPtr->hrgnWnd);
232 wndPtr->hrgnWnd = 0;
233 }
James Hatheway34899972000-09-12 23:59:57 +0000234 wndPtr->hrgnWnd = hrgn;
Alexandre Julliardddc33172001-10-22 19:08:33 +0000235 WIN_ReleasePtr( wndPtr );
Francois Jacques5b6879c2000-07-28 23:04:54 +0000236
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +0000237 /* Size the window to the rectangle of the new region (if it isn't NULL) */
238 if (hrgn) SetWindowPos( hwnd, 0, rect.left, rect.top,
239 rect.right - rect.left, rect.bottom - rect.top,
240 SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOACTIVATE |
241 SWP_NOZORDER | (bRedraw ? 0 : SWP_NOREDRAW) );
Alexandre Julliardddc33172001-10-22 19:08:33 +0000242 return TRUE;
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000243}
244
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000245
246/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000247 * GetClientRect (USER32.@)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000248 */
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000249BOOL WINAPI GetClientRect( HWND hwnd, LPRECT rect )
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000250{
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000251 BOOL ret;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000252
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000253 rect->right = rect->bottom = 0;
254 if ((ret = WIN_GetRectangles( hwnd, NULL, rect )))
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000255 {
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000256 rect->right -= rect->left;
257 rect->bottom -= rect->top;
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000258 }
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000259 rect->left = rect->top = 0;
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000260 return ret;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000261}
262
263
264/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000265 * ClientToScreen (USER32.@)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000266 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000267BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000268{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000269 MapWindowPoints( hwnd, 0, lppnt, 1 );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000270 return TRUE;
271}
272
273
274/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000275 * ScreenToClient (USER32.@)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000276 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000277BOOL WINAPI ScreenToClient( HWND hwnd, LPPOINT lppnt )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000278{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000279 MapWindowPoints( 0, hwnd, lppnt, 1 );
Eric Pouechb9544f11999-02-14 14:09:42 +0000280 return TRUE;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000281}
282
283
Alexandre Julliard0c126c71996-02-18 18:44:41 +0000284/***********************************************************************
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000285 * find_child_from_point
286 *
287 * Find the child that contains pt. Helper for WindowFromPoint.
288 * pt is in parent client coordinates.
289 * lparam is the param to pass in the WM_NCHITTEST message.
290 */
291static HWND find_child_from_point( HWND parent, POINT pt, INT *hittest, LPARAM lparam )
292{
293 int i, res;
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000294 LONG style, exstyle;
295 RECT rectWindow, rectClient;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000296 WND *wndPtr;
297 HWND *list = WIN_ListChildren( parent );
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000298 HWND retvalue = 0;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000299
300 if (!list) return 0;
301 for (i = 0; list[i]; i++)
302 {
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000303 /* If point is in window, and window is visible, and it */
304 /* is enabled (or it's a top-level window), then explore */
305 /* its children. Otherwise, go to the next window. */
306
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000307 style = GetWindowLongW( list[i], GWL_STYLE );
308 if (!(style & WS_VISIBLE)) continue; /* not visible -> skip */
309 if ((style & (WS_POPUP | WS_CHILD | WS_DISABLED)) == (WS_CHILD | WS_DISABLED))
310 continue; /* disabled child -> skip */
311 exstyle = GetWindowLongW( list[i], GWL_EXSTYLE );
312 if ((exstyle & (WS_EX_LAYERED | WS_EX_TRANSPARENT)) == (WS_EX_LAYERED | WS_EX_TRANSPARENT))
313 continue; /* transparent -> skip */
314
315 if (!WIN_GetRectangles( list[i], &rectWindow, &rectClient )) continue;
316 if (!PtInRect( &rectWindow, pt )) continue; /* not in window -> skip */
317
318 /* FIXME: check window region for other processes too */
319 if ((wndPtr = WIN_GetPtr( list[i] )) && wndPtr != WND_OTHER_PROCESS)
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000320 {
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000321 if (wndPtr->hrgnWnd && !PtInRegion( wndPtr->hrgnWnd,
322 pt.x - rectWindow.left, pt.y - rectWindow.top ))
323 {
324 WIN_ReleasePtr( wndPtr );
325 continue; /* point outside window region -> skip */
326 }
327 WIN_ReleasePtr( wndPtr );
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000328 }
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000329
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000330 /* If window is minimized or disabled, return at once */
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000331 if (style & WS_MINIMIZE)
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000332 {
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000333 *hittest = HTCAPTION;
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000334 retvalue = list[i];
335 break;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000336 }
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000337 if (style & WS_DISABLED)
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000338 {
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000339 *hittest = HTERROR;
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000340 retvalue = list[i];
341 break;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000342 }
343
344 /* If point is in client area, explore children */
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000345 if (PtInRect( &rectClient, pt ))
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000346 {
347 POINT new_pt;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000348
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000349 new_pt.x = pt.x - rectClient.left;
350 new_pt.y = pt.y - rectClient.top;
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000351 if ((retvalue = find_child_from_point( list[i], new_pt, hittest, lparam ))) break;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000352 }
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000353
354 /* Now it's inside window, send WM_NCCHITTEST (if same thread) */
355 if (!WIN_IsCurrentThread( list[i] ))
356 {
357 *hittest = HTCLIENT;
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000358 retvalue = list[i];
359 break;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000360 }
361 if ((res = SendMessageA( list[i], WM_NCHITTEST, 0, lparam )) != HTTRANSPARENT)
362 {
363 *hittest = res; /* Found the window */
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000364 retvalue = list[i];
365 break;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000366 }
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000367 /* continue search with next sibling */
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000368 }
Andreas Mohr284bcfc2002-05-28 22:47:01 +0000369 HeapFree( GetProcessHeap(), 0, list );
370 return retvalue;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000371}
372
373
374/***********************************************************************
Alexandre Julliard0c126c71996-02-18 18:44:41 +0000375 * WINPOS_WindowFromPoint
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000376 *
Alexandre Julliard0c126c71996-02-18 18:44:41 +0000377 * Find the window and hittest for a given point.
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000378 */
Alexandre Julliardee8ab7a2001-06-20 23:16:34 +0000379HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest )
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000380{
Alexandre Julliard5db8d2f2001-05-22 19:55:20 +0000381 POINT xy = pt;
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000382 int res;
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000383 LONG style;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000384
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000385 TRACE("scope %p %ld,%ld\n", hwndScope, pt.x, pt.y);
Alexandre Julliardee8ab7a2001-06-20 23:16:34 +0000386
387 if (!hwndScope) hwndScope = GetDesktopWindow();
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000388 style = GetWindowLongW( hwndScope, GWL_STYLE );
Alexandre Julliardee8ab7a2001-06-20 23:16:34 +0000389
390 *hittest = HTERROR;
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000391 if (style & WS_DISABLED) return 0;
392
393 MapWindowPoints( GetDesktopWindow(), GetAncestor( hwndScope, GA_PARENT ), &xy, 1 );
394
395 if (!(style & WS_MINIMIZE))
Susan Farleyb3f8a632000-07-08 18:28:25 +0000396 {
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000397 RECT rectClient;
398 if (WIN_GetRectangles( hwndScope, NULL, &rectClient ) && PtInRect( &rectClient, xy ))
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000399 {
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000400 HWND ret;
401
402 xy.x -= rectClient.left;
403 xy.y -= rectClient.top;
404 if ((ret = find_child_from_point( hwndScope, xy, hittest, MAKELONG( pt.x, pt.y ) )))
405 {
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000406 TRACE( "found child %p\n", ret );
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000407 return ret;
408 }
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000409 }
Alexandre Julliard0c126c71996-02-18 18:44:41 +0000410 }
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000411
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000412 /* If nothing found, try the scope window */
413 if (!WIN_IsCurrentThread( hwndScope ))
414 {
415 *hittest = HTCLIENT;
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000416 TRACE( "returning %p\n", hwndScope );
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000417 return hwndScope;
418 }
419 res = SendMessageA( hwndScope, WM_NCHITTEST, 0, MAKELONG( pt.x, pt.y ) );
420 if (res != HTTRANSPARENT)
421 {
422 *hittest = res; /* Found the window */
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000423 TRACE( "returning %p\n", hwndScope );
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000424 return hwndScope;
425 }
426 *hittest = HTNOWHERE;
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000427 TRACE( "nothing found\n" );
Alexandre Julliard80593bf2001-10-11 20:49:40 +0000428 return 0;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000429}
430
431
432/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000433 * WindowFromPoint (USER32.@)
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +0000434 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000435HWND WINAPI WindowFromPoint( POINT pt )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000436{
Alexandre Julliardee8ab7a2001-06-20 23:16:34 +0000437 INT hittest;
438 return WINPOS_WindowFromPoint( 0, pt, &hittest );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000439}
440
441
442/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000443 * ChildWindowFromPoint (USER32.@)
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000444 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000445HWND WINAPI ChildWindowFromPoint( HWND hwndParent, POINT pt )
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000446{
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000447 return ChildWindowFromPointEx( hwndParent, pt, CWP_ALL );
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +0000448}
449
Paul Quinneede6b01998-11-30 13:15:36 +0000450/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000451 * ChildWindowFromPointEx (USER32.@)
Paul Quinneede6b01998-11-30 13:15:36 +0000452 */
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000453HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
Paul Quinneede6b01998-11-30 13:15:36 +0000454{
455 /* pt is in the client coordinates */
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000456 HWND *list;
457 int i;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000458 RECT rect;
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000459 HWND retvalue;
Paul Quinneede6b01998-11-30 13:15:36 +0000460
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000461 GetClientRect( hwndParent, &rect );
462 if (!PtInRect( &rect, pt )) return 0;
Alexandre Julliard9d9dac02001-08-24 19:28:21 +0000463 if (!(list = WIN_ListChildren( hwndParent ))) return 0;
Paul Quinneede6b01998-11-30 13:15:36 +0000464
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000465 for (i = 0; list[i]; i++)
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000466 {
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000467 if (!WIN_GetRectangles( list[i], &rect, NULL )) continue;
468 if (!PtInRect( &rect, pt )) continue;
469 if (uFlags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED))
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000470 {
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000471 LONG style = GetWindowLongW( list[i], GWL_STYLE );
472 if ((uFlags & CWP_SKIPINVISIBLE) && !(style & WS_VISIBLE)) continue;
473 if ((uFlags & CWP_SKIPDISABLED) && (style & WS_DISABLED)) continue;
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000474 }
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000475 if (uFlags & CWP_SKIPTRANSPARENT)
476 {
477 if (GetWindowLongW( list[i], GWL_EXSTYLE ) & WS_EX_TRANSPARENT) continue;
478 }
479 break;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000480 }
Alexandre Julliard5797fbb2001-12-06 22:33:58 +0000481 retvalue = list[i];
Alexandre Julliard9d9dac02001-08-24 19:28:21 +0000482 HeapFree( GetProcessHeap(), 0, list );
Alexandre Julliard0801ffc2001-08-24 00:26:59 +0000483 if (!retvalue) retvalue = hwndParent;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000484 return retvalue;
Paul Quinneede6b01998-11-30 13:15:36 +0000485}
486
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000487
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +0000488/*******************************************************************
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000489 * WINPOS_GetWinOffset
490 *
491 * Calculate the offset between the origin of the two windows. Used
492 * to implement MapWindowPoints.
493 */
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000494static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000495{
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000496 WND * wndPtr;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000497
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000498 offset->x = offset->y = 0;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000499
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000500 /* Translate source window origin to screen coords */
Alexandre Julliard59730ae1996-03-24 16:20:51 +0000501 if (hwndFrom)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000502 {
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000503 HWND hwnd = hwndFrom;
504
505 while (hwnd)
Alexandre Julliard59730ae1996-03-24 16:20:51 +0000506 {
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000507 if (hwnd == hwndTo) return;
508 if (!(wndPtr = WIN_GetPtr( hwnd )))
Alexandre Julliard556607a2001-10-10 20:28:17 +0000509 {
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000510 ERR( "bad hwndFrom = %p\n", hwnd );
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000511 return;
Alexandre Julliard556607a2001-10-10 20:28:17 +0000512 }
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000513 if (wndPtr == WND_OTHER_PROCESS) goto other_process;
514 offset->x += wndPtr->rectClient.left;
515 offset->y += wndPtr->rectClient.top;
516 hwnd = wndPtr->parent;
517 WIN_ReleasePtr( wndPtr );
Alexandre Julliard59730ae1996-03-24 16:20:51 +0000518 }
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000519 }
520
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000521 /* Translate origin to destination window coords */
Alexandre Julliard59730ae1996-03-24 16:20:51 +0000522 if (hwndTo)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000523 {
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000524 HWND hwnd = hwndTo;
525
526 while (hwnd)
Alexandre Julliard59730ae1996-03-24 16:20:51 +0000527 {
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000528 if (!(wndPtr = WIN_GetPtr( hwnd )))
Alexandre Julliard556607a2001-10-10 20:28:17 +0000529 {
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000530 ERR( "bad hwndTo = %p\n", hwnd );
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000531 return;
Alexandre Julliard556607a2001-10-10 20:28:17 +0000532 }
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000533 if (wndPtr == WND_OTHER_PROCESS) goto other_process;
534 offset->x -= wndPtr->rectClient.left;
535 offset->y -= wndPtr->rectClient.top;
536 hwnd = wndPtr->parent;
537 WIN_ReleasePtr( wndPtr );
Alexandre Julliard556607a2001-10-10 20:28:17 +0000538 }
Alexandre Julliard59730ae1996-03-24 16:20:51 +0000539 }
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000540 return;
541
542 other_process: /* one of the parents may belong to another process, do it the hard way */
543 offset->x = offset->y = 0;
544 SERVER_START_REQ( get_windows_offset )
545 {
546 req->from = hwndFrom;
547 req->to = hwndTo;
Alexandre Julliard9caa71e2001-11-30 18:46:42 +0000548 if (!wine_server_call( req ))
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000549 {
Alexandre Julliard9caa71e2001-11-30 18:46:42 +0000550 offset->x = reply->x;
551 offset->y = reply->y;
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000552 }
553 }
554 SERVER_END_REQ;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000555}
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000556
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000557
558/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000559 * MapWindowPoints (USER.258)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000560 */
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000561void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo,
562 LPPOINT16 lppt, UINT16 count )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000563{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000564 POINT offset;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000565
Alexandre Julliardf44bbb82001-09-14 00:24:39 +0000566 WINPOS_GetWinOffset( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), &offset );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000567 while (count--)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000568 {
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000569 lppt->x += offset.x;
570 lppt->y += offset.y;
571 lppt++;
572 }
573}
574
575
576/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000577 * MapWindowPoints (USER32.@)
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000578 */
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000579INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000580{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000581 POINT offset;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000582
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000583 WINPOS_GetWinOffset( hwndFrom, hwndTo, &offset );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000584 while (count--)
585 {
586 lppt->x += offset.x;
587 lppt->y += offset.y;
588 lppt++;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000589 }
Eric Pouechb9544f11999-02-14 14:09:42 +0000590 return MAKELONG( LOWORD(offset.x), LOWORD(offset.y) );
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000591}
592
593
594/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000595 * IsIconic (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000596 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000597BOOL WINAPI IsIconic(HWND hWnd)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000598{
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000599 return (GetWindowLongW( hWnd, GWL_STYLE ) & WS_MINIMIZE) != 0;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000600}
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000601
602
Alexandre Julliard01d63461997-01-20 19:43:45 +0000603/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000604 * IsZoomed (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000605 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000606BOOL WINAPI IsZoomed(HWND hWnd)
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000607{
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000608 return (GetWindowLongW( hWnd, GWL_STYLE ) & WS_MAXIMIZE) != 0;
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000609}
610
611
Alexandre Julliarddba420a1994-02-02 06:48:31 +0000612/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000613 * AllowSetForegroundWindow (USER32.@)
David Elliott44f84b52000-10-29 01:24:54 +0000614 */
615BOOL WINAPI AllowSetForegroundWindow( DWORD procid )
616{
617 /* FIXME: If Win98/2000 style SetForegroundWindow behavior is
618 * implemented, then fix this function. */
619 return TRUE;
620}
621
622
623/*******************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000624 * LockSetForegroundWindow (USER32.@)
David Elliott44f84b52000-10-29 01:24:54 +0000625 */
626BOOL WINAPI LockSetForegroundWindow( UINT lockcode )
627{
628 /* FIXME: If Win98/2000 style SetForegroundWindow behavior is
629 * implemented, then fix this function. */
630 return TRUE;
631}
632
633
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000634/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000635 * BringWindowToTop (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000636 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000637BOOL WINAPI BringWindowToTop( HWND hwnd )
Alexandre Julliard01d63461997-01-20 19:43:45 +0000638{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000639 return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +0000640}
641
642
643/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000644 * MoveWindow (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000645 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000646BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
647 BOOL repaint )
Vincent BĂ©ron9a624912002-05-31 23:06:46 +0000648{
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000649 int flags = SWP_NOZORDER | SWP_NOACTIVATE;
650 if (!repaint) flags |= SWP_NOREDRAW;
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000651 TRACE("%p %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint );
Alexandre Julliarda3960291999-02-26 11:11:13 +0000652 return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000653}
654
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000655/***********************************************************************
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000656 * WINPOS_InitInternalPos
657 */
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000658static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *restoreRect )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000659{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000660 LPINTERNALPOS lpPos = (LPINTERNALPOS) GetPropA( wnd->hwndSelf,
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000661 atomInternalPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000662 if( !lpPos )
663 {
Vincent BĂ©ron9a624912002-05-31 23:06:46 +0000664 /* this happens when the window is minimized/maximized
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000665 * for the first time (rectWindow is not adjusted yet) */
666
Alexandre Julliardda2892c2001-02-23 01:13:42 +0000667 lpPos = HeapAlloc( GetProcessHeap(), 0, sizeof(INTERNALPOS) );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000668 if( !lpPos ) return NULL;
669
Alexandre Julliarda3960291999-02-26 11:11:13 +0000670 SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000671 lpPos->hwndIconTitle = 0; /* defer until needs to be shown */
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000672 CONV_RECT32TO16( &wnd->rectWindow, &lpPos->rectNormal );
Alexandre Julliarda3960291999-02-26 11:11:13 +0000673 *(UINT*)&lpPos->ptIconPos = *(UINT*)&lpPos->ptMaxPos = 0xFFFFFFFF;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000674 }
675
Vincent BĂ©ron9a624912002-05-31 23:06:46 +0000676 if( wnd->dwStyle & WS_MINIMIZE )
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000677 CONV_POINT32TO16( &pt, &lpPos->ptIconPos );
Vincent BĂ©ron9a624912002-05-31 23:06:46 +0000678 else if( wnd->dwStyle & WS_MAXIMIZE )
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000679 CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );
Vincent BĂ©ron9a624912002-05-31 23:06:46 +0000680 else if( restoreRect )
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000681 CONV_RECT32TO16( restoreRect, &lpPos->rectNormal );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000682
683 return lpPos;
684}
685
686/***********************************************************************
687 * WINPOS_RedrawIconTitle
688 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000689BOOL WINPOS_RedrawIconTitle( HWND hWnd )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000690{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000691 LPINTERNALPOS lpPos = (LPINTERNALPOS)GetPropA( hWnd, atomInternalPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000692 if( lpPos )
693 {
694 if( lpPos->hwndIconTitle )
695 {
Alexandre Julliarda3960291999-02-26 11:11:13 +0000696 SendMessageA( lpPos->hwndIconTitle, WM_SHOWWINDOW, TRUE, 0);
697 InvalidateRect( lpPos->hwndIconTitle, NULL, TRUE );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000698 return TRUE;
699 }
700 }
701 return FALSE;
702}
703
704/***********************************************************************
705 * WINPOS_ShowIconTitle
706 */
Alexandre Julliardde424282001-08-10 22:51:42 +0000707BOOL WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000708{
Alexandre Julliardde424282001-08-10 22:51:42 +0000709 LPINTERNALPOS lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000710
Alexandre Julliardde424282001-08-10 22:51:42 +0000711 if( lpPos && !(GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_MANAGED))
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000712 {
Alexandre Julliardde424282001-08-10 22:51:42 +0000713 HWND title = lpPos->hwndIconTitle;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000714
Alexandre Julliardaff7dda2002-11-22 21:22:14 +0000715 TRACE("%p %i\n", hwnd, (bShow != 0) );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000716
Alexandre Julliardde424282001-08-10 22:51:42 +0000717 if( !title )
718 lpPos->hwndIconTitle = title = ICONTITLE_Create( hwnd );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000719 if( bShow )
720 {
Alexandre Julliardde424282001-08-10 22:51:42 +0000721 if (!IsWindowVisible(title))
722 {
723 SendMessageA( title, WM_SHOWWINDOW, TRUE, 0 );
724 SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
725 SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
726 }
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000727 }
Alexandre Julliardde424282001-08-10 22:51:42 +0000728 else ShowWindow( title, SW_HIDE );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000729 }
730 return FALSE;
731}
732
733/*******************************************************************
734 * WINPOS_GetMinMaxInfo
735 *
736 * Get the minimized and maximized information for a window.
737 */
Alexandre Julliardde424282001-08-10 22:51:42 +0000738void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000739 POINT *minTrack, POINT *maxTrack )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000740{
741 LPINTERNALPOS lpPos;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000742 MINMAXINFO MinMax;
743 INT xinc, yinc;
Alexandre Julliardde424282001-08-10 22:51:42 +0000744 LONG style = GetWindowLongA( hwnd, GWL_STYLE );
745 LONG exstyle = GetWindowLongA( hwnd, GWL_EXSTYLE );
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +0000746 RECT rc;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000747
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000748 /* Compute default values */
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000749
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +0000750 GetWindowRect(hwnd, &rc);
751 MinMax.ptReserved.x = rc.left;
752 MinMax.ptReserved.y = rc.top;
753
754 if (style & WS_CHILD)
755 {
Dmitry Timoshkov80422fb2004-05-07 00:41:32 +0000756 if ((style & WS_CAPTION) == WS_CAPTION)
757 style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
758
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +0000759 GetClientRect(GetParent(hwnd), &rc);
Dmitry Timoshkov80422fb2004-05-07 00:41:32 +0000760 AdjustWindowRectEx(&rc, style, 0, exstyle);
761
762 /* avoid calculating this twice */
763 style &= ~(WS_DLGFRAME | WS_BORDER | WS_THICKFRAME);
764
765 MinMax.ptMaxSize.x = rc.right - rc.left;
766 MinMax.ptMaxSize.y = rc.bottom - rc.top;
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +0000767 }
768 else
769 {
770 MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
771 MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
772 }
Marcus Meissnerddca3151999-05-22 11:33:23 +0000773 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
774 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
775 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN);
776 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN);
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000777
Alexandre Julliardde424282001-08-10 22:51:42 +0000778 if (HAS_DLGFRAME( style, exstyle ))
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000779 {
Marcus Meissnerddca3151999-05-22 11:33:23 +0000780 xinc = GetSystemMetrics(SM_CXDLGFRAME);
781 yinc = GetSystemMetrics(SM_CYDLGFRAME);
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000782 }
783 else
784 {
785 xinc = yinc = 0;
Alexandre Julliardde424282001-08-10 22:51:42 +0000786 if (HAS_THICKFRAME(style))
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000787 {
Marcus Meissnerddca3151999-05-22 11:33:23 +0000788 xinc += GetSystemMetrics(SM_CXFRAME);
789 yinc += GetSystemMetrics(SM_CYFRAME);
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000790 }
Alexandre Julliardde424282001-08-10 22:51:42 +0000791 if (style & WS_BORDER)
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000792 {
Marcus Meissnerddca3151999-05-22 11:33:23 +0000793 xinc += GetSystemMetrics(SM_CXBORDER);
794 yinc += GetSystemMetrics(SM_CYBORDER);
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000795 }
796 }
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000797 MinMax.ptMaxSize.x += 2 * xinc;
798 MinMax.ptMaxSize.y += 2 * yinc;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000799
Alexandre Julliardde424282001-08-10 22:51:42 +0000800 lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000801 if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) )
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000802 CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000803 else
804 {
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000805 MinMax.ptMaxPosition.x = -xinc;
806 MinMax.ptMaxPosition.y = -yinc;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000807 }
808
Alexandre Julliardde424282001-08-10 22:51:42 +0000809 SendMessageA( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000810
811 /* Some sanity checks */
812
Alexandre Julliard359f497e1999-07-04 16:02:24 +0000813 TRACE("%ld %ld / %ld %ld / %ld %ld / %ld %ld\n",
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000814 MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
815 MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
816 MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
817 MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y);
Francois Gouget6d77d3a2000-03-25 21:44:35 +0000818 MinMax.ptMaxTrackSize.x = max( MinMax.ptMaxTrackSize.x,
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000819 MinMax.ptMinTrackSize.x );
Francois Gouget6d77d3a2000-03-25 21:44:35 +0000820 MinMax.ptMaxTrackSize.y = max( MinMax.ptMaxTrackSize.y,
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000821 MinMax.ptMinTrackSize.y );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000822
Alexandre Julliardd37eb361997-07-20 16:23:21 +0000823 if (maxSize) *maxSize = MinMax.ptMaxSize;
824 if (maxPos) *maxPos = MinMax.ptMaxPosition;
825 if (minTrack) *minTrack = MinMax.ptMinTrackSize;
826 if (maxTrack) *maxTrack = MinMax.ptMaxTrackSize;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000827}
828
829/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000830 * ShowWindowAsync (USER32.@)
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000831 *
832 * doesn't wait; returns immediately.
833 * used by threads to toggle windows in other (possibly hanging) threads
834 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000835BOOL WINAPI ShowWindowAsync( HWND hwnd, INT cmd )
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000836{
Alexandre Julliardc07a6cf2002-10-29 21:33:00 +0000837 HWND full_handle;
838
Alexandre Julliardd0af1232003-05-19 19:00:02 +0000839 if (is_broadcast(hwnd))
840 {
841 SetLastError( ERROR_INVALID_PARAMETER );
842 return FALSE;
843 }
844
Alexandre Julliardc07a6cf2002-10-29 21:33:00 +0000845 if ((full_handle = WIN_IsCurrentThread( hwnd )))
846 return USER_Driver.pShowWindow( full_handle, cmd );
847 return SendNotifyMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 );
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000848}
849
850
851/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000852 * ShowWindow (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000853 */
Alexandre Julliarddc4fe772001-06-04 21:55:17 +0000854BOOL WINAPI ShowWindow( HWND hwnd, INT cmd )
855{
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000856 HWND full_handle;
857
Alexandre Julliardd0af1232003-05-19 19:00:02 +0000858 if (is_broadcast(hwnd))
859 {
860 SetLastError( ERROR_INVALID_PARAMETER );
861 return FALSE;
862 }
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000863 if ((full_handle = WIN_IsCurrentThread( hwnd )))
Alexandre Julliardd0af1232003-05-19 19:00:02 +0000864 {
865 if (USER_Driver.pShowWindow)
866 return USER_Driver.pShowWindow( full_handle, cmd );
867 return FALSE;
868 }
Alexandre Julliardfb0ff052001-10-16 21:58:58 +0000869 return SendMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 );
Alexandre Julliard5f721f81994-01-04 20:14:34 +0000870}
871
872
873/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000874 * GetInternalWindowPos (USER32.@)
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +0000875 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000876UINT WINAPI GetInternalWindowPos( HWND hwnd, LPRECT rectWnd,
877 LPPOINT ptIcon )
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +0000878{
Alexandre Julliarda3960291999-02-26 11:11:13 +0000879 WINDOWPLACEMENT wndpl;
880 if (GetWindowPlacement( hwnd, &wndpl ))
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000881 {
882 if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
883 if (ptIcon) *ptIcon = wndpl.ptMinPosition;
884 return wndpl.showCmd;
885 }
886 return 0;
887}
888
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000889
890/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000891 * GetWindowPlacement (USER32.@)
Alexandre Julliard638f1691999-01-17 16:32:32 +0000892 *
893 * Win95:
894 * Fails if wndpl->length of Win95 (!) apps is invalid.
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000895 */
Alexandre Julliardd23a82b2001-09-19 20:37:04 +0000896BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000897{
Alexandre Julliardd23a82b2001-09-19 20:37:04 +0000898 WND *pWnd = WIN_FindWndPtr( hwnd );
899 LPINTERNALPOS lpPos;
900
901 if(!pWnd ) return FALSE;
902
903 lpPos = WINPOS_InitInternalPos( pWnd, *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
904 wndpl->length = sizeof(*wndpl);
905 if( pWnd->dwStyle & WS_MINIMIZE )
906 wndpl->showCmd = SW_SHOWMINIMIZED;
907 else
908 wndpl->showCmd = ( pWnd->dwStyle & WS_MAXIMIZE ) ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL ;
909 if( pWnd->flags & WIN_RESTORE_MAX )
910 wndpl->flags = WPF_RESTORETOMAXIMIZED;
911 else
912 wndpl->flags = 0;
913 CONV_POINT16TO32( &lpPos->ptIconPos, &wndpl->ptMinPosition );
914 CONV_POINT16TO32( &lpPos->ptMaxPos, &wndpl->ptMaxPosition );
915 CONV_RECT16TO32( &lpPos->rectNormal, &wndpl->rcNormalPosition );
916 WIN_ReleaseWndPtr(pWnd);
917 return TRUE;
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000918}
919
920
921/***********************************************************************
922 * WINPOS_SetPlacement
923 */
Alexandre Julliardd23a82b2001-09-19 20:37:04 +0000924static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT flags )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000925{
926 WND *pWnd = WIN_FindWndPtr( hwnd );
927 if( pWnd )
928 {
929 LPINTERNALPOS lpPos = (LPINTERNALPOS)WINPOS_InitInternalPos( pWnd,
Alexandre Julliarda3960291999-02-26 11:11:13 +0000930 *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000931
Alexandre Julliardd23a82b2001-09-19 20:37:04 +0000932 if( flags & PLACE_MIN ) CONV_POINT32TO16( &wndpl->ptMinPosition, &lpPos->ptIconPos );
933 if( flags & PLACE_MAX ) CONV_POINT32TO16( &wndpl->ptMaxPosition, &lpPos->ptMaxPos );
934 if( flags & PLACE_RECT) CONV_RECT32TO16( &wndpl->rcNormalPosition, &lpPos->rectNormal );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000935
936 if( pWnd->dwStyle & WS_MINIMIZE )
937 {
Alexandre Julliardde424282001-08-10 22:51:42 +0000938 WINPOS_ShowIconTitle( pWnd->hwndSelf, FALSE );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000939 if( wndpl->flags & WPF_SETMINPOSITION && !EMPTYPOINT(lpPos->ptIconPos))
Alexandre Julliarda3960291999-02-26 11:11:13 +0000940 SetWindowPos( hwnd, 0, lpPos->ptIconPos.x, lpPos->ptIconPos.y,
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000941 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
Vincent BĂ©ron9a624912002-05-31 23:06:46 +0000942 }
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000943 else if( pWnd->dwStyle & WS_MAXIMIZE )
944 {
945 if( !EMPTYPOINT(lpPos->ptMaxPos) )
Alexandre Julliarda3960291999-02-26 11:11:13 +0000946 SetWindowPos( hwnd, 0, lpPos->ptMaxPos.x, lpPos->ptMaxPos.y,
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000947 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
948 }
949 else if( flags & PLACE_RECT )
Alexandre Julliarda3960291999-02-26 11:11:13 +0000950 SetWindowPos( hwnd, 0, lpPos->rectNormal.left, lpPos->rectNormal.top,
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000951 lpPos->rectNormal.right - lpPos->rectNormal.left,
952 lpPos->rectNormal.bottom - lpPos->rectNormal.top,
953 SWP_NOZORDER | SWP_NOACTIVATE );
954
Alexandre Julliarda3960291999-02-26 11:11:13 +0000955 ShowWindow( hwnd, wndpl->showCmd );
956 if( IsWindow(hwnd) && pWnd->dwStyle & WS_MINIMIZE )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000957 {
Alexandre Julliardde424282001-08-10 22:51:42 +0000958 if( pWnd->dwStyle & WS_VISIBLE ) WINPOS_ShowIconTitle( pWnd->hwndSelf, TRUE );
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000959
960 /* SDK: ...valid only the next time... */
961 if( wndpl->flags & WPF_RESTORETOMAXIMIZED ) pWnd->flags |= WIN_RESTORE_MAX;
962 }
Francois Boisvert6b1b41c1999-03-14 17:25:32 +0000963 WIN_ReleaseWndPtr(pWnd);
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000964 return TRUE;
965 }
966 return FALSE;
967}
968
969
970/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +0000971 * SetWindowPlacement (USER32.@)
Alexandre Julliard638f1691999-01-17 16:32:32 +0000972 *
973 * Win95:
974 * Fails if wndpl->length of Win95 (!) apps is invalid.
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000975 */
Alexandre Julliardd23a82b2001-09-19 20:37:04 +0000976BOOL WINAPI SetWindowPlacement( HWND hwnd, const WINDOWPLACEMENT *wpl )
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000977{
Alexandre Julliardd23a82b2001-09-19 20:37:04 +0000978 if (!wpl) return FALSE;
979 return WINPOS_SetPlacement( hwnd, wpl, PLACE_MIN | PLACE_MAX | PLACE_RECT );
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +0000980}
981
982
983/***********************************************************************
Bobby Binghamdb4aae22001-06-06 20:20:09 +0000984 * AnimateWindow (USER32.@)
985 * Shows/Hides a window with an animation
986 * NO ANIMATION YET
987 */
988BOOL WINAPI AnimateWindow(HWND hwnd, DWORD dwTime, DWORD dwFlags)
989{
990 FIXME("partial stub\n");
991
992 /* If trying to show/hide and it's already *
993 * shown/hidden or invalid window, fail with *
994 * invalid parameter */
995 if(!IsWindow(hwnd) ||
996 (IsWindowVisible(hwnd) && !(dwFlags & AW_HIDE)) ||
997 (!IsWindowVisible(hwnd) && (dwFlags & AW_HIDE)))
998 {
999 SetLastError(ERROR_INVALID_PARAMETER);
1000 return FALSE;
1001 }
1002
1003 ShowWindow(hwnd, (dwFlags & AW_HIDE) ? SW_HIDE : ((dwFlags & AW_ACTIVATE) ? SW_SHOW : SW_SHOWNA));
1004
1005 return TRUE;
1006}
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +00001007
1008/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001009 * SetInternalWindowPos (USER32.@)
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +00001010 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001011void WINAPI SetInternalWindowPos( HWND hwnd, UINT showCmd,
1012 LPRECT rect, LPPOINT pt )
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001013{
Alexandre Julliarda3960291999-02-26 11:11:13 +00001014 if( IsWindow(hwnd) )
Alexandre Julliard23946ad1997-06-16 17:43:53 +00001015 {
Alexandre Julliardd23a82b2001-09-19 20:37:04 +00001016 WINDOWPLACEMENT wndpl;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001017 UINT flags;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001018
Alexandre Julliard23946ad1997-06-16 17:43:53 +00001019 wndpl.length = sizeof(wndpl);
1020 wndpl.showCmd = showCmd;
1021 wndpl.flags = flags = 0;
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001022
Alexandre Julliard23946ad1997-06-16 17:43:53 +00001023 if( pt )
1024 {
1025 flags |= PLACE_MIN;
1026 wndpl.flags |= WPF_SETMINPOSITION;
Alexandre Julliardd23a82b2001-09-19 20:37:04 +00001027 wndpl.ptMinPosition = *pt;
Alexandre Julliard23946ad1997-06-16 17:43:53 +00001028 }
1029 if( rect )
1030 {
1031 flags |= PLACE_RECT;
Alexandre Julliardd23a82b2001-09-19 20:37:04 +00001032 wndpl.rcNormalPosition = *rect;
Alexandre Julliard23946ad1997-06-16 17:43:53 +00001033 }
1034 WINPOS_SetPlacement( hwnd, &wndpl, flags );
1035 }
Alexandre Julliarde2bfa4c1996-05-16 18:21:06 +00001036}
1037
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001038
Alexandre Julliardd4719651995-12-12 18:49:11 +00001039/*******************************************************************
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001040 * can_activate_window
Alexandre Julliarddba420a1994-02-02 06:48:31 +00001041 *
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001042 * Check if we can activate the specified window.
Alexandre Julliarddba420a1994-02-02 06:48:31 +00001043 */
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001044static BOOL can_activate_window( HWND hwnd )
Alexandre Julliarddba420a1994-02-02 06:48:31 +00001045{
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001046 LONG style;
Noel Borthwickb4278561999-02-05 10:37:53 +00001047
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001048 if (!hwnd) return FALSE;
1049 style = GetWindowLongW( hwnd, GWL_STYLE );
1050 if (!(style & WS_VISIBLE)) return FALSE;
1051 if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
1052 return !(style & WS_DISABLED);
Alexandre Julliardd4719651995-12-12 18:49:11 +00001053}
1054
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001055
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +00001056/*******************************************************************
1057 * WINPOS_ActivateOtherWindow
1058 *
Alexandre Julliard670cdc41997-08-24 16:00:30 +00001059 * Activates window other than pWnd.
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +00001060 */
Alexandre Julliard03e07b52001-11-06 22:28:18 +00001061void WINPOS_ActivateOtherWindow(HWND hwnd)
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +00001062{
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001063 HWND hwndTo, fg;
Noel Borthwickb4278561999-02-05 10:37:53 +00001064
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001065 if ((GetWindowLongW( hwnd, GWL_STYLE ) & WS_POPUP) && (hwndTo = GetWindow( hwnd, GW_OWNER )))
Noel Borthwickb4278561999-02-05 10:37:53 +00001066 {
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001067 hwndTo = GetAncestor( hwndTo, GA_ROOT );
1068 if (can_activate_window( hwndTo )) goto done;
Noel Borthwickb4278561999-02-05 10:37:53 +00001069 }
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +00001070
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001071 hwndTo = hwnd;
1072 for (;;)
Alexandre Julliardde424282001-08-10 22:51:42 +00001073 {
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001074 if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break;
1075 if (can_activate_window( hwndTo )) break;
Alexandre Julliardde424282001-08-10 22:51:42 +00001076 }
Alexandre Julliard2c69f6d1996-09-28 18:11:01 +00001077
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001078 done:
1079 fg = GetForegroundWindow();
Alexandre Julliardaff7dda2002-11-22 21:22:14 +00001080 TRACE("win = %p fg = %p\n", hwndTo, fg);
Alexandre Julliard5030bda2002-10-11 23:41:06 +00001081 if (!fg || (hwnd == fg))
1082 {
1083 if (SetForegroundWindow( hwndTo )) return;
1084 }
1085 if (!SetActiveWindow( hwndTo )) SetActiveWindow(0);
Alexandre Julliarddba420a1994-02-02 06:48:31 +00001086}
1087
1088
Alexandre Julliard86a8d0f1994-01-18 23:04:40 +00001089/***********************************************************************
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001090 * WINPOS_HandleWindowPosChanging16
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001091 *
1092 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
1093 */
Alexandre Julliardde424282001-08-10 22:51:42 +00001094LONG WINPOS_HandleWindowPosChanging16( HWND hwnd, WINDOWPOS16 *winpos )
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001095{
Dmitry Timoshkov80422fb2004-05-07 00:41:32 +00001096 POINT minTrack, maxTrack;
1097 LONG style = GetWindowLongW( hwnd, GWL_STYLE );
Alexandre Julliardde424282001-08-10 22:51:42 +00001098
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001099 if (winpos->flags & SWP_NOSIZE) return 0;
Alexandre Julliardde424282001-08-10 22:51:42 +00001100 if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001101 {
Dmitry Timoshkov80422fb2004-05-07 00:41:32 +00001102 WINPOS_GetMinMaxInfo( hwnd, NULL, NULL, &minTrack, &maxTrack );
1103 if (winpos->cx > maxTrack.x) winpos->cx = maxTrack.x;
1104 if (winpos->cy > maxTrack.y) winpos->cy = maxTrack.y;
Alexandre Julliardde424282001-08-10 22:51:42 +00001105 if (!(style & WS_MINIMIZE))
Alexandre Julliard77b99181997-09-14 17:17:23 +00001106 {
1107 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
1108 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
1109 }
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001110 }
1111 return 0;
1112}
1113
1114
1115/***********************************************************************
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001116 * WINPOS_HandleWindowPosChanging
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001117 *
1118 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc().
1119 */
Alexandre Julliardde424282001-08-10 22:51:42 +00001120LONG WINPOS_HandleWindowPosChanging( HWND hwnd, WINDOWPOS *winpos )
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001121{
Dmitry Timoshkov80422fb2004-05-07 00:41:32 +00001122 POINT minTrack, maxTrack;
1123 LONG style = GetWindowLongW( hwnd, GWL_STYLE );
Alexandre Julliardde424282001-08-10 22:51:42 +00001124
Alexandre Julliard2d93d001996-05-21 15:01:41 +00001125 if (winpos->flags & SWP_NOSIZE) return 0;
Alexandre Julliardde424282001-08-10 22:51:42 +00001126 if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001127 {
Dmitry Timoshkov80422fb2004-05-07 00:41:32 +00001128 WINPOS_GetMinMaxInfo( hwnd, NULL, NULL, &minTrack, &maxTrack );
1129 if (winpos->cx > maxTrack.x) winpos->cx = maxTrack.x;
1130 if (winpos->cy > maxTrack.y) winpos->cy = maxTrack.y;
Alexandre Julliardde424282001-08-10 22:51:42 +00001131 if (!(style & WS_MINIMIZE))
Gerard Patelcc3e0c52000-12-18 03:10:42 +00001132 {
1133 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x;
1134 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y;
1135 }
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001136 }
1137 return 0;
1138}
1139
Alexandre Julliard01d63461997-01-20 19:43:45 +00001140
1141/***********************************************************************
Dmitry Timoshkov85350c82002-08-27 01:14:44 +00001142 * dump_winpos_flags
1143 */
1144static void dump_winpos_flags(UINT flags)
1145{
1146 TRACE("flags:");
Tony Lambregts7ce3a5a2003-03-14 04:11:17 +00001147 if(flags & SWP_NOSIZE) TRACE(" SWP_NOSIZE");
1148 if(flags & SWP_NOMOVE) TRACE(" SWP_NOMOVE");
1149 if(flags & SWP_NOZORDER) TRACE(" SWP_NOZORDER");
1150 if(flags & SWP_NOREDRAW) TRACE(" SWP_NOREDRAW");
1151 if(flags & SWP_NOACTIVATE) TRACE(" SWP_NOACTIVATE");
1152 if(flags & SWP_FRAMECHANGED) TRACE(" SWP_FRAMECHANGED");
1153 if(flags & SWP_SHOWWINDOW) TRACE(" SWP_SHOWWINDOW");
1154 if(flags & SWP_HIDEWINDOW) TRACE(" SWP_HIDEWINDOW");
1155 if(flags & SWP_NOCOPYBITS) TRACE(" SWP_NOCOPYBITS");
1156 if(flags & SWP_NOOWNERZORDER) TRACE(" SWP_NOOWNERZORDER");
1157 if(flags & SWP_NOSENDCHANGING) TRACE(" SWP_NOSENDCHANGING");
1158 if(flags & SWP_DEFERERASE) TRACE(" SWP_DEFERERASE");
1159 if(flags & SWP_ASYNCWINDOWPOS) TRACE(" SWP_ASYNCWINDOWPOS");
Dmitry Timoshkov85350c82002-08-27 01:14:44 +00001160
1161#define DUMPED_FLAGS \
1162 (SWP_NOSIZE | \
1163 SWP_NOMOVE | \
1164 SWP_NOZORDER | \
1165 SWP_NOREDRAW | \
1166 SWP_NOACTIVATE | \
1167 SWP_FRAMECHANGED | \
1168 SWP_SHOWWINDOW | \
1169 SWP_HIDEWINDOW | \
1170 SWP_NOCOPYBITS | \
1171 SWP_NOOWNERZORDER | \
1172 SWP_NOSENDCHANGING | \
1173 SWP_DEFERERASE | \
1174 SWP_ASYNCWINDOWPOS)
1175
Tony Lambregts7ce3a5a2003-03-14 04:11:17 +00001176 if(flags & ~DUMPED_FLAGS) TRACE(" %08x", flags & ~DUMPED_FLAGS);
1177 TRACE("\n");
Dmitry Timoshkov85350c82002-08-27 01:14:44 +00001178#undef DUMPED_FLAGS
1179}
1180
1181/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001182 * SetWindowPos (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +00001183 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001184BOOL WINAPI SetWindowPos( HWND hwnd, HWND hwndInsertAfter,
Ulrich Weigand7f53c571999-06-18 17:03:13 +00001185 INT x, INT y, INT cx, INT cy, UINT flags )
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001186{
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +00001187 WINDOWPOS winpos;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001188
Alexandre Julliardaff7dda2002-11-22 21:22:14 +00001189 TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
1190 hwnd, hwndInsertAfter, x, y, cx, cy, flags);
Dmitry Timoshkov85350c82002-08-27 01:14:44 +00001191 if(TRACE_ON(win)) dump_winpos_flags(flags);
1192
Alexandre Julliardd0af1232003-05-19 19:00:02 +00001193 if (is_broadcast(hwnd))
1194 {
1195 SetLastError( ERROR_INVALID_PARAMETER );
1196 return FALSE;
1197 }
1198
Alexandre Julliardcf2e57d2002-10-31 22:06:53 +00001199 winpos.hwnd = WIN_GetFullHandle(hwnd);
1200 winpos.hwndInsertAfter = WIN_GetFullHandle(hwndInsertAfter);
Alexandre Julliardd37eb361997-07-20 16:23:21 +00001201 winpos.x = x;
1202 winpos.y = y;
1203 winpos.cx = cx;
1204 winpos.cy = cy;
1205 winpos.flags = flags;
Alexandre Julliardfb0ff052001-10-16 21:58:58 +00001206 if (WIN_IsCurrentThread( hwnd )) return USER_Driver.pSetWindowPos( &winpos );
1207 return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001208}
1209
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +00001210
Alexandre Julliard2d159fb1994-07-15 16:04:31 +00001211/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001212 * BeginDeferWindowPos (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +00001213 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001214HDWP WINAPI BeginDeferWindowPos( INT count )
Alexandre Julliard01d63461997-01-20 19:43:45 +00001215{
Alexandre Julliarda3960291999-02-26 11:11:13 +00001216 HDWP handle;
Alexandre Julliardaca05781994-10-17 18:12:41 +00001217 DWP *pDWP;
1218
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +00001219 TRACE("%d\n", count);
1220
Vincent BĂ©ron9a624912002-05-31 23:06:46 +00001221 if (count < 0)
Slava Monichcdbe6442000-07-08 12:44:09 +00001222 {
1223 SetLastError(ERROR_INVALID_PARAMETER);
1224 return 0;
1225 }
1226 /* Windows allows zero count, in which case it allocates context for 8 moves */
1227 if (count == 0) count = 8;
1228
Alexandre Julliarda3960291999-02-26 11:11:13 +00001229 handle = USER_HEAP_ALLOC( sizeof(DWP) + (count-1)*sizeof(WINDOWPOS) );
Alexandre Julliardaca05781994-10-17 18:12:41 +00001230 if (!handle) return 0;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001231 pDWP = (DWP *) USER_HEAP_LIN_ADDR( handle );
Alexandre Julliardaca05781994-10-17 18:12:41 +00001232 pDWP->actualCount = 0;
1233 pDWP->suggestedCount = count;
1234 pDWP->valid = TRUE;
1235 pDWP->wMagic = DWP_MAGIC;
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001236 pDWP->hwndParent = 0;
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +00001237
1238 TRACE("returning hdwp %p\n", handle);
Alexandre Julliardaca05781994-10-17 18:12:41 +00001239 return handle;
1240}
1241
1242
1243/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001244 * DeferWindowPos (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +00001245 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001246HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
1247 INT x, INT y, INT cx, INT cy,
1248 UINT flags )
Alexandre Julliardaca05781994-10-17 18:12:41 +00001249{
1250 DWP *pDWP;
1251 int i;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001252 HDWP newhdwp = hdwp,retvalue;
Alexandre Julliardaca05781994-10-17 18:12:41 +00001253
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +00001254 TRACE("hdwp %p, hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
1255 hdwp, hwnd, hwndAfter, x, y, cx, cy, flags);
1256
Alexandre Julliardf44bbb82001-09-14 00:24:39 +00001257 hwnd = WIN_GetFullHandle( hwnd );
Alexandre Julliarda3960291999-02-26 11:11:13 +00001258 if (hwnd == GetDesktopWindow()) return 0;
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001259
Alexandre Julliardf44bbb82001-09-14 00:24:39 +00001260 if (!(pDWP = USER_HEAP_LIN_ADDR( hdwp ))) return 0;
1261
Alexandre Julliardfb0ff052001-10-16 21:58:58 +00001262 USER_Lock();
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001263
Alexandre Julliardaca05781994-10-17 18:12:41 +00001264 for (i = 0; i < pDWP->actualCount; i++)
1265 {
1266 if (pDWP->winPos[i].hwnd == hwnd)
1267 {
1268 /* Merge with the other changes */
1269 if (!(flags & SWP_NOZORDER))
1270 {
Alexandre Julliardcf2e57d2002-10-31 22:06:53 +00001271 pDWP->winPos[i].hwndInsertAfter = WIN_GetFullHandle(hwndAfter);
Alexandre Julliardaca05781994-10-17 18:12:41 +00001272 }
1273 if (!(flags & SWP_NOMOVE))
1274 {
1275 pDWP->winPos[i].x = x;
1276 pDWP->winPos[i].y = y;
Alexandre Julliardfb0ff052001-10-16 21:58:58 +00001277 }
Alexandre Julliardaca05781994-10-17 18:12:41 +00001278 if (!(flags & SWP_NOSIZE))
1279 {
1280 pDWP->winPos[i].cx = cx;
1281 pDWP->winPos[i].cy = cy;
1282 }
Alexandre Julliard17216f51997-10-12 16:30:17 +00001283 pDWP->winPos[i].flags &= flags | ~(SWP_NOSIZE | SWP_NOMOVE |
1284 SWP_NOZORDER | SWP_NOREDRAW |
1285 SWP_NOACTIVATE | SWP_NOCOPYBITS|
1286 SWP_NOOWNERZORDER);
Alexandre Julliardaca05781994-10-17 18:12:41 +00001287 pDWP->winPos[i].flags |= flags & (SWP_SHOWWINDOW | SWP_HIDEWINDOW |
1288 SWP_FRAMECHANGED);
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001289 retvalue = hdwp;
1290 goto END;
Alexandre Julliardaca05781994-10-17 18:12:41 +00001291 }
1292 }
1293 if (pDWP->actualCount >= pDWP->suggestedCount)
1294 {
1295 newhdwp = USER_HEAP_REALLOC( hdwp,
Alexandre Julliarda3960291999-02-26 11:11:13 +00001296 sizeof(DWP) + pDWP->suggestedCount*sizeof(WINDOWPOS) );
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001297 if (!newhdwp)
1298 {
1299 retvalue = 0;
1300 goto END;
1301 }
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001302 pDWP = (DWP *) USER_HEAP_LIN_ADDR( newhdwp );
Alexandre Julliardaca05781994-10-17 18:12:41 +00001303 pDWP->suggestedCount++;
1304 }
1305 pDWP->winPos[pDWP->actualCount].hwnd = hwnd;
1306 pDWP->winPos[pDWP->actualCount].hwndInsertAfter = hwndAfter;
1307 pDWP->winPos[pDWP->actualCount].x = x;
1308 pDWP->winPos[pDWP->actualCount].y = y;
1309 pDWP->winPos[pDWP->actualCount].cx = cx;
1310 pDWP->winPos[pDWP->actualCount].cy = cy;
1311 pDWP->winPos[pDWP->actualCount].flags = flags;
1312 pDWP->actualCount++;
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001313 retvalue = newhdwp;
1314END:
Alexandre Julliardfb0ff052001-10-16 21:58:58 +00001315 USER_Unlock();
Francois Boisvert6b1b41c1999-03-14 17:25:32 +00001316 return retvalue;
Alexandre Julliardaca05781994-10-17 18:12:41 +00001317}
1318
1319
1320/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001321 * EndDeferWindowPos (USER32.@)
Alexandre Julliard01d63461997-01-20 19:43:45 +00001322 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001323BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
Alexandre Julliardaca05781994-10-17 18:12:41 +00001324{
1325 DWP *pDWP;
Alexandre Julliarda3960291999-02-26 11:11:13 +00001326 WINDOWPOS *winpos;
1327 BOOL res = TRUE;
Alexandre Julliardaca05781994-10-17 18:12:41 +00001328 int i;
1329
Dmitry Timoshkovdfa1f6a2003-10-24 04:22:11 +00001330 TRACE("%p\n", hdwp);
1331
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001332 pDWP = (DWP *) USER_HEAP_LIN_ADDR( hdwp );
Alexandre Julliardaca05781994-10-17 18:12:41 +00001333 if (!pDWP) return FALSE;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +00001334 for (i = 0, winpos = pDWP->winPos; i < pDWP->actualCount; i++, winpos++)
Alexandre Julliardaca05781994-10-17 18:12:41 +00001335 {
Alexandre Julliard9ae0fe52001-04-24 23:28:52 +00001336 if (!(res = USER_Driver.pSetWindowPos( winpos ))) break;
Alexandre Julliardaca05781994-10-17 18:12:41 +00001337 }
1338 USER_HEAP_FREE( hdwp );
1339 return res;
1340}
1341
1342
1343/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001344 * TileChildWindows (USER.199)
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001345 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001346void WINAPI TileChildWindows16( HWND16 parent, WORD action )
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001347{
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001348 FIXME("(%04x, %d): stub\n", parent, action);
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001349}
1350
1351/***********************************************************************
Patrik Stridvall2ece70e2000-12-22 01:38:01 +00001352 * CascadeChildWindows (USER.198)
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001353 */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001354void WINAPI CascadeChildWindows16( HWND16 parent, WORD action )
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001355{
Alexandre Julliard359f497e1999-07-04 16:02:24 +00001356 FIXME("(%04x, %d): stub\n", parent, action);
Alexandre Julliard3a405ba1994-10-30 16:25:19 +00001357}