2 * 16-bit windowing functions
4 * Copyright 2001 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "wine/winuser16.h"
25 #include "user_private.h"
27 /* handle <--> handle16 conversions */
28 #define HANDLE_16(h32) (LOWORD(h32))
29 #define HANDLE_32(h16) ((HANDLE)(ULONG_PTR)(h16))
31 static HWND16 hwndSysModal
;
39 /* callback for 16-bit window enumeration functions */
40 static BOOL CALLBACK
wnd_enum_callback( HWND hwnd
, LPARAM param
)
42 const struct wnd_enum_info
*info
= (struct wnd_enum_info
*)param
;
46 args
[2] = HWND_16(hwnd
);
47 args
[1] = HIWORD(info
->param
);
48 args
[0] = LOWORD(info
->param
);
49 WOWCallback16Ex( (DWORD
)info
->proc
, WCB16_PASCAL
, sizeof(args
), args
, &ret
);
53 /* convert insert after window handle to 32-bit */
54 inline static HWND
full_insert_after_hwnd( HWND16 hwnd
)
56 HWND ret
= WIN_Handle32( hwnd
);
57 if (ret
== (HWND
)0xffff) ret
= HWND_TOPMOST
;
61 /**************************************************************************
64 INT16 WINAPI
MessageBox16( HWND16 hwnd
, LPCSTR text
, LPCSTR title
, UINT16 type
)
66 return MessageBoxA( WIN_Handle32(hwnd
), text
, title
, type
);
70 /***********************************************************************
73 UINT16 WINAPI
SetTimer16( HWND16 hwnd
, UINT16 id
, UINT16 timeout
, TIMERPROC16 proc
)
75 TIMERPROC proc32
= (TIMERPROC
)WINPROC_AllocProc( (WNDPROC
)proc
, WIN_PROC_16
);
76 return SetTimer( WIN_Handle32(hwnd
), id
, timeout
, proc32
);
80 /***********************************************************************
81 * SetSystemTimer (USER.11)
83 UINT16 WINAPI
SetSystemTimer16( HWND16 hwnd
, UINT16 id
, UINT16 timeout
, TIMERPROC16 proc
)
85 TIMERPROC proc32
= (TIMERPROC
)WINPROC_AllocProc( (WNDPROC
)proc
, WIN_PROC_16
);
86 return SetSystemTimer( WIN_Handle32(hwnd
), id
, timeout
, proc32
);
90 /**************************************************************************
93 BOOL16 WINAPI
KillTimer16( HWND16 hwnd
, UINT16 id
)
95 return KillTimer( WIN_Handle32(hwnd
), id
);
99 /**************************************************************************
100 * SetCapture (USER.18)
102 HWND16 WINAPI
SetCapture16( HWND16 hwnd
)
104 return HWND_16( SetCapture( WIN_Handle32(hwnd
) ));
108 /**************************************************************************
109 * ReleaseCapture (USER.19)
111 BOOL16 WINAPI
ReleaseCapture16(void)
113 return ReleaseCapture();
117 /**************************************************************************
120 HWND16 WINAPI
SetFocus16( HWND16 hwnd
)
122 return HWND_16( SetFocus( WIN_Handle32(hwnd
) ));
126 /**************************************************************************
129 HWND16 WINAPI
GetFocus16(void)
131 return HWND_16( GetFocus() );
135 /**************************************************************************
136 * RemoveProp (USER.24)
138 HANDLE16 WINAPI
RemoveProp16( HWND16 hwnd
, LPCSTR str
)
140 return HANDLE_16(RemovePropA( WIN_Handle32(hwnd
), str
));
144 /**************************************************************************
147 HANDLE16 WINAPI
GetProp16( HWND16 hwnd
, LPCSTR str
)
149 return HANDLE_16(GetPropA( WIN_Handle32(hwnd
), str
));
153 /**************************************************************************
156 BOOL16 WINAPI
SetProp16( HWND16 hwnd
, LPCSTR str
, HANDLE16 handle
)
158 return SetPropA( WIN_Handle32(hwnd
), str
, HANDLE_32(handle
) );
162 /**************************************************************************
163 * ClientToScreen (USER.28)
165 void WINAPI
ClientToScreen16( HWND16 hwnd
, LPPOINT16 lppnt
)
167 MapWindowPoints16( hwnd
, 0, lppnt
, 1 );
171 /**************************************************************************
172 * ScreenToClient (USER.29)
174 void WINAPI
ScreenToClient16( HWND16 hwnd
, LPPOINT16 lppnt
)
176 MapWindowPoints16( 0, hwnd
, lppnt
, 1 );
180 /**************************************************************************
181 * WindowFromPoint (USER.30)
183 HWND16 WINAPI
WindowFromPoint16( POINT16 pt
)
189 return HWND_16( WindowFromPoint( pt32
) );
193 /**************************************************************************
196 BOOL16 WINAPI
IsIconic16(HWND16 hwnd
)
198 return IsIconic( WIN_Handle32(hwnd
) );
202 /**************************************************************************
203 * GetWindowRect (USER.32)
205 void WINAPI
GetWindowRect16( HWND16 hwnd
, LPRECT16 rect
)
209 GetWindowRect( WIN_Handle32(hwnd
), &rect32
);
210 rect
->left
= rect32
.left
;
211 rect
->top
= rect32
.top
;
212 rect
->right
= rect32
.right
;
213 rect
->bottom
= rect32
.bottom
;
217 /**************************************************************************
218 * GetClientRect (USER.33)
220 void WINAPI
GetClientRect16( HWND16 hwnd
, LPRECT16 rect
)
224 GetClientRect( WIN_Handle32(hwnd
), &rect32
);
225 rect
->left
= rect32
.left
;
226 rect
->top
= rect32
.top
;
227 rect
->right
= rect32
.right
;
228 rect
->bottom
= rect32
.bottom
;
232 /**************************************************************************
233 * EnableWindow (USER.34)
235 BOOL16 WINAPI
EnableWindow16( HWND16 hwnd
, BOOL16 enable
)
237 return EnableWindow( WIN_Handle32(hwnd
), enable
);
241 /**************************************************************************
242 * IsWindowEnabled (USER.35)
244 BOOL16 WINAPI
IsWindowEnabled16(HWND16 hwnd
)
246 return IsWindowEnabled( WIN_Handle32(hwnd
) );
250 /**************************************************************************
251 * GetWindowText (USER.36)
253 INT16 WINAPI
GetWindowText16( HWND16 hwnd
, SEGPTR lpString
, INT16 nMaxCount
)
255 return SendMessage16( hwnd
, WM_GETTEXT
, nMaxCount
, lpString
);
259 /**************************************************************************
260 * SetWindowText (USER.37)
262 BOOL16 WINAPI
SetWindowText16( HWND16 hwnd
, SEGPTR lpString
)
264 return SendMessage16( hwnd
, WM_SETTEXT
, 0, (LPARAM
)lpString
);
268 /**************************************************************************
269 * GetWindowTextLength (USER.38)
271 INT16 WINAPI
GetWindowTextLength16( HWND16 hwnd
)
273 return SendMessage16( hwnd
, WM_GETTEXTLENGTH
, 0, 0 );
277 /***********************************************************************
278 * BeginPaint (USER.39)
280 HDC16 WINAPI
BeginPaint16( HWND16 hwnd
, LPPAINTSTRUCT16 lps
)
284 BeginPaint( WIN_Handle32(hwnd
), &ps
);
285 lps
->hdc
= HDC_16(ps
.hdc
);
286 lps
->fErase
= ps
.fErase
;
287 lps
->rcPaint
.top
= ps
.rcPaint
.top
;
288 lps
->rcPaint
.left
= ps
.rcPaint
.left
;
289 lps
->rcPaint
.right
= ps
.rcPaint
.right
;
290 lps
->rcPaint
.bottom
= ps
.rcPaint
.bottom
;
291 lps
->fRestore
= ps
.fRestore
;
292 lps
->fIncUpdate
= ps
.fIncUpdate
;
297 /***********************************************************************
300 BOOL16 WINAPI
EndPaint16( HWND16 hwnd
, const PAINTSTRUCT16
* lps
)
304 ps
.hdc
= HDC_32(lps
->hdc
);
305 return EndPaint( WIN_Handle32(hwnd
), &ps
);
309 /**************************************************************************
310 * ShowWindow (USER.42)
312 BOOL16 WINAPI
ShowWindow16( HWND16 hwnd
, INT16 cmd
)
314 return ShowWindow( WIN_Handle32(hwnd
), cmd
);
318 /**************************************************************************
319 * CloseWindow (USER.43)
321 BOOL16 WINAPI
CloseWindow16( HWND16 hwnd
)
323 return CloseWindow( WIN_Handle32(hwnd
) );
327 /**************************************************************************
330 BOOL16 WINAPI
OpenIcon16( HWND16 hwnd
)
332 return OpenIcon( WIN_Handle32(hwnd
) );
336 /**************************************************************************
337 * BringWindowToTop (USER.45)
339 BOOL16 WINAPI
BringWindowToTop16( HWND16 hwnd
)
341 return BringWindowToTop( WIN_Handle32(hwnd
) );
345 /**************************************************************************
346 * GetParent (USER.46)
348 HWND16 WINAPI
GetParent16( HWND16 hwnd
)
350 return HWND_16( GetParent( WIN_Handle32(hwnd
) ));
354 /**************************************************************************
357 BOOL16 WINAPI
IsWindow16( HWND16 hwnd
)
359 STACK16FRAME
*frame
= MapSL( (SEGPTR
)NtCurrentTeb()->WOW32Reserved
);
360 frame
->es
= USER_HeapSel
;
361 /* don't use WIN_Handle32 here, we don't care about the full handle */
362 return IsWindow( HWND_32(hwnd
) );
366 /**************************************************************************
369 BOOL16 WINAPI
IsChild16( HWND16 parent
, HWND16 child
)
371 return IsChild( WIN_Handle32(parent
), WIN_Handle32(child
) );
375 /**************************************************************************
376 * IsWindowVisible (USER.49)
378 BOOL16 WINAPI
IsWindowVisible16( HWND16 hwnd
)
380 return IsWindowVisible( WIN_Handle32(hwnd
) );
384 /**************************************************************************
385 * FindWindow (USER.50)
387 HWND16 WINAPI
FindWindow16( LPCSTR className
, LPCSTR title
)
389 return HWND_16( FindWindowA( className
, title
));
393 /**************************************************************************
394 * DestroyWindow (USER.53)
396 BOOL16 WINAPI
DestroyWindow16( HWND16 hwnd
)
398 return DestroyWindow( WIN_Handle32(hwnd
) );
402 /*******************************************************************
403 * EnumWindows (USER.54)
405 BOOL16 WINAPI
EnumWindows16( WNDENUMPROC16 func
, LPARAM lParam
)
407 struct wnd_enum_info info
;
411 return EnumWindows( wnd_enum_callback
, (LPARAM
)&info
);
415 /**********************************************************************
416 * EnumChildWindows (USER.55)
418 BOOL16 WINAPI
EnumChildWindows16( HWND16 parent
, WNDENUMPROC16 func
, LPARAM lParam
)
420 struct wnd_enum_info info
;
424 return EnumChildWindows( WIN_Handle32(parent
), wnd_enum_callback
, (LPARAM
)&info
);
428 /**************************************************************************
429 * MoveWindow (USER.56)
431 BOOL16 WINAPI
MoveWindow16( HWND16 hwnd
, INT16 x
, INT16 y
, INT16 cx
, INT16 cy
, BOOL16 repaint
)
433 return MoveWindow( WIN_Handle32(hwnd
), x
, y
, cx
, cy
, repaint
);
437 /***********************************************************************
438 * RegisterClass (USER.57)
440 ATOM WINAPI
RegisterClass16( const WNDCLASS16
*wc
)
444 wcex
.cbSize
= sizeof(wcex
);
445 wcex
.style
= wc
->style
;
446 wcex
.lpfnWndProc
= wc
->lpfnWndProc
;
447 wcex
.cbClsExtra
= wc
->cbClsExtra
;
448 wcex
.cbWndExtra
= wc
->cbWndExtra
;
449 wcex
.hInstance
= wc
->hInstance
;
450 wcex
.hIcon
= wc
->hIcon
;
451 wcex
.hCursor
= wc
->hCursor
;
452 wcex
.hbrBackground
= wc
->hbrBackground
;
453 wcex
.lpszMenuName
= wc
->lpszMenuName
;
454 wcex
.lpszClassName
= wc
->lpszClassName
;
456 return RegisterClassEx16( &wcex
);
460 /**************************************************************************
461 * GetClassName (USER.58)
463 INT16 WINAPI
GetClassName16( HWND16 hwnd
, LPSTR buffer
, INT16 count
)
465 return GetClassNameA( WIN_Handle32(hwnd
), buffer
, count
);
469 /**************************************************************************
470 * SetActiveWindow (USER.59)
472 HWND16 WINAPI
SetActiveWindow16( HWND16 hwnd
)
474 return HWND_16( SetActiveWindow( WIN_Handle32(hwnd
) ));
478 /**************************************************************************
479 * GetActiveWindow (USER.60)
481 HWND16 WINAPI
GetActiveWindow16(void)
483 return HWND_16( GetActiveWindow() );
487 /**************************************************************************
488 * ScrollWindow (USER.61)
490 void WINAPI
ScrollWindow16( HWND16 hwnd
, INT16 dx
, INT16 dy
, const RECT16
*rect
,
491 const RECT16
*clipRect
)
493 RECT rect32
, clipRect32
;
497 rect32
.left
= rect
->left
;
498 rect32
.top
= rect
->top
;
499 rect32
.right
= rect
->right
;
500 rect32
.bottom
= rect
->bottom
;
504 clipRect32
.left
= clipRect
->left
;
505 clipRect32
.top
= clipRect
->top
;
506 clipRect32
.right
= clipRect
->right
;
507 clipRect32
.bottom
= clipRect
->bottom
;
509 ScrollWindow( WIN_Handle32(hwnd
), dx
, dy
, rect
? &rect32
: NULL
,
510 clipRect
? &clipRect32
: NULL
);
514 /**************************************************************************
515 * SetScrollPos (USER.62)
517 INT16 WINAPI
SetScrollPos16( HWND16 hwnd
, INT16 nBar
, INT16 nPos
, BOOL16 redraw
)
519 return SetScrollPos( WIN_Handle32(hwnd
), nBar
, nPos
, redraw
);
523 /**************************************************************************
524 * GetScrollPos (USER.63)
526 INT16 WINAPI
GetScrollPos16( HWND16 hwnd
, INT16 nBar
)
528 return GetScrollPos( WIN_Handle32(hwnd
), nBar
);
532 /**************************************************************************
533 * SetScrollRange (USER.64)
535 void WINAPI
SetScrollRange16( HWND16 hwnd
, INT16 nBar
, INT16 MinVal
, INT16 MaxVal
, BOOL16 redraw
)
537 /* Invalid range -> range is set to (0,0) */
538 if ((INT
)MaxVal
- (INT
)MinVal
> 0x7fff) MinVal
= MaxVal
= 0;
539 SetScrollRange( WIN_Handle32(hwnd
), nBar
, MinVal
, MaxVal
, redraw
);
543 /**************************************************************************
544 * GetScrollRange (USER.65)
546 BOOL16 WINAPI
GetScrollRange16( HWND16 hwnd
, INT16 nBar
, LPINT16 lpMin
, LPINT16 lpMax
)
549 BOOL ret
= GetScrollRange( WIN_Handle32(hwnd
), nBar
, &min
, &max
);
550 if (lpMin
) *lpMin
= min
;
551 if (lpMax
) *lpMax
= max
;
556 /**************************************************************************
559 HDC16 WINAPI
GetDC16( HWND16 hwnd
)
561 return HDC_16(GetDC( WIN_Handle32(hwnd
) ));
565 /**************************************************************************
566 * GetWindowDC (USER.67)
568 HDC16 WINAPI
GetWindowDC16( HWND16 hwnd
)
570 return GetDCEx16( hwnd
, 0, DCX_USESTYLE
| DCX_WINDOW
);
574 /**************************************************************************
575 * ReleaseDC (USER.68)
577 INT16 WINAPI
ReleaseDC16( HWND16 hwnd
, HDC16 hdc
)
579 return (INT16
)ReleaseDC( WIN_Handle32(hwnd
), HDC_32(hdc
) );
583 /**************************************************************************
584 * FlashWindow (USER.105)
586 BOOL16 WINAPI
FlashWindow16( HWND16 hwnd
, BOOL16 bInvert
)
588 return FlashWindow( WIN_Handle32(hwnd
), bInvert
);
592 /**************************************************************************
593 * WindowFromDC (USER.117)
595 HWND16 WINAPI
WindowFromDC16( HDC16 hDC
)
597 return HWND_16( WindowFromDC( HDC_32(hDC
) ) );
601 /**************************************************************************
602 * UpdateWindow (USER.124)
604 void WINAPI
UpdateWindow16( HWND16 hwnd
)
606 RedrawWindow16( hwnd
, NULL
, 0, RDW_UPDATENOW
| RDW_ALLCHILDREN
);
610 /**************************************************************************
611 * InvalidateRect (USER.125)
613 void WINAPI
InvalidateRect16( HWND16 hwnd
, const RECT16
*rect
, BOOL16 erase
)
615 RedrawWindow16( hwnd
, rect
, 0, RDW_INVALIDATE
| (erase
? RDW_ERASE
: 0) );
619 /**************************************************************************
620 * InvalidateRgn (USER.126)
622 void WINAPI
InvalidateRgn16( HWND16 hwnd
, HRGN16 hrgn
, BOOL16 erase
)
624 RedrawWindow16( hwnd
, NULL
, hrgn
, RDW_INVALIDATE
| (erase
? RDW_ERASE
: 0) );
628 /**************************************************************************
629 * ValidateRect (USER.127)
631 void WINAPI
ValidateRect16( HWND16 hwnd
, const RECT16
*rect
)
633 RedrawWindow16( hwnd
, rect
, 0, RDW_VALIDATE
| RDW_NOCHILDREN
);
637 /**************************************************************************
638 * ValidateRgn (USER.128)
640 void WINAPI
ValidateRgn16( HWND16 hwnd
, HRGN16 hrgn
)
642 RedrawWindow16( hwnd
, NULL
, hrgn
, RDW_VALIDATE
| RDW_NOCHILDREN
);
646 /**************************************************************************
647 * GetClassWord (USER.129)
649 WORD WINAPI
GetClassWord16( HWND16 hwnd
, INT16 offset
)
651 return GetClassWord( WIN_Handle32(hwnd
), offset
);
655 /**************************************************************************
656 * SetClassWord (USER.130)
658 WORD WINAPI
SetClassWord16( HWND16 hwnd
, INT16 offset
, WORD newval
)
660 return SetClassWord( WIN_Handle32(hwnd
), offset
, newval
);
664 /**************************************************************************
665 * GetWindowWord (USER.133)
667 WORD WINAPI
GetWindowWord16( HWND16 hwnd
, INT16 offset
)
669 return GetWindowWord( WIN_Handle32(hwnd
), offset
);
673 /**************************************************************************
674 * SetWindowWord (USER.134)
676 WORD WINAPI
SetWindowWord16( HWND16 hwnd
, INT16 offset
, WORD newval
)
678 return SetWindowWord( WIN_Handle32(hwnd
), offset
, newval
);
682 /**************************************************************************
683 * OpenClipboard (USER.137)
685 BOOL16 WINAPI
OpenClipboard16( HWND16 hwnd
)
687 return OpenClipboard( WIN_Handle32(hwnd
) );
691 /**************************************************************************
692 * GetClipboardOwner (USER.140)
694 HWND16 WINAPI
GetClipboardOwner16(void)
696 return HWND_16( GetClipboardOwner() );
700 /**************************************************************************
701 * SetClipboardViewer (USER.147)
703 HWND16 WINAPI
SetClipboardViewer16( HWND16 hwnd
)
705 return HWND_16( SetClipboardViewer( WIN_Handle32(hwnd
) ));
709 /**************************************************************************
710 * GetClipboardViewer (USER.148)
712 HWND16 WINAPI
GetClipboardViewer16(void)
714 return HWND_16( GetClipboardViewer() );
718 /**************************************************************************
719 * ChangeClipboardChain (USER.149)
721 BOOL16 WINAPI
ChangeClipboardChain16(HWND16 hwnd
, HWND16 hwndNext
)
723 return ChangeClipboardChain( WIN_Handle32(hwnd
), WIN_Handle32(hwndNext
) );
727 /**************************************************************************
728 * GetSystemMenu (USER.156)
730 HMENU16 WINAPI
GetSystemMenu16( HWND16 hwnd
, BOOL16 revert
)
732 return HMENU_16(GetSystemMenu( WIN_Handle32(hwnd
), revert
));
736 /**************************************************************************
739 HMENU16 WINAPI
GetMenu16( HWND16 hwnd
)
741 return HMENU_16(GetMenu( WIN_Handle32(hwnd
) ));
745 /**************************************************************************
748 BOOL16 WINAPI
SetMenu16( HWND16 hwnd
, HMENU16 hMenu
)
750 return SetMenu( WIN_Handle32(hwnd
), HMENU_32(hMenu
) );
754 /**************************************************************************
755 * DrawMenuBar (USER.160)
757 void WINAPI
DrawMenuBar16( HWND16 hwnd
)
759 DrawMenuBar( WIN_Handle32(hwnd
) );
763 /**************************************************************************
764 * HiliteMenuItem (USER.162)
766 BOOL16 WINAPI
HiliteMenuItem16( HWND16 hwnd
, HMENU16 hMenu
, UINT16 id
, UINT16 wHilite
)
768 return HiliteMenuItem( WIN_Handle32(hwnd
), HMENU_32(hMenu
), id
, wHilite
);
772 /**************************************************************************
773 * CreateCaret (USER.163)
775 void WINAPI
CreateCaret16( HWND16 hwnd
, HBITMAP16 bitmap
, INT16 width
, INT16 height
)
777 CreateCaret( WIN_Handle32(hwnd
), HBITMAP_32(bitmap
), width
, height
);
781 /*****************************************************************
782 * DestroyCaret (USER.164)
784 void WINAPI
DestroyCaret16(void)
790 /*****************************************************************
791 * SetCaretPos (USER.165)
793 void WINAPI
SetCaretPos16( INT16 x
, INT16 y
)
799 /**************************************************************************
800 * HideCaret (USER.166)
802 void WINAPI
HideCaret16( HWND16 hwnd
)
804 HideCaret( WIN_Handle32(hwnd
) );
808 /**************************************************************************
809 * ShowCaret (USER.167)
811 void WINAPI
ShowCaret16( HWND16 hwnd
)
813 ShowCaret( WIN_Handle32(hwnd
) );
817 /*****************************************************************
818 * SetCaretBlinkTime (USER.168)
820 void WINAPI
SetCaretBlinkTime16( UINT16 msecs
)
822 SetCaretBlinkTime( msecs
);
826 /*****************************************************************
827 * GetCaretBlinkTime (USER.169)
829 UINT16 WINAPI
GetCaretBlinkTime16(void)
831 return GetCaretBlinkTime();
835 /**************************************************************************
836 * ArrangeIconicWindows (USER.170)
838 UINT16 WINAPI
ArrangeIconicWindows16( HWND16 parent
)
840 return ArrangeIconicWindows( WIN_Handle32(parent
) );
844 /**************************************************************************
845 * SwitchToThisWindow (USER.172)
847 void WINAPI
SwitchToThisWindow16( HWND16 hwnd
, BOOL16 restore
)
849 SwitchToThisWindow( WIN_Handle32(hwnd
), restore
);
853 /**************************************************************************
854 * KillSystemTimer (USER.182)
856 BOOL16 WINAPI
KillSystemTimer16( HWND16 hwnd
, UINT16 id
)
858 return KillSystemTimer( WIN_Handle32(hwnd
), id
);
862 /*****************************************************************
863 * GetCaretPos (USER.183)
865 void WINAPI
GetCaretPos16( LPPOINT16 pt16
)
868 if (GetCaretPos( &pt
))
876 /**************************************************************************
877 * SetSysModalWindow (USER.188)
879 HWND16 WINAPI
SetSysModalWindow16( HWND16 hwnd
)
881 HWND16 old
= hwndSysModal
;
887 /**************************************************************************
888 * GetSysModalWindow (USER.189)
890 HWND16 WINAPI
GetSysModalWindow16(void)
896 /**************************************************************************
897 * GetUpdateRect (USER.190)
899 BOOL16 WINAPI
GetUpdateRect16( HWND16 hwnd
, LPRECT16 rect
, BOOL16 erase
)
904 if (!rect
) return GetUpdateRect( WIN_Handle32(hwnd
), NULL
, erase
);
905 ret
= GetUpdateRect( WIN_Handle32(hwnd
), &r
, erase
);
908 rect
->right
= r
.right
;
909 rect
->bottom
= r
.bottom
;
914 /**************************************************************************
915 * ChildWindowFromPoint (USER.191)
917 HWND16 WINAPI
ChildWindowFromPoint16( HWND16 hwndParent
, POINT16 pt
)
923 return HWND_16( ChildWindowFromPoint( WIN_Handle32(hwndParent
), pt32
));
927 /***********************************************************************
928 * GetWindowTask (USER.224)
930 HTASK16 WINAPI
GetWindowTask16( HWND16 hwnd
)
932 DWORD tid
= GetWindowThreadProcessId( HWND_32(hwnd
), NULL
);
934 return HTASK_16(tid
);
937 /**********************************************************************
938 * EnumTaskWindows (USER.225)
940 BOOL16 WINAPI
EnumTaskWindows16( HTASK16 hTask
, WNDENUMPROC16 func
, LPARAM lParam
)
942 struct wnd_enum_info info
;
943 DWORD tid
= HTASK_32( hTask
);
945 if (!tid
) return FALSE
;
948 return EnumThreadWindows( tid
, wnd_enum_callback
, (LPARAM
)&info
);
952 /**************************************************************************
953 * GetTopWindow (USER.229)
955 HWND16 WINAPI
GetTopWindow16( HWND16 hwnd
)
957 return HWND_16( GetTopWindow( WIN_Handle32(hwnd
) ));
961 /**************************************************************************
962 * GetNextWindow (USER.230)
964 HWND16 WINAPI
GetNextWindow16( HWND16 hwnd
, WORD flag
)
966 if ((flag
!= GW_HWNDNEXT
) && (flag
!= GW_HWNDPREV
)) return 0;
967 return GetWindow16( hwnd
, flag
);
971 /**************************************************************************
972 * SetWindowPos (USER.232)
974 BOOL16 WINAPI
SetWindowPos16( HWND16 hwnd
, HWND16 hwndInsertAfter
,
975 INT16 x
, INT16 y
, INT16 cx
, INT16 cy
, WORD flags
)
977 return SetWindowPos( WIN_Handle32(hwnd
), full_insert_after_hwnd(hwndInsertAfter
),
978 x
, y
, cx
, cy
, flags
);
982 /**************************************************************************
983 * SetParent (USER.233)
985 HWND16 WINAPI
SetParent16( HWND16 hwndChild
, HWND16 hwndNewParent
)
987 return HWND_16( SetParent( WIN_Handle32(hwndChild
), WIN_Handle32(hwndNewParent
) ));
991 /**************************************************************************
992 * GetCapture (USER.236)
994 HWND16 WINAPI
GetCapture16(void)
996 return HWND_16( GetCapture() );
1000 /**************************************************************************
1001 * GetUpdateRgn (USER.237)
1003 INT16 WINAPI
GetUpdateRgn16( HWND16 hwnd
, HRGN16 hrgn
, BOOL16 erase
)
1005 return GetUpdateRgn( WIN_Handle32(hwnd
), HRGN_32(hrgn
), erase
);
1009 /**************************************************************************
1010 * ExcludeUpdateRgn (USER.238)
1012 INT16 WINAPI
ExcludeUpdateRgn16( HDC16 hdc
, HWND16 hwnd
)
1014 return ExcludeUpdateRgn( HDC_32(hdc
), WIN_Handle32(hwnd
) );
1018 /**************************************************************************
1019 * GetOpenClipboardWindow (USER.248)
1021 HWND16 WINAPI
GetOpenClipboardWindow16(void)
1023 return HWND_16( GetOpenClipboardWindow() );
1027 /**************************************************************************
1028 * BeginDeferWindowPos (USER.259)
1030 HDWP16 WINAPI
BeginDeferWindowPos16( INT16 count
)
1032 return HDWP_16(BeginDeferWindowPos( count
));
1036 /**************************************************************************
1037 * DeferWindowPos (USER.260)
1039 HDWP16 WINAPI
DeferWindowPos16( HDWP16 hdwp
, HWND16 hwnd
, HWND16 hwndAfter
,
1040 INT16 x
, INT16 y
, INT16 cx
, INT16 cy
,
1043 return HDWP_16(DeferWindowPos( HDWP_32(hdwp
), WIN_Handle32(hwnd
),
1044 full_insert_after_hwnd(hwndAfter
), x
, y
, cx
, cy
, flags
));
1048 /**************************************************************************
1049 * EndDeferWindowPos (USER.261)
1051 BOOL16 WINAPI
EndDeferWindowPos16( HDWP16 hdwp
)
1053 return EndDeferWindowPos(HDWP_32(hdwp
));
1057 /**************************************************************************
1058 * GetWindow (USER.262)
1060 HWND16 WINAPI
GetWindow16( HWND16 hwnd
, WORD rel
)
1062 return HWND_16( GetWindow( WIN_Handle32(hwnd
), rel
) );
1066 /**************************************************************************
1067 * ShowOwnedPopups (USER.265)
1069 void WINAPI
ShowOwnedPopups16( HWND16 owner
, BOOL16 fShow
)
1071 ShowOwnedPopups( WIN_Handle32(owner
), fShow
);
1075 /**************************************************************************
1076 * ShowScrollBar (USER.267)
1078 void WINAPI
ShowScrollBar16( HWND16 hwnd
, INT16 nBar
, BOOL16 fShow
)
1080 ShowScrollBar( WIN_Handle32(hwnd
), nBar
, fShow
);
1084 /**************************************************************************
1085 * IsZoomed (USER.272)
1087 BOOL16 WINAPI
IsZoomed16(HWND16 hwnd
)
1089 return IsZoomed( WIN_Handle32(hwnd
) );
1093 /**************************************************************************
1094 * GetDlgCtrlID (USER.277)
1096 INT16 WINAPI
GetDlgCtrlID16( HWND16 hwnd
)
1098 return GetDlgCtrlID( WIN_Handle32(hwnd
) );
1102 /**************************************************************************
1103 * GetDesktopHwnd (USER.278)
1105 * Exactly the same thing as GetDesktopWindow(), but not documented.
1106 * Don't ask me why...
1108 HWND16 WINAPI
GetDesktopHwnd16(void)
1110 return GetDesktopWindow16();
1114 /**************************************************************************
1115 * SetSystemMenu (USER.280)
1117 BOOL16 WINAPI
SetSystemMenu16( HWND16 hwnd
, HMENU16 hMenu
)
1119 return SetSystemMenu( WIN_Handle32(hwnd
), HMENU_32(hMenu
) );
1123 /**************************************************************************
1124 * GetDesktopWindow (USER.286)
1126 HWND16 WINAPI
GetDesktopWindow16(void)
1128 return HWND_16( GetDesktopWindow() );
1132 /**************************************************************************
1133 * GetLastActivePopup (USER.287)
1135 HWND16 WINAPI
GetLastActivePopup16( HWND16 hwnd
)
1137 return HWND_16( GetLastActivePopup( WIN_Handle32(hwnd
) ));
1141 /**************************************************************************
1142 * RedrawWindow (USER.290)
1144 BOOL16 WINAPI
RedrawWindow16( HWND16 hwnd
, const RECT16
*rectUpdate
,
1145 HRGN16 hrgnUpdate
, UINT16 flags
)
1150 r
.left
= rectUpdate
->left
;
1151 r
.top
= rectUpdate
->top
;
1152 r
.right
= rectUpdate
->right
;
1153 r
.bottom
= rectUpdate
->bottom
;
1154 return RedrawWindow(WIN_Handle32(hwnd
), &r
, HRGN_32(hrgnUpdate
), flags
);
1156 return RedrawWindow(WIN_Handle32(hwnd
), NULL
, HRGN_32(hrgnUpdate
), flags
);
1160 /**************************************************************************
1161 * LockWindowUpdate (USER.294)
1163 BOOL16 WINAPI
LockWindowUpdate16( HWND16 hwnd
)
1165 return LockWindowUpdate( WIN_Handle32(hwnd
) );
1169 /**************************************************************************
1170 * ScrollWindowEx (USER.319)
1172 INT16 WINAPI
ScrollWindowEx16( HWND16 hwnd
, INT16 dx
, INT16 dy
,
1173 const RECT16
*rect
, const RECT16
*clipRect
,
1174 HRGN16 hrgnUpdate
, LPRECT16 rcUpdate
,
1177 RECT rect32
, clipRect32
, rcUpdate32
;
1182 rect32
.left
= rect
->left
;
1183 rect32
.top
= rect
->top
;
1184 rect32
.right
= rect
->right
;
1185 rect32
.bottom
= rect
->bottom
;
1189 clipRect32
.left
= clipRect
->left
;
1190 clipRect32
.top
= clipRect
->top
;
1191 clipRect32
.right
= clipRect
->right
;
1192 clipRect32
.bottom
= clipRect
->bottom
;
1194 ret
= ScrollWindowEx( WIN_Handle32(hwnd
), dx
, dy
, rect
? &rect32
: NULL
,
1195 clipRect
? &clipRect32
: NULL
, HRGN_32(hrgnUpdate
),
1196 (rcUpdate
) ? &rcUpdate32
: NULL
, flags
);
1199 rcUpdate
->left
= rcUpdate32
.left
;
1200 rcUpdate
->top
= rcUpdate32
.top
;
1201 rcUpdate
->right
= rcUpdate32
.right
;
1202 rcUpdate
->bottom
= rcUpdate32
.bottom
;
1208 /**************************************************************************
1209 * FillWindow (USER.324)
1211 void WINAPI
FillWindow16( HWND16 hwndParent
, HWND16 hwnd
, HDC16 hdc
, HBRUSH16 hbrush
)
1215 GetClientRect( WIN_Handle32(hwnd
), &rect
);
1216 DPtoLP( HDC_32(hdc
), (LPPOINT
)&rect
, 2 );
1217 rc16
.left
= rect
.left
;
1218 rc16
.top
= rect
.top
;
1219 rc16
.right
= rect
.right
;
1220 rc16
.bottom
= rect
.bottom
;
1221 PaintRect16( hwndParent
, hwnd
, hdc
, hbrush
, &rc16
);
1225 /**************************************************************************
1226 * PaintRect (USER.325)
1228 void WINAPI
PaintRect16( HWND16 hwndParent
, HWND16 hwnd
, HDC16 hdc
,
1229 HBRUSH16 hbrush
, const RECT16
*rect
)
1231 if (hbrush
<= CTLCOLOR_STATIC
)
1233 HWND parent
= WIN_Handle32(hwndParent
), hwnd32
= WIN_Handle32(hwnd
);
1235 if (!parent
) return;
1236 hbrush
= SendMessageW( parent
, WM_CTLCOLORMSGBOX
+ hbrush
, (WPARAM
)hdc
, (LPARAM
)hwnd32
);
1237 if (!hbrush
) hbrush
= DefWindowProcW( parent
, WM_CTLCOLORMSGBOX
+ hbrush
,
1238 (WPARAM
)hdc
, (LPARAM
)hwnd32
);
1240 if (hbrush
) FillRect16( hdc
, rect
, hbrush
);
1244 /**************************************************************************
1245 * GetControlBrush (USER.326)
1247 HBRUSH16 WINAPI
GetControlBrush16( HWND16 hwnd
, HDC16 hdc
, UINT16 ctlType
)
1250 HWND hwnd32
= WIN_Handle32(hwnd
);
1251 HWND parent
= GetParent( hwnd32
);
1253 if (!parent
) parent
= hwnd32
;
1254 ret
= SendMessageW( parent
, WM_CTLCOLORMSGBOX
+ ctlType
, (WPARAM
)hdc
, (LPARAM
)hwnd32
);
1255 if (!ret
) ret
= DefWindowProcW( parent
, WM_CTLCOLORMSGBOX
+ ctlType
,
1256 (WPARAM
)hdc
, (LPARAM
)hwnd32
);
1261 /**************************************************************************
1262 * GetDCEx (USER.359)
1264 HDC16 WINAPI
GetDCEx16( HWND16 hwnd
, HRGN16 hrgnClip
, DWORD flags
)
1266 return HDC_16(GetDCEx(WIN_Handle32(hwnd
), HRGN_32(hrgnClip
), flags
));
1270 /**************************************************************************
1271 * GetWindowPlacement (USER.370)
1273 BOOL16 WINAPI
GetWindowPlacement16( HWND16 hwnd
, WINDOWPLACEMENT16
*wp16
)
1275 WINDOWPLACEMENT wpl
;
1277 wpl
.length
= sizeof(wpl
);
1278 if (!GetWindowPlacement( WIN_Handle32(hwnd
), &wpl
)) return FALSE
;
1279 wp16
->length
= sizeof(*wp16
);
1280 wp16
->flags
= wpl
.flags
;
1281 wp16
->showCmd
= wpl
.showCmd
;
1282 wp16
->ptMinPosition
.x
= wpl
.ptMinPosition
.x
;
1283 wp16
->ptMinPosition
.y
= wpl
.ptMinPosition
.y
;
1284 wp16
->ptMaxPosition
.x
= wpl
.ptMaxPosition
.x
;
1285 wp16
->ptMaxPosition
.y
= wpl
.ptMaxPosition
.y
;
1286 wp16
->rcNormalPosition
.left
= wpl
.rcNormalPosition
.left
;
1287 wp16
->rcNormalPosition
.top
= wpl
.rcNormalPosition
.top
;
1288 wp16
->rcNormalPosition
.right
= wpl
.rcNormalPosition
.right
;
1289 wp16
->rcNormalPosition
.bottom
= wpl
.rcNormalPosition
.bottom
;
1294 /**************************************************************************
1295 * SetWindowPlacement (USER.371)
1297 BOOL16 WINAPI
SetWindowPlacement16( HWND16 hwnd
, const WINDOWPLACEMENT16
*wp16
)
1299 WINDOWPLACEMENT wpl
;
1301 if (!wp16
) return FALSE
;
1302 wpl
.length
= sizeof(wpl
);
1303 wpl
.flags
= wp16
->flags
;
1304 wpl
.showCmd
= wp16
->showCmd
;
1305 wpl
.ptMinPosition
.x
= wp16
->ptMinPosition
.x
;
1306 wpl
.ptMinPosition
.y
= wp16
->ptMinPosition
.y
;
1307 wpl
.ptMaxPosition
.x
= wp16
->ptMaxPosition
.x
;
1308 wpl
.ptMaxPosition
.y
= wp16
->ptMaxPosition
.y
;
1309 wpl
.rcNormalPosition
.left
= wp16
->rcNormalPosition
.left
;
1310 wpl
.rcNormalPosition
.top
= wp16
->rcNormalPosition
.top
;
1311 wpl
.rcNormalPosition
.right
= wp16
->rcNormalPosition
.right
;
1312 wpl
.rcNormalPosition
.bottom
= wp16
->rcNormalPosition
.bottom
;
1313 return SetWindowPlacement( WIN_Handle32(hwnd
), &wpl
);
1317 /***********************************************************************
1318 * RegisterClassEx (USER.397)
1320 ATOM WINAPI
RegisterClassEx16( const WNDCLASSEX16
*wc
)
1324 wc32
.cbSize
= sizeof(wc32
);
1325 wc32
.style
= wc
->style
;
1326 wc32
.lpfnWndProc
= WINPROC_AllocProc( (WNDPROC
)wc
->lpfnWndProc
, WIN_PROC_16
);
1327 wc32
.cbClsExtra
= wc
->cbClsExtra
;
1328 wc32
.cbWndExtra
= wc
->cbWndExtra
;
1329 wc32
.hInstance
= HINSTANCE_32(GetExePtr(wc
->hInstance
));
1330 if (!wc32
.hInstance
) wc32
.hInstance
= HINSTANCE_32(GetModuleHandle16(NULL
));
1331 wc32
.hIcon
= HICON_32(wc
->hIcon
);
1332 wc32
.hCursor
= HCURSOR_32(wc
->hCursor
);
1333 wc32
.hbrBackground
= HBRUSH_32(wc
->hbrBackground
);
1334 wc32
.lpszMenuName
= MapSL(wc
->lpszMenuName
);
1335 wc32
.lpszClassName
= MapSL(wc
->lpszClassName
);
1336 wc32
.hIconSm
= HICON_32(wc
->hIconSm
);
1337 return RegisterClassExA( &wc32
);
1341 /***********************************************************************
1342 * GetClassInfoEx (USER.398)
1344 * FIXME: this is just a guess, I have no idea if GetClassInfoEx() is the
1345 * same in Win16 as in Win32. --AJ
1347 BOOL16 WINAPI
GetClassInfoEx16( HINSTANCE16 hInst16
, SEGPTR name
, WNDCLASSEX16
*wc
)
1350 HINSTANCE hInstance
;
1353 if (hInst16
== GetModuleHandle16("user")) hInstance
= user32_module
;
1354 else hInstance
= HINSTANCE_32(GetExePtr( hInst16
));
1356 ret
= GetClassInfoExA( hInstance
, MapSL(name
), &wc32
);
1360 WNDPROC proc
= WINPROC_AllocProc( wc32
.lpfnWndProc
, WIN_PROC_32A
);
1361 wc
->lpfnWndProc
= WINPROC_GetProc( proc
, WIN_PROC_16
);
1362 wc
->style
= wc32
.style
;
1363 wc
->cbClsExtra
= wc32
.cbClsExtra
;
1364 wc
->cbWndExtra
= wc32
.cbWndExtra
;
1365 wc
->hInstance
= (wc32
.hInstance
== user32_module
) ? GetModuleHandle16("user") : HINSTANCE_16(wc32
.hInstance
);
1366 wc
->hIcon
= HICON_16(wc32
.hIcon
);
1367 wc
->hIconSm
= HICON_16(wc32
.hIconSm
);
1368 wc
->hCursor
= HCURSOR_16(wc32
.hCursor
);
1369 wc
->hbrBackground
= HBRUSH_16(wc32
.hbrBackground
);
1370 wc
->lpszClassName
= 0;
1371 wc
->lpszMenuName
= MapLS(wc32
.lpszMenuName
); /* FIXME: leak */
1377 /**************************************************************************
1378 * ChildWindowFromPointEx (USER.399)
1380 HWND16 WINAPI
ChildWindowFromPointEx16( HWND16 hwndParent
, POINT16 pt
, UINT16 uFlags
)
1386 return HWND_16( ChildWindowFromPointEx( WIN_Handle32(hwndParent
), pt32
, uFlags
));
1390 /**************************************************************************
1391 * GetPriorityClipboardFormat (USER.402)
1393 INT16 WINAPI
GetPriorityClipboardFormat16( UINT16
*list
, INT16 count
)
1397 for (i
= 0; i
< count
; i
++)
1398 if (IsClipboardFormatAvailable( list
[i
] )) return list
[i
];
1403 /***********************************************************************
1404 * UnregisterClass (USER.403)
1406 BOOL16 WINAPI
UnregisterClass16( LPCSTR className
, HINSTANCE16 hInstance
)
1408 if (hInstance
== GetModuleHandle16("user")) hInstance
= 0;
1409 return UnregisterClassA( className
, HINSTANCE_32(GetExePtr( hInstance
)) );
1413 /***********************************************************************
1414 * GetClassInfo (USER.404)
1416 BOOL16 WINAPI
GetClassInfo16( HINSTANCE16 hInst16
, SEGPTR name
, WNDCLASS16
*wc
)
1419 UINT16 ret
= GetClassInfoEx16( hInst16
, name
, &wcex
);
1423 wc
->style
= wcex
.style
;
1424 wc
->lpfnWndProc
= wcex
.lpfnWndProc
;
1425 wc
->cbClsExtra
= wcex
.cbClsExtra
;
1426 wc
->cbWndExtra
= wcex
.cbWndExtra
;
1427 wc
->hInstance
= wcex
.hInstance
;
1428 wc
->hIcon
= wcex
.hIcon
;
1429 wc
->hCursor
= wcex
.hCursor
;
1430 wc
->hbrBackground
= wcex
.hbrBackground
;
1431 wc
->lpszMenuName
= wcex
.lpszMenuName
;
1432 wc
->lpszClassName
= wcex
.lpszClassName
;
1438 /**************************************************************************
1439 * TrackPopupMenu (USER.416)
1441 BOOL16 WINAPI
TrackPopupMenu16( HMENU16 hMenu
, UINT16 wFlags
, INT16 x
, INT16 y
,
1442 INT16 nReserved
, HWND16 hwnd
, const RECT16
*lpRect
)
1447 r
.left
= lpRect
->left
;
1448 r
.top
= lpRect
->top
;
1449 r
.right
= lpRect
->right
;
1450 r
.bottom
= lpRect
->bottom
;
1452 return TrackPopupMenu( HMENU_32(hMenu
), wFlags
, x
, y
, nReserved
,
1453 WIN_Handle32(hwnd
), lpRect
? &r
: NULL
);
1457 /**************************************************************************
1458 * FindWindowEx (USER.427)
1460 HWND16 WINAPI
FindWindowEx16( HWND16 parent
, HWND16 child
, LPCSTR className
, LPCSTR title
)
1462 return HWND_16( FindWindowExA( WIN_Handle32(parent
), WIN_Handle32(child
),
1463 className
, title
));
1467 /***********************************************************************
1468 * DefFrameProc (USER.445)
1470 LRESULT WINAPI
DefFrameProc16( HWND16 hwnd
, HWND16 hwndMDIClient
,
1471 UINT16 message
, WPARAM16 wParam
, LPARAM lParam
)
1476 lParam
= (LPARAM
)MapSL(lParam
);
1482 return DefFrameProcA( WIN_Handle32(hwnd
), WIN_Handle32(hwndMDIClient
),
1483 message
, wParam
, lParam
);
1487 MDINEXTMENU next_menu
;
1488 DefFrameProcW( WIN_Handle32(hwnd
), WIN_Handle32(hwndMDIClient
),
1489 message
, wParam
, (LPARAM
)&next_menu
);
1490 return MAKELONG( HMENU_16(next_menu
.hmenuNext
), HWND_16(next_menu
.hwndNext
) );
1493 return DefWindowProc16(hwnd
, message
, wParam
, lParam
);
1498 /***********************************************************************
1499 * DefMDIChildProc (USER.447)
1501 LRESULT WINAPI
DefMDIChildProc16( HWND16 hwnd
, UINT16 message
,
1502 WPARAM16 wParam
, LPARAM lParam
)
1507 return DefMDIChildProcA( WIN_Handle32(hwnd
), message
, wParam
, (LPARAM
)MapSL(lParam
) );
1512 case WM_CHILDACTIVATE
:
1517 return DefMDIChildProcW( WIN_Handle32(hwnd
), message
, wParam
, lParam
);
1519 case WM_GETMINMAXINFO
:
1521 MINMAXINFO16
*mmi16
= (MINMAXINFO16
*)MapSL(lParam
);
1524 mmi
.ptReserved
.x
= mmi16
->ptReserved
.x
;
1525 mmi
.ptReserved
.y
= mmi16
->ptReserved
.y
;
1526 mmi
.ptMaxSize
.x
= mmi16
->ptMaxSize
.x
;
1527 mmi
.ptMaxSize
.y
= mmi16
->ptMaxSize
.y
;
1528 mmi
.ptMaxPosition
.x
= mmi16
->ptMaxPosition
.x
;
1529 mmi
.ptMaxPosition
.y
= mmi16
->ptMaxPosition
.y
;
1530 mmi
.ptMinTrackSize
.x
= mmi16
->ptMinTrackSize
.x
;
1531 mmi
.ptMinTrackSize
.y
= mmi16
->ptMinTrackSize
.y
;
1532 mmi
.ptMaxTrackSize
.x
= mmi16
->ptMaxTrackSize
.x
;
1533 mmi
.ptMaxTrackSize
.y
= mmi16
->ptMaxTrackSize
.y
;
1535 DefMDIChildProcW( WIN_Handle32(hwnd
), message
, wParam
, (LPARAM
)&mmi
);
1537 mmi16
->ptReserved
.x
= mmi
.ptReserved
.x
;
1538 mmi16
->ptReserved
.y
= mmi
.ptReserved
.y
;
1539 mmi16
->ptMaxSize
.x
= mmi
.ptMaxSize
.x
;
1540 mmi16
->ptMaxSize
.y
= mmi
.ptMaxSize
.y
;
1541 mmi16
->ptMaxPosition
.x
= mmi
.ptMaxPosition
.x
;
1542 mmi16
->ptMaxPosition
.y
= mmi
.ptMaxPosition
.y
;
1543 mmi16
->ptMinTrackSize
.x
= mmi
.ptMinTrackSize
.x
;
1544 mmi16
->ptMinTrackSize
.y
= mmi
.ptMinTrackSize
.y
;
1545 mmi16
->ptMaxTrackSize
.x
= mmi
.ptMaxTrackSize
.x
;
1546 mmi16
->ptMaxTrackSize
.y
= mmi
.ptMaxTrackSize
.y
;
1551 MDINEXTMENU next_menu
;
1552 DefMDIChildProcW( WIN_Handle32(hwnd
), message
, wParam
, (LPARAM
)&next_menu
);
1553 return MAKELONG( HMENU_16(next_menu
.hmenuNext
), HWND_16(next_menu
.hwndNext
) );
1556 return DefWindowProc16(hwnd
, message
, wParam
, lParam
);
1561 /**************************************************************************
1562 * DrawAnimatedRects (USER.448)
1564 BOOL16 WINAPI
DrawAnimatedRects16( HWND16 hwnd
, INT16 idAni
,
1565 const RECT16
* lprcFrom
, const RECT16
* lprcTo
)
1567 RECT rcFrom32
, rcTo32
;
1568 rcFrom32
.left
= lprcFrom
->left
;
1569 rcFrom32
.top
= lprcFrom
->top
;
1570 rcFrom32
.right
= lprcFrom
->right
;
1571 rcFrom32
.bottom
= lprcFrom
->bottom
;
1572 rcTo32
.left
= lprcTo
->left
;
1573 rcTo32
.top
= lprcTo
->top
;
1574 rcTo32
.right
= lprcTo
->right
;
1575 rcTo32
.bottom
= lprcTo
->bottom
;
1576 return DrawAnimatedRects( WIN_Handle32(hwnd
), idAni
, &rcFrom32
, &rcTo32
);
1580 /***********************************************************************
1581 * GetInternalWindowPos (USER.460)
1583 UINT16 WINAPI
GetInternalWindowPos16( HWND16 hwnd
, LPRECT16 rectWnd
, LPPOINT16 ptIcon
)
1585 WINDOWPLACEMENT16 wndpl
;
1587 if (!GetWindowPlacement16( hwnd
, &wndpl
)) return 0;
1588 if (rectWnd
) *rectWnd
= wndpl
.rcNormalPosition
;
1589 if (ptIcon
) *ptIcon
= wndpl
.ptMinPosition
;
1590 return wndpl
.showCmd
;
1594 /**************************************************************************
1595 * SetInternalWindowPos (USER.461)
1597 void WINAPI
SetInternalWindowPos16( HWND16 hwnd
, UINT16 showCmd
, LPRECT16 rect
, LPPOINT16 pt
)
1604 rc32
.left
= rect
->left
;
1605 rc32
.top
= rect
->top
;
1606 rc32
.right
= rect
->right
;
1607 rc32
.bottom
= rect
->bottom
;
1614 SetInternalWindowPos( WIN_Handle32(hwnd
), showCmd
,
1615 rect
? &rc32
: NULL
, pt
? &pt32
: NULL
);
1619 /**************************************************************************
1620 * CalcChildScroll (USER.462)
1622 void WINAPI
CalcChildScroll16( HWND16 hwnd
, WORD scroll
)
1624 CalcChildScroll( WIN_Handle32(hwnd
), scroll
);
1628 /**************************************************************************
1629 * ScrollChildren (USER.463)
1631 void WINAPI
ScrollChildren16(HWND16 hwnd
, UINT16 uMsg
, WPARAM16 wParam
, LPARAM lParam
)
1633 ScrollChildren( WIN_Handle32(hwnd
), uMsg
, wParam
, lParam
);
1637 /**************************************************************************
1638 * DragDetect (USER.465)
1640 BOOL16 WINAPI
DragDetect16( HWND16 hwnd
, POINT16 pt
)
1646 return DragDetect( WIN_Handle32(hwnd
), pt32
);
1650 /**************************************************************************
1651 * SetScrollInfo (USER.475)
1653 INT16 WINAPI
SetScrollInfo16( HWND16 hwnd
, INT16 nBar
, const SCROLLINFO
*info
, BOOL16 redraw
)
1655 return SetScrollInfo( WIN_Handle32(hwnd
), nBar
, info
, redraw
);
1659 /**************************************************************************
1660 * GetScrollInfo (USER.476)
1662 BOOL16 WINAPI
GetScrollInfo16( HWND16 hwnd
, INT16 nBar
, LPSCROLLINFO info
)
1664 return GetScrollInfo( WIN_Handle32(hwnd
), nBar
, info
);
1668 /**************************************************************************
1669 * EnableScrollBar (USER.482)
1671 BOOL16 WINAPI
EnableScrollBar16( HWND16 hwnd
, INT16 nBar
, UINT16 flags
)
1673 return EnableScrollBar( WIN_Handle32(hwnd
), nBar
, flags
);
1677 /**************************************************************************
1678 * GetShellWindow (USER.600)
1680 HWND16 WINAPI
GetShellWindow16(void)
1682 return HWND_16( GetShellWindow() );
1686 /**************************************************************************
1687 * GetForegroundWindow (USER.608)
1689 HWND16 WINAPI
GetForegroundWindow16(void)
1691 return HWND_16( GetForegroundWindow() );
1695 /**************************************************************************
1696 * SetForegroundWindow (USER.609)
1698 BOOL16 WINAPI
SetForegroundWindow16( HWND16 hwnd
)
1700 return SetForegroundWindow( WIN_Handle32(hwnd
) );
1704 /**************************************************************************
1705 * DrawCaptionTemp (USER.657)
1707 BOOL16 WINAPI
DrawCaptionTemp16( HWND16 hwnd
, HDC16 hdc
, const RECT16
*rect
,
1708 HFONT16 hFont
, HICON16 hIcon
, LPCSTR str
, UINT16 uFlags
)
1714 rect32
.left
= rect
->left
;
1715 rect32
.top
= rect
->top
;
1716 rect32
.right
= rect
->right
;
1717 rect32
.bottom
= rect
->bottom
;
1719 return DrawCaptionTempA( WIN_Handle32(hwnd
), HDC_32(hdc
),
1720 rect
? &rect32
: NULL
, HFONT_32(hFont
),
1721 HICON_32(hIcon
), str
, uFlags
& 0x1f );
1725 /**************************************************************************
1726 * DrawCaption (USER.660)
1728 BOOL16 WINAPI
DrawCaption16( HWND16 hwnd
, HDC16 hdc
, const RECT16
*rect
, UINT16 flags
)
1734 rect32
.left
= rect
->left
;
1735 rect32
.top
= rect
->top
;
1736 rect32
.right
= rect
->right
;
1737 rect32
.bottom
= rect
->bottom
;
1739 return DrawCaption(WIN_Handle32(hwnd
), HDC_32(hdc
), rect
? &rect32
: NULL
, flags
);
1743 /**************************************************************************
1744 * GetMenuItemRect (USER.665)
1746 BOOL16 WINAPI
GetMenuItemRect16( HWND16 hwnd
, HMENU16 hMenu
, UINT16 uItem
,
1751 if (!rect
) return FALSE
;
1752 res
= GetMenuItemRect( WIN_Handle32(hwnd
), HMENU_32(hMenu
), uItem
, &r32
);
1753 rect
->left
= r32
.left
;
1754 rect
->top
= r32
.top
;
1755 rect
->right
= r32
.right
;
1756 rect
->bottom
= r32
.bottom
;
1761 /**************************************************************************
1762 * SetWindowRgn (USER.668)
1764 INT16 WINAPI
SetWindowRgn16( HWND16 hwnd
, HRGN16 hrgn
, BOOL16 redraw
)
1766 return SetWindowRgn( WIN_Handle32(hwnd
), HRGN_32(hrgn
), redraw
);
1770 /**************************************************************************
1771 * MessageBoxIndirect (USER.827)
1773 INT16 WINAPI
MessageBoxIndirect16( LPMSGBOXPARAMS16 msgbox
)
1775 MSGBOXPARAMSA msgbox32
;
1777 msgbox32
.cbSize
= msgbox
->cbSize
;
1778 msgbox32
.hwndOwner
= WIN_Handle32( msgbox
->hwndOwner
);
1779 msgbox32
.hInstance
= HINSTANCE_32(msgbox
->hInstance
);
1780 msgbox32
.lpszText
= MapSL(msgbox
->lpszText
);
1781 msgbox32
.lpszCaption
= MapSL(msgbox
->lpszCaption
);
1782 msgbox32
.dwStyle
= msgbox
->dwStyle
;
1783 msgbox32
.lpszIcon
= MapSL(msgbox
->lpszIcon
);
1784 msgbox32
.dwContextHelpId
= msgbox
->dwContextHelpId
;
1785 msgbox32
.lpfnMsgBoxCallback
= msgbox
->lpfnMsgBoxCallback
;
1786 msgbox32
.dwLanguageId
= msgbox
->dwLanguageId
;
1787 return MessageBoxIndirectA( &msgbox32
);