Release 960712
[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 "resource32.h"
20 #include "string32.h"
21 #include "win.h"
22 #include "debug.h"
23 #include "stddebug.h"
24
25 /***********************************************************************
26  *          GetMessageA          (USER32.269)
27  */
28 BOOL USER32_GetMessageA(MSG32* lpmsg,DWORD hwnd,DWORD min,DWORD max)
29 {
30         BOOL ret;
31         MSG16 msg;
32         ret=GetMessage(MAKE_SEGPTR(&msg),(HWND)hwnd,min,max);
33         STRUCT32_MSG16to32(&msg,lpmsg);
34         return ret;
35 }
36
37 /***********************************************************************
38  *         DispatchMessageA       (USER32.140)
39  */
40 LONG USER32_DispatchMessageA(MSG32* lpmsg)
41 {
42         MSG16 msg;
43         LONG ret;
44         STRUCT32_MSG32to16(lpmsg,&msg);
45         ret=DispatchMessage(&msg);
46         STRUCT32_MSG16to32(&msg,lpmsg);
47         return ret;
48 }
49
50 /***********************************************************************
51  *         TranslateMessage       (USER32.555)
52  */
53 BOOL USER32_TranslateMessage(MSG32* lpmsg)
54 {
55         MSG16 msg;
56         STRUCT32_MSG32to16(lpmsg,&msg);
57         return TranslateMessage(&msg);
58 }
59
60 /***********************************************************************
61  *         PeekMessageA
62  */
63 BOOL32 PeekMessage32A( LPMSG32 lpmsg, HWND32 hwnd,
64                        UINT32 min,UINT32 max,UINT32 wRemoveMsg)
65 {
66         MSG16 msg;
67         BOOL ret;
68         ret=PeekMessage16(&msg,hwnd,min,max,wRemoveMsg);
69         /* FIXME: should translate the message to Win32 */
70         STRUCT32_MSG16to32(&msg,lpmsg);
71         return ret;
72 }
73
74 /***********************************************************************
75  *         PeekMessageW
76  */
77 BOOL32 PeekMessage32W( LPMSG32 lpmsg, HWND32 hwnd,
78                        UINT32 min,UINT32 max,UINT32 wRemoveMsg)
79 {
80         /* FIXME: Should perform Unicode translation on specific messages */
81         return PeekMessage32A(lpmsg,hwnd,min,max,wRemoveMsg);
82 }