Moved a few remaining 16-bit window functions to wnd16.c and moved it
[wine.git] / dlls / user / wnd16.c
blob7ff45a247fec70254ee7f1e43818f7cf3f0ffc3e
1 /*
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"
22 #include "wownt32.h"
23 #include "user.h"
24 #include "win.h"
25 #include "stackframe.h"
27 /* handle --> handle16 conversions */
28 #define HANDLE_16(h32) (LOWORD(h32))
30 static HWND16 hwndSysModal;
32 /* ### start build ### */
33 extern WORD CALLBACK WIN_CallTo16_word_wl(WNDENUMPROC16,WORD,LONG);
34 /* ### stop build ### */
36 struct wnd_enum_info
38 WNDENUMPROC16 proc;
39 LPARAM param;
42 /* callback for 16-bit window enumeration functions */
43 static BOOL CALLBACK wnd_enum_callback( HWND hwnd, LPARAM param )
45 const struct wnd_enum_info *info = (struct wnd_enum_info *)param;
46 return WIN_CallTo16_word_wl( info->proc, HWND_16(hwnd), info->param );
49 /* convert insert after window handle to 32-bit */
50 inline static HWND full_insert_after_hwnd( HWND16 hwnd )
52 HWND ret = WIN_Handle32( hwnd );
53 if (ret == (HWND)0xffff) ret = HWND_TOPMOST;
54 return ret;
57 /**************************************************************************
58 * MessageBox (USER.1)
60 INT16 WINAPI MessageBox16( HWND16 hwnd, LPCSTR text, LPCSTR title, UINT16 type )
62 return MessageBoxA( WIN_Handle32(hwnd), text, title, type );
66 /**************************************************************************
67 * KillTimer (USER.12)
69 BOOL16 WINAPI KillTimer16( HWND16 hwnd, UINT16 id )
71 return KillTimer( WIN_Handle32(hwnd), id );
75 /**************************************************************************
76 * SetCapture (USER.18)
78 HWND16 WINAPI SetCapture16( HWND16 hwnd )
80 return HWND_16( SetCapture( WIN_Handle32(hwnd) ));
84 /**************************************************************************
85 * ReleaseCapture (USER.19)
87 BOOL16 WINAPI ReleaseCapture16(void)
89 return ReleaseCapture();
93 /**************************************************************************
94 * SetFocus (USER.22)
96 HWND16 WINAPI SetFocus16( HWND16 hwnd )
98 return HWND_16( SetFocus( WIN_Handle32(hwnd) ));
102 /**************************************************************************
103 * GetFocus (USER.23)
105 HWND16 WINAPI GetFocus16(void)
107 return HWND_16( GetFocus() );
111 /**************************************************************************
112 * RemoveProp (USER.24)
114 HANDLE16 WINAPI RemoveProp16( HWND16 hwnd, LPCSTR str )
116 return HANDLE_16(RemovePropA( WIN_Handle32(hwnd), str ));
120 /**************************************************************************
121 * GetProp (USER.25)
123 HANDLE16 WINAPI GetProp16( HWND16 hwnd, LPCSTR str )
125 return HANDLE_16(GetPropA( WIN_Handle32(hwnd), str ));
129 /**************************************************************************
130 * SetProp (USER.26)
132 BOOL16 WINAPI SetProp16( HWND16 hwnd, LPCSTR str, HANDLE16 handle )
134 return SetPropA( WIN_Handle32(hwnd), str, handle );
138 /**************************************************************************
139 * ClientToScreen (USER.28)
141 void WINAPI ClientToScreen16( HWND16 hwnd, LPPOINT16 lppnt )
143 MapWindowPoints16( hwnd, 0, lppnt, 1 );
147 /**************************************************************************
148 * ScreenToClient (USER.29)
150 void WINAPI ScreenToClient16( HWND16 hwnd, LPPOINT16 lppnt )
152 MapWindowPoints16( 0, hwnd, lppnt, 1 );
156 /**************************************************************************
157 * WindowFromPoint (USER.30)
159 HWND16 WINAPI WindowFromPoint16( POINT16 pt )
161 POINT pt32;
163 CONV_POINT16TO32( &pt, &pt32 );
164 return HWND_16( WindowFromPoint( pt32 ) );
168 /**************************************************************************
169 * IsIconic (USER.31)
171 BOOL16 WINAPI IsIconic16(HWND16 hwnd)
173 return IsIconic( WIN_Handle32(hwnd) );
177 /**************************************************************************
178 * GetWindowRect (USER.32)
180 void WINAPI GetWindowRect16( HWND16 hwnd, LPRECT16 rect )
182 RECT rect32;
184 GetWindowRect( WIN_Handle32(hwnd), &rect32 );
185 rect->left = rect32.left;
186 rect->top = rect32.top;
187 rect->right = rect32.right;
188 rect->bottom = rect32.bottom;
192 /**************************************************************************
193 * GetClientRect (USER.33)
195 void WINAPI GetClientRect16( HWND16 hwnd, LPRECT16 rect )
197 RECT rect32;
199 GetClientRect( WIN_Handle32(hwnd), &rect32 );
200 rect->left = rect32.left;
201 rect->top = rect32.top;
202 rect->right = rect32.right;
203 rect->bottom = rect32.bottom;
207 /**************************************************************************
208 * EnableWindow (USER.34)
210 BOOL16 WINAPI EnableWindow16( HWND16 hwnd, BOOL16 enable )
212 return EnableWindow( WIN_Handle32(hwnd), enable );
216 /**************************************************************************
217 * IsWindowEnabled (USER.35)
219 BOOL16 WINAPI IsWindowEnabled16(HWND16 hwnd)
221 return IsWindowEnabled( WIN_Handle32(hwnd) );
225 /**************************************************************************
226 * GetWindowText (USER.36)
228 INT16 WINAPI GetWindowText16( HWND16 hwnd, SEGPTR lpString, INT16 nMaxCount )
230 return SendMessage16( hwnd, WM_GETTEXT, nMaxCount, lpString );
234 /**************************************************************************
235 * SetWindowText (USER.37)
237 BOOL16 WINAPI SetWindowText16( HWND16 hwnd, SEGPTR lpString )
239 return SendMessage16( hwnd, WM_SETTEXT, 0, (LPARAM)lpString );
243 /**************************************************************************
244 * GetWindowTextLength (USER.38)
246 INT16 WINAPI GetWindowTextLength16( HWND16 hwnd )
248 return SendMessage16( hwnd, WM_GETTEXTLENGTH, 0, 0 );
252 /***********************************************************************
253 * BeginPaint (USER.39)
255 HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
257 PAINTSTRUCT ps;
259 BeginPaint( WIN_Handle32(hwnd), &ps );
260 lps->hdc = ps.hdc;
261 lps->fErase = ps.fErase;
262 lps->rcPaint.top = ps.rcPaint.top;
263 lps->rcPaint.left = ps.rcPaint.left;
264 lps->rcPaint.right = ps.rcPaint.right;
265 lps->rcPaint.bottom = ps.rcPaint.bottom;
266 lps->fRestore = ps.fRestore;
267 lps->fIncUpdate = ps.fIncUpdate;
268 return lps->hdc;
272 /***********************************************************************
273 * EndPaint (USER.40)
275 BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps )
277 PAINTSTRUCT ps;
279 ps.hdc = lps->hdc;
280 return EndPaint( WIN_Handle32(hwnd), &ps );
284 /**************************************************************************
285 * ShowWindow (USER.42)
287 BOOL16 WINAPI ShowWindow16( HWND16 hwnd, INT16 cmd )
289 return ShowWindow( WIN_Handle32(hwnd), cmd );
293 /**************************************************************************
294 * CloseWindow (USER.43)
296 BOOL16 WINAPI CloseWindow16( HWND16 hwnd )
298 return CloseWindow( WIN_Handle32(hwnd) );
302 /**************************************************************************
303 * OpenIcon (USER.44)
305 BOOL16 WINAPI OpenIcon16( HWND16 hwnd )
307 return OpenIcon( WIN_Handle32(hwnd) );
311 /**************************************************************************
312 * BringWindowToTop (USER.45)
314 BOOL16 WINAPI BringWindowToTop16( HWND16 hwnd )
316 return BringWindowToTop( WIN_Handle32(hwnd) );
320 /**************************************************************************
321 * GetParent (USER.46)
323 HWND16 WINAPI GetParent16( HWND16 hwnd )
325 return HWND_16( GetParent( WIN_Handle32(hwnd) ));
329 /**************************************************************************
330 * IsWindow (USER.47)
332 BOOL16 WINAPI IsWindow16( HWND16 hwnd )
334 CURRENT_STACK16->es = USER_HeapSel;
335 /* don't use WIN_Handle32 here, we don't care about the full handle */
336 return IsWindow( HWND_32(hwnd) );
340 /**************************************************************************
341 * IsChild (USER.48)
343 BOOL16 WINAPI IsChild16( HWND16 parent, HWND16 child )
345 return IsChild( WIN_Handle32(parent), WIN_Handle32(child) );
349 /**************************************************************************
350 * IsWindowVisible (USER.49)
352 BOOL16 WINAPI IsWindowVisible16( HWND16 hwnd )
354 return IsWindowVisible( WIN_Handle32(hwnd) );
358 /**************************************************************************
359 * FindWindow (USER.50)
361 HWND16 WINAPI FindWindow16( LPCSTR className, LPCSTR title )
363 return HWND_16( FindWindowA( className, title ));
367 /**************************************************************************
368 * DestroyWindow (USER.53)
370 BOOL16 WINAPI DestroyWindow16( HWND16 hwnd )
372 return DestroyWindow( WIN_Handle32(hwnd) );
376 /*******************************************************************
377 * EnumWindows (USER.54)
379 BOOL16 WINAPI EnumWindows16( WNDENUMPROC16 func, LPARAM lParam )
381 struct wnd_enum_info info;
383 info.proc = func;
384 info.param = lParam;
385 return EnumWindows( wnd_enum_callback, (LPARAM)&info );
389 /**********************************************************************
390 * EnumChildWindows (USER.55)
392 BOOL16 WINAPI EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func, LPARAM lParam )
394 struct wnd_enum_info info;
396 info.proc = func;
397 info.param = lParam;
398 return EnumChildWindows( WIN_Handle32(parent), wnd_enum_callback, (LPARAM)&info );
402 /**************************************************************************
403 * MoveWindow (USER.56)
405 BOOL16 WINAPI MoveWindow16( HWND16 hwnd, INT16 x, INT16 y, INT16 cx, INT16 cy, BOOL16 repaint )
407 return MoveWindow( WIN_Handle32(hwnd), x, y, cx, cy, repaint );
411 /**************************************************************************
412 * GetClassName (USER.58)
414 INT16 WINAPI GetClassName16( HWND16 hwnd, LPSTR buffer, INT16 count )
416 return GetClassNameA( WIN_Handle32(hwnd), buffer, count );
420 /**************************************************************************
421 * SetActiveWindow (USER.59)
423 HWND16 WINAPI SetActiveWindow16( HWND16 hwnd )
425 return HWND_16( SetActiveWindow( WIN_Handle32(hwnd) ));
429 /**************************************************************************
430 * GetActiveWindow (USER.60)
432 HWND16 WINAPI GetActiveWindow16(void)
434 return HWND_16( GetActiveWindow() );
438 /**************************************************************************
439 * ScrollWindow (USER.61)
441 void WINAPI ScrollWindow16( HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect,
442 const RECT16 *clipRect )
444 RECT rect32, clipRect32;
446 if (rect) CONV_RECT16TO32( rect, &rect32 );
447 if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 );
448 ScrollWindow( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL,
449 clipRect ? &clipRect32 : NULL );
453 /**************************************************************************
454 * SetScrollPos (USER.62)
456 INT16 WINAPI SetScrollPos16( HWND16 hwnd, INT16 nBar, INT16 nPos, BOOL16 redraw )
458 return SetScrollPos( WIN_Handle32(hwnd), nBar, nPos, redraw );
462 /**************************************************************************
463 * GetScrollPos (USER.63)
465 INT16 WINAPI GetScrollPos16( HWND16 hwnd, INT16 nBar )
467 return GetScrollPos( WIN_Handle32(hwnd), nBar );
471 /**************************************************************************
472 * SetScrollRange (USER.64)
474 void WINAPI SetScrollRange16( HWND16 hwnd, INT16 nBar, INT16 MinVal, INT16 MaxVal, BOOL16 redraw )
476 /* Invalid range -> range is set to (0,0) */
477 if ((INT)MaxVal - (INT)MinVal > 0x7fff) MinVal = MaxVal = 0;
478 SetScrollRange( WIN_Handle32(hwnd), nBar, MinVal, MaxVal, redraw );
482 /**************************************************************************
483 * GetScrollRange (USER.65)
485 BOOL16 WINAPI GetScrollRange16( HWND16 hwnd, INT16 nBar, LPINT16 lpMin, LPINT16 lpMax)
487 INT min, max;
488 BOOL ret = GetScrollRange( WIN_Handle32(hwnd), nBar, &min, &max );
489 if (lpMin) *lpMin = min;
490 if (lpMax) *lpMax = max;
491 return ret;
495 /**************************************************************************
496 * GetDC (USER.66)
498 HDC16 WINAPI GetDC16( HWND16 hwnd )
500 return HDC_16(GetDC( WIN_Handle32(hwnd) ));
504 /**************************************************************************
505 * GetWindowDC (USER.67)
507 HDC16 WINAPI GetWindowDC16( HWND16 hwnd )
509 return GetDCEx16( hwnd, 0, DCX_USESTYLE | DCX_WINDOW );
513 /**************************************************************************
514 * ReleaseDC (USER.68)
516 INT16 WINAPI ReleaseDC16( HWND16 hwnd, HDC16 hdc )
518 return (INT16)ReleaseDC( WIN_Handle32(hwnd), HDC_32(hdc) );
522 /**************************************************************************
523 * EndDialog (USER.88)
525 BOOL16 WINAPI EndDialog16( HWND16 hwnd, INT16 retval )
527 return EndDialog( WIN_Handle32(hwnd), retval );
531 /**************************************************************************
532 * GetDlgItem (USER.91)
534 HWND16 WINAPI GetDlgItem16( HWND16 hwndDlg, INT16 id )
536 return HWND_16( GetDlgItem( WIN_Handle32(hwndDlg), (UINT16) id ));
540 /**************************************************************************
541 * SetDlgItemText (USER.92)
543 void WINAPI SetDlgItemText16( HWND16 hwnd, INT16 id, SEGPTR lpString )
545 SendDlgItemMessage16( hwnd, id, WM_SETTEXT, 0, (LPARAM)lpString );
549 /**************************************************************************
550 * GetDlgItemText (USER.93)
552 INT16 WINAPI GetDlgItemText16( HWND16 hwnd, INT16 id, SEGPTR str, UINT16 len )
554 return (INT16)SendDlgItemMessage16( hwnd, id, WM_GETTEXT, len, (LPARAM)str );
558 /**************************************************************************
559 * SetDlgItemInt (USER.94)
561 void WINAPI SetDlgItemInt16( HWND16 hwnd, INT16 id, UINT16 value, BOOL16 fSigned )
563 SetDlgItemInt( WIN_Handle32(hwnd), (UINT)(UINT16)id,
564 (UINT)(fSigned ? (INT16) value : (UINT16) value), fSigned );
568 /**************************************************************************
569 * GetDlgItemInt (USER.95)
571 UINT16 WINAPI GetDlgItemInt16( HWND16 hwnd, INT16 id, BOOL16 *translated, BOOL16 fSigned )
573 UINT result;
574 BOOL ok;
576 if (translated) *translated = FALSE;
577 result = GetDlgItemInt( WIN_Handle32(hwnd), (UINT)(UINT16)id, &ok, fSigned );
578 if (!ok) return 0;
579 if (fSigned)
581 if (((INT)result < -32767) || ((INT)result > 32767)) return 0;
583 else
585 if (result > 65535) return 0;
587 if (translated) *translated = TRUE;
588 return (UINT16)result;
592 /**************************************************************************
593 * CheckRadioButton (USER.96)
595 BOOL16 WINAPI CheckRadioButton16( HWND16 hwndDlg, UINT16 firstID,
596 UINT16 lastID, UINT16 checkID )
598 return CheckRadioButton( WIN_Handle32(hwndDlg), firstID, lastID, checkID );
602 /**************************************************************************
603 * CheckDlgButton (USER.97)
605 BOOL16 WINAPI CheckDlgButton16( HWND16 hwnd, INT16 id, UINT16 check )
607 SendDlgItemMessage16( hwnd, id, BM_SETCHECK16, check, 0 );
608 return TRUE;
612 /**************************************************************************
613 * IsDlgButtonChecked (USER.98)
615 UINT16 WINAPI IsDlgButtonChecked16( HWND16 hwnd, UINT16 id )
617 return (UINT16)SendDlgItemMessage16( hwnd, id, BM_GETCHECK16, 0, 0 );
621 /**************************************************************************
622 * DlgDirSelect (USER.99)
624 BOOL16 WINAPI DlgDirSelect16( HWND16 hwnd, LPSTR str, INT16 id )
626 return DlgDirSelectEx16( hwnd, str, 128, id );
630 /**************************************************************************
631 * DlgDirList (USER.100)
633 INT16 WINAPI DlgDirList16( HWND16 hDlg, LPSTR spec, INT16 idLBox,
634 INT16 idStatic, UINT16 attrib )
636 /* according to Win16 docs, DDL_DRIVES should make DDL_EXCLUSIVE
637 * be set automatically (this is different in Win32, and
638 * DIALOG_DlgDirList sends Win32 messages to the control,
639 * so do it here) */
640 if (attrib & DDL_DRIVES) attrib |= DDL_EXCLUSIVE;
641 return DlgDirListA( WIN_Handle32(hDlg), spec, idLBox, idStatic, attrib );
645 /**************************************************************************
646 * SendDlgItemMessage (USER.101)
648 LRESULT WINAPI SendDlgItemMessage16( HWND16 hwnd, INT16 id, UINT16 msg,
649 WPARAM16 wParam, LPARAM lParam )
651 HWND16 hwndCtrl = GetDlgItem16( hwnd, id );
652 if (hwndCtrl) return SendMessage16( hwndCtrl, msg, wParam, lParam );
653 else return 0;
657 /**************************************************************************
658 * MapDialogRect (USER.103)
660 void WINAPI MapDialogRect16( HWND16 hwnd, LPRECT16 rect )
662 RECT rect32;
663 MapDialogRect( WIN_Handle32(hwnd), &rect32 );
664 rect->left = rect32.left;
665 rect->right = rect32.right;
666 rect->top = rect32.top;
667 rect->bottom = rect32.bottom;
671 /**************************************************************************
672 * FlashWindow (USER.105)
674 BOOL16 WINAPI FlashWindow16( HWND16 hwnd, BOOL16 bInvert )
676 return FlashWindow( WIN_Handle32(hwnd), bInvert );
680 /**************************************************************************
681 * WindowFromDC (USER.117)
683 HWND16 WINAPI WindowFromDC16( HDC16 hDC )
685 return HWND_16( WindowFromDC( HDC_32(hDC) ) );
689 /**************************************************************************
690 * UpdateWindow (USER.124)
692 void WINAPI UpdateWindow16( HWND16 hwnd )
694 RedrawWindow16( hwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
698 /**************************************************************************
699 * InvalidateRect (USER.125)
701 void WINAPI InvalidateRect16( HWND16 hwnd, const RECT16 *rect, BOOL16 erase )
703 RedrawWindow16( hwnd, rect, 0, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
707 /**************************************************************************
708 * InvalidateRgn (USER.126)
710 void WINAPI InvalidateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
712 RedrawWindow16( hwnd, NULL, hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
716 /**************************************************************************
717 * ValidateRect (USER.127)
719 void WINAPI ValidateRect16( HWND16 hwnd, const RECT16 *rect )
721 RedrawWindow16( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN );
725 /**************************************************************************
726 * ValidateRgn (USER.128)
728 void WINAPI ValidateRgn16( HWND16 hwnd, HRGN16 hrgn )
730 RedrawWindow16( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOCHILDREN );
734 /**************************************************************************
735 * GetClassWord (USER.129)
737 WORD WINAPI GetClassWord16( HWND16 hwnd, INT16 offset )
739 return GetClassWord( WIN_Handle32(hwnd), offset );
743 /**************************************************************************
744 * SetClassWord (USER.130)
746 WORD WINAPI SetClassWord16( HWND16 hwnd, INT16 offset, WORD newval )
748 return SetClassWord( WIN_Handle32(hwnd), offset, newval );
752 /**************************************************************************
753 * GetWindowWord (USER.133)
755 WORD WINAPI GetWindowWord16( HWND16 hwnd, INT16 offset )
757 return GetWindowWord( WIN_Handle32(hwnd), offset );
761 /**************************************************************************
762 * SetWindowWord (USER.134)
764 WORD WINAPI SetWindowWord16( HWND16 hwnd, INT16 offset, WORD newval )
766 return SetWindowWord( WIN_Handle32(hwnd), offset, newval );
770 /**************************************************************************
771 * OpenClipboard (USER.137)
773 BOOL16 WINAPI OpenClipboard16( HWND16 hwnd )
775 return OpenClipboard( WIN_Handle32(hwnd) );
779 /**************************************************************************
780 * GetClipboardOwner (USER.140)
782 HWND16 WINAPI GetClipboardOwner16(void)
784 return HWND_16( GetClipboardOwner() );
788 /**************************************************************************
789 * SetClipboardViewer (USER.147)
791 HWND16 WINAPI SetClipboardViewer16( HWND16 hwnd )
793 return HWND_16( SetClipboardViewer( WIN_Handle32(hwnd) ));
797 /**************************************************************************
798 * GetClipboardViewer (USER.148)
800 HWND16 WINAPI GetClipboardViewer16(void)
802 return HWND_16( GetClipboardViewer() );
806 /**************************************************************************
807 * ChangeClipboardChain (USER.149)
809 BOOL16 WINAPI ChangeClipboardChain16(HWND16 hwnd, HWND16 hwndNext)
811 return ChangeClipboardChain( WIN_Handle32(hwnd), WIN_Handle32(hwndNext) );
815 /**************************************************************************
816 * GetSystemMenu (USER.156)
818 HMENU16 WINAPI GetSystemMenu16( HWND16 hwnd, BOOL16 revert )
820 return HMENU_16(GetSystemMenu( WIN_Handle32(hwnd), revert ));
824 /**************************************************************************
825 * GetMenu (USER.157)
827 HMENU16 WINAPI GetMenu16( HWND16 hwnd )
829 return HMENU_16(GetMenu( WIN_Handle32(hwnd) ));
833 /**************************************************************************
834 * SetMenu (USER.158)
836 BOOL16 WINAPI SetMenu16( HWND16 hwnd, HMENU16 hMenu )
838 return SetMenu( WIN_Handle32(hwnd), HMENU_32(hMenu) );
842 /**************************************************************************
843 * DrawMenuBar (USER.160)
845 void WINAPI DrawMenuBar16( HWND16 hwnd )
847 DrawMenuBar( WIN_Handle32(hwnd) );
851 /**************************************************************************
852 * HiliteMenuItem (USER.162)
854 BOOL16 WINAPI HiliteMenuItem16( HWND16 hwnd, HMENU16 hMenu, UINT16 id, UINT16 wHilite )
856 return HiliteMenuItem( WIN_Handle32(hwnd), HMENU_32(hMenu), id, wHilite );
860 /**************************************************************************
861 * CreateCaret (USER.163)
863 void WINAPI CreateCaret16( HWND16 hwnd, HBITMAP16 bitmap, INT16 width, INT16 height )
865 CreateCaret( WIN_Handle32(hwnd), HBITMAP_32(bitmap), width, height );
869 /*****************************************************************
870 * DestroyCaret (USER.164)
872 void WINAPI DestroyCaret16(void)
874 DestroyCaret();
878 /*****************************************************************
879 * SetCaretPos (USER.165)
881 void WINAPI SetCaretPos16( INT16 x, INT16 y )
883 SetCaretPos( x, y );
887 /**************************************************************************
888 * HideCaret (USER.166)
890 void WINAPI HideCaret16( HWND16 hwnd )
892 HideCaret( WIN_Handle32(hwnd) );
896 /**************************************************************************
897 * ShowCaret (USER.167)
899 void WINAPI ShowCaret16( HWND16 hwnd )
901 ShowCaret( WIN_Handle32(hwnd) );
905 /*****************************************************************
906 * SetCaretBlinkTime (USER.168)
908 void WINAPI SetCaretBlinkTime16( UINT16 msecs )
910 SetCaretBlinkTime( msecs );
914 /*****************************************************************
915 * GetCaretBlinkTime (USER.169)
917 UINT16 WINAPI GetCaretBlinkTime16(void)
919 return GetCaretBlinkTime();
923 /**************************************************************************
924 * ArrangeIconicWindows (USER.170)
926 UINT16 WINAPI ArrangeIconicWindows16( HWND16 parent)
928 return ArrangeIconicWindows( WIN_Handle32(parent) );
932 /**************************************************************************
933 * SwitchToThisWindow (USER.172)
935 void WINAPI SwitchToThisWindow16( HWND16 hwnd, BOOL16 restore )
937 SwitchToThisWindow( WIN_Handle32(hwnd), restore );
941 /**************************************************************************
942 * KillSystemTimer (USER.182)
944 BOOL16 WINAPI KillSystemTimer16( HWND16 hwnd, UINT16 id )
946 return KillSystemTimer( WIN_Handle32(hwnd), id );
950 /*****************************************************************
951 * GetCaretPos (USER.183)
953 void WINAPI GetCaretPos16( LPPOINT16 pt16 )
955 POINT pt;
956 if (GetCaretPos( &pt ))
958 pt16->x = pt.x;
959 pt16->y = pt.y;
964 /**************************************************************************
965 * SetSysModalWindow (USER.188)
967 HWND16 WINAPI SetSysModalWindow16( HWND16 hwnd )
969 HWND16 old = hwndSysModal;
970 hwndSysModal = hwnd;
971 return old;
975 /**************************************************************************
976 * GetSysModalWindow (USER.189)
978 HWND16 WINAPI GetSysModalWindow16(void)
980 return hwndSysModal;
984 /**************************************************************************
985 * GetUpdateRect (USER.190)
987 BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
989 RECT r;
990 BOOL16 ret;
992 if (!rect) return GetUpdateRect( WIN_Handle32(hwnd), NULL, erase );
993 ret = GetUpdateRect( WIN_Handle32(hwnd), &r, erase );
994 CONV_RECT32TO16( &r, rect );
995 return ret;
999 /**************************************************************************
1000 * ChildWindowFromPoint (USER.191)
1002 HWND16 WINAPI ChildWindowFromPoint16( HWND16 hwndParent, POINT16 pt )
1004 POINT pt32;
1005 CONV_POINT16TO32( &pt, &pt32 );
1006 return HWND_16( ChildWindowFromPoint( WIN_Handle32(hwndParent), pt32 ));
1010 /**************************************************************************
1011 * DlgDirSelectComboBox (USER.194)
1013 BOOL16 WINAPI DlgDirSelectComboBox16( HWND16 hwnd, LPSTR str, INT16 id )
1015 return DlgDirSelectComboBoxEx16( hwnd, str, 128, id );
1019 /**************************************************************************
1020 * DlgDirListComboBox (USER.195)
1022 INT16 WINAPI DlgDirListComboBox16( HWND16 hDlg, LPSTR spec, INT16 idCBox,
1023 INT16 idStatic, UINT16 attrib )
1025 return DlgDirListComboBoxA( WIN_Handle32(hDlg), spec, idCBox, idStatic, attrib );
1029 /***********************************************************************
1030 * GetWindowTask (USER.224)
1032 HTASK16 WINAPI GetWindowTask16( HWND16 hwnd )
1034 DWORD tid = GetWindowThreadProcessId( HWND_32(hwnd), NULL );
1035 if (!tid) return 0;
1036 return HTASK_16(tid);
1039 /**********************************************************************
1040 * EnumTaskWindows (USER.225)
1042 BOOL16 WINAPI EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func, LPARAM lParam )
1044 struct wnd_enum_info info;
1045 DWORD tid = HTASK_32( hTask );
1047 if (!tid) return FALSE;
1048 info.proc = func;
1049 info.param = lParam;
1050 return EnumThreadWindows( tid, wnd_enum_callback, (LPARAM)&info );
1054 /**************************************************************************
1055 * GetNextDlgGroupItem (USER.227)
1057 HWND16 WINAPI GetNextDlgGroupItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
1058 BOOL16 fPrevious )
1060 return HWND_16( GetNextDlgGroupItem( WIN_Handle32(hwndDlg),
1061 WIN_Handle32(hwndCtrl), fPrevious ));
1065 /**************************************************************************
1066 * GetNextDlgTabItem (USER.228)
1068 HWND16 WINAPI GetNextDlgTabItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
1069 BOOL16 fPrevious )
1071 return HWND_16( GetNextDlgTabItem( WIN_Handle32(hwndDlg),
1072 WIN_Handle32(hwndCtrl), fPrevious ));
1076 /**************************************************************************
1077 * GetTopWindow (USER.229)
1079 HWND16 WINAPI GetTopWindow16( HWND16 hwnd )
1081 return HWND_16( GetTopWindow( WIN_Handle32(hwnd) ));
1085 /**************************************************************************
1086 * GetNextWindow (USER.230)
1088 HWND16 WINAPI GetNextWindow16( HWND16 hwnd, WORD flag )
1090 if ((flag != GW_HWNDNEXT) && (flag != GW_HWNDPREV)) return 0;
1091 return GetWindow16( hwnd, flag );
1095 /**************************************************************************
1096 * SetWindowPos (USER.232)
1098 BOOL16 WINAPI SetWindowPos16( HWND16 hwnd, HWND16 hwndInsertAfter,
1099 INT16 x, INT16 y, INT16 cx, INT16 cy, WORD flags)
1101 return SetWindowPos( WIN_Handle32(hwnd), full_insert_after_hwnd(hwndInsertAfter),
1102 x, y, cx, cy, flags );
1106 /**************************************************************************
1107 * SetParent (USER.233)
1109 HWND16 WINAPI SetParent16( HWND16 hwndChild, HWND16 hwndNewParent )
1111 return HWND_16( SetParent( WIN_Handle32(hwndChild), WIN_Handle32(hwndNewParent) ));
1115 /**************************************************************************
1116 * GetCapture (USER.236)
1118 HWND16 WINAPI GetCapture16(void)
1120 return HWND_16( GetCapture() );
1124 /**************************************************************************
1125 * GetUpdateRgn (USER.237)
1127 INT16 WINAPI GetUpdateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
1129 return GetUpdateRgn( WIN_Handle32(hwnd), HRGN_32(hrgn), erase );
1133 /**************************************************************************
1134 * ExcludeUpdateRgn (USER.238)
1136 INT16 WINAPI ExcludeUpdateRgn16( HDC16 hdc, HWND16 hwnd )
1138 return ExcludeUpdateRgn( HDC_32(hdc), WIN_Handle32(hwnd) );
1142 /**************************************************************************
1143 * GetOpenClipboardWindow (USER.248)
1145 HWND16 WINAPI GetOpenClipboardWindow16(void)
1147 return HWND_16( GetOpenClipboardWindow() );
1151 /**************************************************************************
1152 * BeginDeferWindowPos (USER.259)
1154 HDWP16 WINAPI BeginDeferWindowPos16( INT16 count )
1156 return BeginDeferWindowPos( count );
1160 /**************************************************************************
1161 * DeferWindowPos (USER.260)
1163 HDWP16 WINAPI DeferWindowPos16( HDWP16 hdwp, HWND16 hwnd, HWND16 hwndAfter,
1164 INT16 x, INT16 y, INT16 cx, INT16 cy,
1165 UINT16 flags )
1167 return HDWP_16(DeferWindowPos( HDWP_32(hdwp), WIN_Handle32(hwnd),
1168 full_insert_after_hwnd(hwndAfter), x, y, cx, cy, flags ));
1172 /**************************************************************************
1173 * EndDeferWindowPos (USER.261)
1175 BOOL16 WINAPI EndDeferWindowPos16( HDWP16 hdwp )
1177 return EndDeferWindowPos(HDWP_32(hdwp));
1181 /**************************************************************************
1182 * GetWindow (USER.262)
1184 HWND16 WINAPI GetWindow16( HWND16 hwnd, WORD rel )
1186 return HWND_16( GetWindow( WIN_Handle32(hwnd), rel ) );
1190 /**************************************************************************
1191 * ShowOwnedPopups (USER.265)
1193 void WINAPI ShowOwnedPopups16( HWND16 owner, BOOL16 fShow )
1195 ShowOwnedPopups( WIN_Handle32(owner), fShow );
1199 /**************************************************************************
1200 * ShowScrollBar (USER.267)
1202 void WINAPI ShowScrollBar16( HWND16 hwnd, INT16 nBar, BOOL16 fShow )
1204 ShowScrollBar( WIN_Handle32(hwnd), nBar, fShow );
1208 /**************************************************************************
1209 * IsZoomed (USER.272)
1211 BOOL16 WINAPI IsZoomed16(HWND16 hwnd)
1213 return IsZoomed( WIN_Handle32(hwnd) );
1217 /**************************************************************************
1218 * GetDlgCtrlID (USER.277)
1220 INT16 WINAPI GetDlgCtrlID16( HWND16 hwnd )
1222 return GetDlgCtrlID( WIN_Handle32(hwnd) );
1226 /**************************************************************************
1227 * GetDesktopHwnd (USER.278)
1229 * Exactly the same thing as GetDesktopWindow(), but not documented.
1230 * Don't ask me why...
1232 HWND16 WINAPI GetDesktopHwnd16(void)
1234 return GetDesktopWindow16();
1238 /**************************************************************************
1239 * SetSystemMenu (USER.280)
1241 BOOL16 WINAPI SetSystemMenu16( HWND16 hwnd, HMENU16 hMenu )
1243 return SetSystemMenu( WIN_Handle32(hwnd), HMENU_32(hMenu) );
1247 /**************************************************************************
1248 * GetDesktopWindow (USER.286)
1250 HWND16 WINAPI GetDesktopWindow16(void)
1252 return HWND_16( GetDesktopWindow() );
1256 /**************************************************************************
1257 * GetLastActivePopup (USER.287)
1259 HWND16 WINAPI GetLastActivePopup16( HWND16 hwnd )
1261 return HWND_16( GetLastActivePopup( WIN_Handle32(hwnd) ));
1265 /**************************************************************************
1266 * RedrawWindow (USER.290)
1268 BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate,
1269 HRGN16 hrgnUpdate, UINT16 flags )
1271 if (rectUpdate)
1273 RECT r;
1274 CONV_RECT16TO32( rectUpdate, &r );
1275 return RedrawWindow(WIN_Handle32(hwnd), &r, HRGN_32(hrgnUpdate), flags);
1277 return RedrawWindow(WIN_Handle32(hwnd), NULL, HRGN_32(hrgnUpdate), flags);
1281 /**************************************************************************
1282 * LockWindowUpdate (USER.294)
1284 BOOL16 WINAPI LockWindowUpdate16( HWND16 hwnd )
1286 return LockWindowUpdate( WIN_Handle32(hwnd) );
1290 /**************************************************************************
1291 * ScrollWindowEx (USER.319)
1293 INT16 WINAPI ScrollWindowEx16( HWND16 hwnd, INT16 dx, INT16 dy,
1294 const RECT16 *rect, const RECT16 *clipRect,
1295 HRGN16 hrgnUpdate, LPRECT16 rcUpdate,
1296 UINT16 flags )
1298 RECT rect32, clipRect32, rcUpdate32;
1299 BOOL16 ret;
1301 if (rect) CONV_RECT16TO32( rect, &rect32 );
1302 if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 );
1303 ret = ScrollWindowEx( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL,
1304 clipRect ? &clipRect32 : NULL, HRGN_32(hrgnUpdate),
1305 (rcUpdate) ? &rcUpdate32 : NULL, flags );
1306 if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate );
1307 return ret;
1311 /**************************************************************************
1312 * FillWindow (USER.324)
1314 void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hbrush )
1316 RECT rect;
1317 RECT16 rc16;
1318 GetClientRect( WIN_Handle32(hwnd), &rect );
1319 DPtoLP( HDC_32(hdc), (LPPOINT)&rect, 2 );
1320 CONV_RECT32TO16( &rect, &rc16 );
1321 PaintRect16( hwndParent, hwnd, hdc, hbrush, &rc16 );
1325 /**************************************************************************
1326 * PaintRect (USER.325)
1328 void WINAPI PaintRect16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
1329 HBRUSH16 hbrush, const RECT16 *rect)
1331 if (hbrush <= CTLCOLOR_STATIC)
1333 HWND parent = WIN_Handle32(hwndParent), hwnd32 = WIN_Handle32(hwnd);
1335 if (!parent) return;
1336 hbrush = SendMessageW( parent, WM_CTLCOLORMSGBOX + hbrush, (WPARAM)hdc, (LPARAM)hwnd32 );
1337 if (!hbrush) hbrush = DefWindowProcW( parent, WM_CTLCOLORMSGBOX + hbrush,
1338 (WPARAM)hdc, (LPARAM)hwnd32 );
1340 if (hbrush) FillRect16( hdc, rect, hbrush );
1344 /**************************************************************************
1345 * GetControlBrush (USER.326)
1347 HBRUSH16 WINAPI GetControlBrush16( HWND16 hwnd, HDC16 hdc, UINT16 ctlType )
1349 HBRUSH16 ret;
1350 HWND hwnd32 = WIN_Handle32(hwnd);
1351 HWND parent = GetParent( hwnd32 );
1353 if (!parent) parent = hwnd32;
1354 ret = SendMessageW( parent, WM_CTLCOLORMSGBOX + ctlType, (WPARAM)hdc, (LPARAM)hwnd32 );
1355 if (!ret) ret = DefWindowProcW( parent, WM_CTLCOLORMSGBOX + ctlType,
1356 (WPARAM)hdc, (LPARAM)hwnd32 );
1357 return ret;
1361 /**************************************************************************
1362 * GetDCEx (USER.359)
1364 HDC16 WINAPI GetDCEx16( HWND16 hwnd, HRGN16 hrgnClip, DWORD flags )
1366 return HDC_16(GetDCEx(WIN_Handle32(hwnd), HRGN_32(hrgnClip), flags));
1370 /**************************************************************************
1371 * GetWindowPlacement (USER.370)
1373 BOOL16 WINAPI GetWindowPlacement16( HWND16 hwnd, WINDOWPLACEMENT16 *wp16 )
1375 WINDOWPLACEMENT wpl;
1377 wpl.length = sizeof(wpl);
1378 if (!GetWindowPlacement( WIN_Handle32(hwnd), &wpl )) return FALSE;
1379 wp16->length = sizeof(*wp16);
1380 wp16->flags = wpl.flags;
1381 wp16->showCmd = wpl.showCmd;
1382 CONV_POINT32TO16( &wpl.ptMinPosition, &wp16->ptMinPosition );
1383 CONV_POINT32TO16( &wpl.ptMaxPosition, &wp16->ptMaxPosition );
1384 CONV_RECT32TO16( &wpl.rcNormalPosition, &wp16->rcNormalPosition );
1385 return TRUE;
1389 /**************************************************************************
1390 * SetWindowPlacement (USER.371)
1392 BOOL16 WINAPI SetWindowPlacement16( HWND16 hwnd, const WINDOWPLACEMENT16 *wp16 )
1394 WINDOWPLACEMENT wpl;
1396 if (!wp16) return FALSE;
1397 wpl.length = sizeof(wpl);
1398 wpl.flags = wp16->flags;
1399 wpl.showCmd = wp16->showCmd;
1400 wpl.ptMinPosition.x = wp16->ptMinPosition.x;
1401 wpl.ptMinPosition.y = wp16->ptMinPosition.y;
1402 wpl.ptMaxPosition.x = wp16->ptMaxPosition.x;
1403 wpl.ptMaxPosition.y = wp16->ptMaxPosition.y;
1404 wpl.rcNormalPosition.left = wp16->rcNormalPosition.left;
1405 wpl.rcNormalPosition.top = wp16->rcNormalPosition.top;
1406 wpl.rcNormalPosition.right = wp16->rcNormalPosition.right;
1407 wpl.rcNormalPosition.bottom = wp16->rcNormalPosition.bottom;
1408 return SetWindowPlacement( WIN_Handle32(hwnd), &wpl );
1412 /**************************************************************************
1413 * ChildWindowFromPointEx (USER.399)
1415 HWND16 WINAPI ChildWindowFromPointEx16( HWND16 hwndParent, POINT16 pt, UINT16 uFlags)
1417 POINT pt32;
1418 CONV_POINT16TO32( &pt, &pt32 );
1419 return HWND_16( ChildWindowFromPointEx( WIN_Handle32(hwndParent), pt32, uFlags ));
1423 /**************************************************************************
1424 * GetPriorityClipboardFormat (USER.402)
1426 INT16 WINAPI GetPriorityClipboardFormat16( UINT16 *list, INT16 count )
1428 int i;
1430 for (i = 0; i < count; i++)
1431 if (IsClipboardFormatAvailable( list[i] )) return list[i];
1432 return -1;
1436 /**************************************************************************
1437 * TrackPopupMenu (USER.416)
1439 BOOL16 WINAPI TrackPopupMenu16( HMENU16 hMenu, UINT16 wFlags, INT16 x, INT16 y,
1440 INT16 nReserved, HWND16 hwnd, const RECT16 *lpRect )
1442 RECT r;
1443 if (lpRect) CONV_RECT16TO32( lpRect, &r );
1444 return TrackPopupMenu( HMENU_32(hMenu), wFlags, x, y, nReserved,
1445 WIN_Handle32(hwnd), lpRect ? &r : NULL );
1449 /**************************************************************************
1450 * DlgDirSelectEx (USER.422)
1452 BOOL16 WINAPI DlgDirSelectEx16( HWND16 hwnd, LPSTR str, INT16 len, INT16 id )
1454 return DlgDirSelectExA( WIN_Handle32(hwnd), str, len, id );
1458 /**************************************************************************
1459 * DlgDirSelectComboBoxEx (USER.423)
1461 BOOL16 WINAPI DlgDirSelectComboBoxEx16( HWND16 hwnd, LPSTR str, INT16 len,
1462 INT16 id )
1464 return DlgDirSelectComboBoxExA( WIN_Handle32(hwnd), str, len, id );
1468 /**************************************************************************
1469 * FindWindowEx (USER.427)
1471 HWND16 WINAPI FindWindowEx16( HWND16 parent, HWND16 child, LPCSTR className, LPCSTR title )
1473 return HWND_16( FindWindowExA( WIN_Handle32(parent), WIN_Handle32(child),
1474 className, title ));
1478 /**************************************************************************
1479 * DrawAnimatedRects (USER.448)
1481 BOOL16 WINAPI DrawAnimatedRects16( HWND16 hwnd, INT16 idAni,
1482 const RECT16* lprcFrom, const RECT16* lprcTo )
1484 RECT rcFrom32, rcTo32;
1485 rcFrom32.left = lprcFrom->left;
1486 rcFrom32.top = lprcFrom->top;
1487 rcFrom32.right = lprcFrom->right;
1488 rcFrom32.bottom = lprcFrom->bottom;
1489 rcTo32.left = lprcTo->left;
1490 rcTo32.top = lprcTo->top;
1491 rcTo32.right = lprcTo->right;
1492 rcTo32.bottom = lprcTo->bottom;
1493 return DrawAnimatedRects( WIN_Handle32(hwnd), idAni, &rcFrom32, &rcTo32 );
1497 /***********************************************************************
1498 * GetInternalWindowPos (USER.460)
1500 UINT16 WINAPI GetInternalWindowPos16( HWND16 hwnd, LPRECT16 rectWnd, LPPOINT16 ptIcon )
1502 WINDOWPLACEMENT16 wndpl;
1504 if (!GetWindowPlacement16( hwnd, &wndpl )) return 0;
1505 if (rectWnd) *rectWnd = wndpl.rcNormalPosition;
1506 if (ptIcon) *ptIcon = wndpl.ptMinPosition;
1507 return wndpl.showCmd;
1511 /**************************************************************************
1512 * SetInternalWindowPos (USER.461)
1514 void WINAPI SetInternalWindowPos16( HWND16 hwnd, UINT16 showCmd, LPRECT16 rect, LPPOINT16 pt )
1516 RECT rc32;
1517 POINT pt32;
1519 if (rect)
1521 rc32.left = rect->left;
1522 rc32.top = rect->top;
1523 rc32.right = rect->right;
1524 rc32.bottom = rect->bottom;
1526 if (pt)
1528 pt32.x = pt->x;
1529 pt32.y = pt->y;
1531 SetInternalWindowPos( WIN_Handle32(hwnd), showCmd,
1532 rect ? &rc32 : NULL, pt ? &pt32 : NULL );
1536 /**************************************************************************
1537 * CalcChildScroll (USER.462)
1539 void WINAPI CalcChildScroll16( HWND16 hwnd, WORD scroll )
1541 CalcChildScroll( WIN_Handle32(hwnd), scroll );
1545 /**************************************************************************
1546 * ScrollChildren (USER.463)
1548 void WINAPI ScrollChildren16(HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM lParam)
1550 ScrollChildren( WIN_Handle32(hwnd), uMsg, wParam, lParam );
1554 /**************************************************************************
1555 * DragDetect (USER.465)
1557 BOOL16 WINAPI DragDetect16( HWND16 hwnd, POINT16 pt )
1559 POINT pt32;
1560 CONV_POINT16TO32( &pt, &pt32 );
1561 return DragDetect( WIN_Handle32(hwnd), pt32 );
1565 /**************************************************************************
1566 * SetScrollInfo (USER.475)
1568 INT16 WINAPI SetScrollInfo16( HWND16 hwnd, INT16 nBar, const SCROLLINFO *info, BOOL16 redraw )
1570 return SetScrollInfo( WIN_Handle32(hwnd), nBar, info, redraw );
1574 /**************************************************************************
1575 * GetScrollInfo (USER.476)
1577 BOOL16 WINAPI GetScrollInfo16( HWND16 hwnd, INT16 nBar, LPSCROLLINFO info )
1579 return GetScrollInfo( WIN_Handle32(hwnd), nBar, info );
1583 /**************************************************************************
1584 * EnableScrollBar (USER.482)
1586 BOOL16 WINAPI EnableScrollBar16( HWND16 hwnd, INT16 nBar, UINT16 flags )
1588 return EnableScrollBar( WIN_Handle32(hwnd), nBar, flags );
1592 /**************************************************************************
1593 * GetShellWindow (USER.600)
1595 HWND16 WINAPI GetShellWindow16(void)
1597 return HWND_16( GetShellWindow() );
1601 /**************************************************************************
1602 * GetForegroundWindow (USER.608)
1604 HWND16 WINAPI GetForegroundWindow16(void)
1606 return HWND_16( GetForegroundWindow() );
1610 /**************************************************************************
1611 * SetForegroundWindow (USER.609)
1613 BOOL16 WINAPI SetForegroundWindow16( HWND16 hwnd )
1615 return SetForegroundWindow( WIN_Handle32(hwnd) );
1619 /**************************************************************************
1620 * DrawCaptionTemp (USER.657)
1622 BOOL16 WINAPI DrawCaptionTemp16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect,
1623 HFONT16 hFont, HICON16 hIcon, LPCSTR str, UINT16 uFlags )
1625 RECT rect32;
1627 if (rect) CONV_RECT16TO32(rect,&rect32);
1629 return DrawCaptionTempA( WIN_Handle32(hwnd), HDC_32(hdc),
1630 rect ? &rect32 : NULL, HFONT_32(hFont),
1631 HICON_32(hIcon), str, uFlags & 0x1f );
1635 /**************************************************************************
1636 * DrawCaption (USER.660)
1638 BOOL16 WINAPI DrawCaption16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect, UINT16 flags )
1640 RECT rect32;
1642 if (rect) CONV_RECT16TO32( rect, &rect32 );
1644 return DrawCaption(WIN_Handle32(hwnd), HDC_32(hdc), rect ? &rect32 : NULL, flags);
1648 /**************************************************************************
1649 * GetMenuItemRect (USER.665)
1651 BOOL16 WINAPI GetMenuItemRect16( HWND16 hwnd, HMENU16 hMenu, UINT16 uItem,
1652 LPRECT16 rect)
1654 RECT r32;
1655 BOOL res;
1656 if (!rect) return FALSE;
1657 res = GetMenuItemRect( WIN_Handle32(hwnd), HMENU_32(hMenu), uItem, &r32 );
1658 CONV_RECT32TO16( &r32, rect );
1659 return res;
1663 /**************************************************************************
1664 * SetWindowRgn (USER.668)
1666 INT16 WINAPI SetWindowRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 redraw )
1668 return SetWindowRgn( WIN_Handle32(hwnd), HRGN_32(hrgn), redraw );
1672 /**************************************************************************
1673 * MessageBoxIndirect (USER.827)
1675 INT16 WINAPI MessageBoxIndirect16( LPMSGBOXPARAMS16 msgbox )
1677 MSGBOXPARAMSA msgbox32;
1679 msgbox32.cbSize = msgbox->cbSize;
1680 msgbox32.hwndOwner = WIN_Handle32( msgbox->hwndOwner );
1681 msgbox32.hInstance = MapHModuleSL(msgbox->hInstance);
1682 msgbox32.lpszText = MapSL(msgbox->lpszText);
1683 msgbox32.lpszCaption = MapSL(msgbox->lpszCaption);
1684 msgbox32.dwStyle = msgbox->dwStyle;
1685 msgbox32.lpszIcon = MapSL(msgbox->lpszIcon);
1686 msgbox32.dwContextHelpId = msgbox->dwContextHelpId;
1687 msgbox32.lpfnMsgBoxCallback = msgbox->lpfnMsgBoxCallback;
1688 msgbox32.dwLanguageId = msgbox->dwLanguageId;
1689 return MessageBoxIndirectA( &msgbox32 );