Release 961222
[wine/gsoc-2012-control.git] / win32 / user32.c
blob89c1a407354ebd8e83aeaf4f43bc00fe7ea92187
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 "win.h"
20 #include "debug.h"
21 #include "stddebug.h"
23 /***********************************************************************
24 * GetMessageA (USER32.269)
26 BOOL USER32_GetMessageA(MSG32* lpmsg,DWORD hwnd,DWORD min,DWORD max)
28 BOOL ret;
29 MSG16 *msg = SEGPTR_NEW(MSG16);
30 if (!msg) return 0;
31 ret=GetMessage(SEGPTR_GET(msg),(HWND)hwnd,min,max);
32 STRUCT32_MSG16to32(msg,lpmsg);
33 SEGPTR_FREE(msg);
34 return ret;
37 /***********************************************************************
38 * IsDialogMessageA (USER32.341)
40 BOOL IsDialogMessage32A(DWORD hwnd, MSG32* lpmsg)
42 MSG16 msg;
43 STRUCT32_MSG32to16(lpmsg, &msg);
44 return IsDialogMessage(hwnd, &msg);
47 /***********************************************************************
48 * IsDialogMessage32W (USER32.342)
50 BOOL IsDialogMessage32W(DWORD hwnd, MSG32* lpmsg)
52 MSG16 msg;
53 STRUCT32_MSG32to16(lpmsg, &msg);
54 return IsDialogMessage(hwnd, &msg);
57 /***********************************************************************
58 * DispatchMessageA (USER32.140)
60 LONG USER32_DispatchMessageA(MSG32* lpmsg)
62 MSG16 msg;
63 LONG ret;
64 STRUCT32_MSG32to16(lpmsg,&msg);
65 ret=DispatchMessage(&msg);
66 STRUCT32_MSG16to32(&msg,lpmsg);
67 return ret;
70 /***********************************************************************
71 * TranslateMessage (USER32.555)
73 BOOL USER32_TranslateMessage(MSG32* lpmsg)
75 MSG16 msg;
76 STRUCT32_MSG32to16(lpmsg,&msg);
77 return TranslateMessage(&msg);
80 /***********************************************************************
81 * PeekMessageA
83 BOOL32 PeekMessage32A( LPMSG32 lpmsg, HWND32 hwnd,
84 UINT32 min,UINT32 max,UINT32 wRemoveMsg)
86 MSG16 msg;
87 BOOL ret;
88 ret=PeekMessage16(&msg,hwnd,min,max,wRemoveMsg);
89 /* FIXME: should translate the message to Win32 */
90 STRUCT32_MSG16to32(&msg,lpmsg);
91 return ret;
94 /***********************************************************************
95 * PeekMessageW
97 BOOL32 PeekMessage32W( LPMSG32 lpmsg, HWND32 hwnd,
98 UINT32 min,UINT32 max,UINT32 wRemoveMsg)
100 /* FIXME: Should perform Unicode translation on specific messages */
101 return PeekMessage32A(lpmsg,hwnd,min,max,wRemoveMsg);