Release 961215
[wine.git] / win32 / user32.c
blob3880aebd1357e8284ac1f1ee37c3632cb524cde8
1 /*
2 * Win32 user functions
4 * Copyright 1995 Martin von Loewis
5 */
7 /* This file contains only wrappers to existing Wine functions or trivial
8 stubs. 'Real' implementations go into context specific files */
10 #include <unistd.h>
11 #include <stdio.h>
12 #include <stdarg.h>
13 #include "windows.h"
14 #include "winerror.h"
15 #include "heap.h"
16 #include "xmalloc.h"
17 #include "handle32.h"
18 #include "struct32.h"
19 #include "string32.h"
20 #include "win.h"
21 #include "debug.h"
22 #include "stddebug.h"
24 /***********************************************************************
25 * GetMessageA (USER32.269)
27 BOOL USER32_GetMessageA(MSG32* lpmsg,DWORD hwnd,DWORD min,DWORD max)
29 BOOL ret;
30 MSG16 *msg = SEGPTR_NEW(MSG16);
31 if (!msg) return 0;
32 ret=GetMessage(SEGPTR_GET(msg),(HWND)hwnd,min,max);
33 STRUCT32_MSG16to32(msg,lpmsg);
34 SEGPTR_FREE(msg);
35 return ret;
38 /***********************************************************************
39 * IsDialogMessageA (USER32.341)
41 BOOL IsDialogMessage32A(DWORD hwnd, MSG32* lpmsg)
43 MSG16 msg;
44 STRUCT32_MSG32to16(lpmsg, &msg);
45 return IsDialogMessage(hwnd, &msg);
48 /***********************************************************************
49 * IsDialogMessage32W (USER32.342)
51 BOOL IsDialogMessage32W(DWORD hwnd, MSG32* lpmsg)
53 MSG16 msg;
54 STRUCT32_MSG32to16(lpmsg, &msg);
55 return IsDialogMessage(hwnd, &msg);
58 /***********************************************************************
59 * DispatchMessageA (USER32.140)
61 LONG USER32_DispatchMessageA(MSG32* lpmsg)
63 MSG16 msg;
64 LONG ret;
65 STRUCT32_MSG32to16(lpmsg,&msg);
66 ret=DispatchMessage(&msg);
67 STRUCT32_MSG16to32(&msg,lpmsg);
68 return ret;
71 /***********************************************************************
72 * TranslateMessage (USER32.555)
74 BOOL USER32_TranslateMessage(MSG32* lpmsg)
76 MSG16 msg;
77 STRUCT32_MSG32to16(lpmsg,&msg);
78 return TranslateMessage(&msg);
81 /***********************************************************************
82 * PeekMessageA
84 BOOL32 PeekMessage32A( LPMSG32 lpmsg, HWND32 hwnd,
85 UINT32 min,UINT32 max,UINT32 wRemoveMsg)
87 MSG16 msg;
88 BOOL ret;
89 ret=PeekMessage16(&msg,hwnd,min,max,wRemoveMsg);
90 /* FIXME: should translate the message to Win32 */
91 STRUCT32_MSG16to32(&msg,lpmsg);
92 return ret;
95 /***********************************************************************
96 * PeekMessageW
98 BOOL32 PeekMessage32W( LPMSG32 lpmsg, HWND32 hwnd,
99 UINT32 min,UINT32 max,UINT32 wRemoveMsg)
101 /* FIXME: Should perform Unicode translation on specific messages */
102 return PeekMessage32A(lpmsg,hwnd,min,max,wRemoveMsg);