3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS user32.dll
5 * FILE: lib/user32/windows/window.c
6 * PURPOSE: Window management
7 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
9 * 06-06-2001 CSH Created
12 /* INCLUDES ******************************************************************/
17 #include <user32/callback.h>
18 #include <user32/regcontrol.h>
19 #include <user32/wininternal.h>
25 /* FUNCTIONS *****************************************************************/
28 WinPosShowIconTitle(HWND hWnd, BOOL bShow)
30 PINTERNALPOS lpPos = UserGetInternalPos(hWnd);
34 HWND hWnd = lpPos->IconTitle;
37 lpPos->IconTitle = hWnd = NULL; /*ICONTITLE_Create( pWnd );*/
40 ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
41 if( !(Style & WS_VISIBLE) )
43 SendMessageA( hWnd, WM_SHOWWINDOW, TRUE, 0 );
44 SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
45 SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
48 else ShowWindow( hWnd, SW_HIDE );
54 WinPosGetMinMaxInfo(HWND hWnd, POINT* MaxSize, POINT* MaxPos,
55 POINT* MinTrack, POINT* MaxTrack)
60 ULONG Style = GetWindowLongW(hWnd, GWL_STYLE);
61 ULONG ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
63 /* Get default values. */
64 MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
65 MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
66 MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
67 MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
68 MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN);
69 MinMax.ptMaxTrackSize.y = GetSystemMetrics(SM_CYSCREEN);
71 if (UserHasDlgFrameStyle(Style, ExStyle))
73 XInc = GetSystemMetrics(SM_CXDLGFRAME);
74 YInc = GetSystemMetrics(SM_CYDLGFRAME);
79 if (UserHasThickFrameStyle(Style, ExStyle))
81 XInc += GetSystemMetrics(SM_CXFRAME);
82 YInc += GetSystemMetrics(SM_CYFRAME);
84 if (Style & WS_BORDER)
86 XInc += GetSystemMetrics(SM_CXBORDER);
87 YInc += GetSystemMetrics(SM_CYBORDER);
90 MinMax.ptMaxSize.x += 2 * XInc;
91 MinMax.ptMaxSize.y += 2 * YInc;
93 Pos = UserGetInternalPos(hWnd);
96 MinMax.ptMaxPosition = Pos->MaxPos;
100 MinMax.ptMaxPosition.x -= XInc;
101 MinMax.ptMaxPosition.y -= YInc;
104 SendMessageW(hWnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
106 MinMax.ptMaxTrackSize.x = max(MinMax.ptMaxTrackSize.x,
107 MinMax.ptMinTrackSize.x);
108 MinMax.ptMaxTrackSize.y = max(MinMax.ptMaxTrackSize.y,
109 MinMax.ptMinTrackSize.y);
111 if (MaxSize) *MaxSize = MinMax.ptMaxSize;
112 if (MaxPos) *MaxPos = MinMax.ptMaxPosition;
113 if (MinTrack) *MinTrack = MinMax.ptMinTrackSize;
114 if (MaxTrack) *MaxTrack = MinMax.ptMaxTrackSize;
116 return 0; //FIXME: what does it return?
124 GetActiveWindow(VOID)
126 return(NtUserGetActiveWindow());
133 SetActiveWindow(HWND hWnd)
135 return(NtUserSetActiveWindow(hWnd));