OSDN Git Service

825172cf075b98e8bc22394f659b3762c48b4c19
[mingw/mingw-org-wsl.git] / include / winable.h
1 /**
2  * @file winable.h
3  * @copy 2012 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _WINABLE_H
25 #define _WINABLE_H
26 #pragma GCC system_header
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #if (_WIN32_WINNT < 0x0403)
33 #define INPUT_MOUSE 0x00000000
34 #define INPUT_KEYBOARD 0x00000001
35 #define INPUT_HARDWARE 0x00000002
36 #endif /* (_WIN32_WINNT < 0x04030) */
37 #if (WINVER < 0x0500)
38 #define CHILDID_SELF 0
39 #define OBJID_WINDOW 0x00000000
40 #define OBJID_SYSMENU 0xFFFFFFFF
41 #define OBJID_TITLEBAR 0xFFFFFFFE
42 #define OBJID_MENU 0xFFFFFFFD
43 #define OBJID_CLIENT 0xFFFFFFFC
44 #define OBJID_VSCROLL 0xFFFFFFFB
45 #define OBJID_HSCROLL 0xFFFFFFFA
46 #define OBJID_SIZEGRIP 0xFFFFFFF9
47 #define OBJID_CARET 0xFFFFFFF8
48 #define OBJID_CURSOR 0xFFFFFFF7
49 #define OBJID_ALERT 0xFFFFFFF6
50 #define OBJID_SOUND 0xFFFFFFF5
51 #define GUI_CARETBLINKING 0x00000001
52 #define GUI_INMOVESIZE 0x00000002
53 #define GUI_INMENUMODE 0x00000004
54 #define GUI_SYSTEMMENUMODE 0x00000008
55 #define GUI_POPUPMENUMODE 0x00000010
56 #define WINEVENT_OUTOFCONTEXT 0x0000
57 #define WINEVENT_SKIPOWNTHREAD 0x0001
58 #define WINEVENT_SKIPOWNPROCESS 0x0002
59 #define WINEVENT_INCONTEXT 0x0004
60 #endif /* (WINVER < 0x0500) */
61 #if (_WIN32_WINNT < 0x0403)
62 typedef struct tagMOUSEINPUT {
63         LONG dx;
64         LONG dy;
65         DWORD mouseData;
66         DWORD dwFlags;
67         DWORD time;
68         ULONG_PTR dwExtraInfo;
69 } MOUSEINPUT,*PMOUSEINPUT;
70 typedef struct tagKEYBDINPUT {
71         WORD wVk;
72         WORD wScan;
73         DWORD dwFlags;
74         DWORD time;
75         ULONG_PTR dwExtraInfo;
76 } KEYBDINPUT,*PKEYBDINPUT;
77 typedef struct tagHARDWAREINPUT {
78         DWORD uMsg;
79         WORD wParamL;
80         WORD wParamH;
81 } HARDWAREINPUT,*PHARDWAREINPUT;
82 typedef struct tagINPUT {
83         DWORD type;
84         _ANONYMOUS_UNION union {
85                 MOUSEINPUT mi;
86                 KEYBDINPUT ki;
87                 HARDWAREINPUT hi;
88         } DUMMYUNIONNAME;
89 } INPUT,*PINPUT,*LPINPUT;
90 #endif /* (_WIN32_WINNT < 0x0403) */
91 #if (WINVER < 0x0500)
92 typedef VOID (*WINEVENTPROC)(HWINEVENTHOOK,DWORD,HWND,LONG,LONG,DWORD,DWORD);
93 typedef struct tagGUITHREADINFO {
94         DWORD cbSize;
95         DWORD flags;
96         HWND hwndActive;
97         HWND hwndFocus;
98         HWND hwndCapture;
99         HWND hwndMenuOwner;
100         HWND hwndMoveSize;
101         HWND hwndCaret;
102         RECT rcCaret;
103 } GUITHREADINFO,*PGUITHREADINFO,*LPGUITHREADINFO;
104 #endif /* (WINVER < 0x0500) */
105
106 BOOL WINAPI BlockInput(BOOL);
107 #if (_WIN32_WINNT < 0x0403)
108 UINT WINAPI SendInput(UINT,LPINPUT,int);
109 #endif
110 #if (WINVER < 0x0500)
111 BOOL WINAPI GetGUIThreadInfo(DWORD,LPGUITHREADINFO);
112 void WINAPI NotifyWinEvent(DWORD,HWND,LONG,LONG);
113 HWINEVENTHOOK WINAPI SetWinEventHook(UINT,UINT,HMODULE,WINEVENTPROC,DWORD,DWORD,UINT);
114 BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK);
115 #endif /* (WINVER < 0x0500) */
116
117 #ifdef __cplusplus
118 }
119 #endif
120 #endif