Release 960805
[wine] / win32 / user32.c
1 /*
2  * Win32 user functions
3  *
4  * Copyright 1995 Martin von Loewis
5  */
6
7 /* This file contains only wrappers to existing Wine functions or trivial
8    stubs. 'Real' implementations go into context specific files */
9
10 #include <unistd.h>
11 #include <stdio.h>
12 #include <stdarg.h>
13 #include "windows.h"
14 #include "winerror.h"
15 #include "stackframe.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"
23
24 /***********************************************************************
25  *          GetMessageA          (USER32.269)
26  */
27 BOOL USER32_GetMessageA(MSG32* lpmsg,DWORD hwnd,DWORD min,DWORD max)
28 {
29         BOOL ret;
30         MSG16 msg;
31         ret=GetMessage(MAKE_SEGPTR(&msg),(HWND)hwnd,min,max);
32         STRUCT32_MSG16to32(&msg,lpmsg);
33         return ret;
34 }
35
36 /***********************************************************************
37  *          IsDialogMessageA     (USER32.341)
38  */
39 BOOL IsDialogMessage32A(DWORD hwnd, MSG32* lpmsg)
40 {
41         MSG16 msg;
42         STRUCT32_MSG32to16(lpmsg, &msg);
43         return IsDialogMessage(hwnd, &msg);
44 }
45
46 /***********************************************************************
47  *         DispatchMessageA       (USER32.140)
48  */
49 LONG USER32_DispatchMessageA(MSG32* lpmsg)
50 {
51         MSG16 msg;
52         LONG ret;
53         STRUCT32_MSG32to16(lpmsg,&msg);
54         ret=DispatchMessage(&msg);
55         STRUCT32_MSG16to32(&msg,lpmsg);
56         return ret;
57 }
58
59 /***********************************************************************
60  *         TranslateMessage       (USER32.555)
61  */
62 BOOL USER32_TranslateMessage(MSG32* lpmsg)
63 {
64         MSG16 msg;
65         STRUCT32_MSG32to16(lpmsg,&msg);
66         return TranslateMessage(&msg);
67 }
68
69 /***********************************************************************
70  *         PeekMessageA
71  */
72 BOOL32 PeekMessage32A( LPMSG32 lpmsg, HWND32 hwnd,
73                        UINT32 min,UINT32 max,UINT32 wRemoveMsg)
74 {
75         MSG16 msg;
76         BOOL ret;
77         ret=PeekMessage16(&msg,hwnd,min,max,wRemoveMsg);
78         /* FIXME: should translate the message to Win32 */
79         STRUCT32_MSG16to32(&msg,lpmsg);
80         return ret;
81 }
82
83 /***********************************************************************
84  *         PeekMessageW
85  */
86 BOOL32 PeekMessage32W( LPMSG32 lpmsg, HWND32 hwnd,
87                        UINT32 min,UINT32 max,UINT32 wRemoveMsg)
88 {
89         /* FIXME: Should perform Unicode translation on specific messages */
90         return PeekMessage32A(lpmsg,hwnd,min,max,wRemoveMsg);
91 }