Tell the user if winedefault.reg is not loaded.
[wine] / include / windef.h
1 /*
2  * Basic types definitions
3  *
4  * Copyright 1996 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_WINDEF_H
22 #define __WINE_WINDEF_H
23
24 #ifdef __WINE__
25 # undef UNICODE
26 #endif  /* __WINE__ */
27
28 #define WINVER 0x0500
29
30 #include "winnt.h"
31
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 /* Macros to map Winelib names to the correct implementation name */
39 /* depending on __WINE__ and UNICODE macros.                      */
40 /* Note that Winelib is purely Win32.                             */
41
42 #ifdef __WINE__
43 # define WINELIB_NAME_AW(func) \
44     func##_must_be_suffixed_with_W_or_A_in_this_context \
45     func##_must_be_suffixed_with_W_or_A_in_this_context
46 #else  /* __WINE__ */
47 # ifdef UNICODE
48 #  define WINELIB_NAME_AW(func) func##W
49 # else
50 #  define WINELIB_NAME_AW(func) func##A
51 # endif  /* UNICODE */
52 #endif  /* __WINE__ */
53
54 #ifdef __WINE__
55 # define DECL_WINELIB_TYPE_AW(type)  /* nothing */
56 #else   /* __WINE__ */
57 # define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
58 #endif  /* __WINE__ */
59
60
61 /* Integer types */
62 typedef UINT            WPARAM;
63 typedef LONG            LPARAM;
64 typedef LONG            LRESULT;
65 typedef WORD            ATOM;
66 typedef WORD            CATCHBUF[9];
67 typedef WORD           *LPCATCHBUF;
68 typedef DWORD           COLORREF, *LPCOLORREF;
69
70
71 /* Handle types that exist both in Win16 and Win32. */
72
73 typedef int HFILE;
74 DECLARE_OLD_HANDLE(HACCEL);
75 DECLARE_OLD_HANDLE(HBITMAP);
76 DECLARE_OLD_HANDLE(HBRUSH);
77 DECLARE_HANDLE(HCOLORSPACE);
78 DECLARE_OLD_HANDLE(HDC);
79 DECLARE_HANDLE(HDESK);
80 DECLARE_OLD_HANDLE(HENHMETAFILE);
81 DECLARE_OLD_HANDLE(HFONT);
82 DECLARE_OLD_HANDLE(HHOOK);
83 DECLARE_OLD_HANDLE(HICON);
84 DECLARE_OLD_HANDLE(HINSTANCE);
85 DECLARE_OLD_HANDLE(HKEY);
86 DECLARE_OLD_HANDLE(HKL);
87 DECLARE_OLD_HANDLE(HMENU);
88 DECLARE_OLD_HANDLE(HMETAFILE);
89 DECLARE_OLD_HANDLE(HMONITOR);
90 DECLARE_OLD_HANDLE(HPALETTE);
91 DECLARE_OLD_HANDLE(HPEN);
92 DECLARE_OLD_HANDLE(HRGN);
93 DECLARE_OLD_HANDLE(HRSRC);
94 DECLARE_OLD_HANDLE(HTASK);
95 DECLARE_HANDLE(HWINSTA);
96 DECLARE_OLD_HANDLE(HWND);
97
98 /* Handle types that must remain interchangeable even with strict on */
99
100 typedef HINSTANCE HMODULE;
101 typedef HANDLE HGDIOBJ;
102 typedef HANDLE HGLOBAL;
103 typedef HANDLE HLOCAL;
104 typedef HANDLE GLOBALHANDLE;
105 typedef HANDLE LOCALHANDLE;
106 typedef HICON HCURSOR;
107
108 /* Callback function pointers types */
109
110 typedef INT     (CALLBACK *FARPROC)();
111 typedef INT     (CALLBACK *PROC)();
112
113
114 /* Macros to split words and longs. */
115
116 #define LOBYTE(w)              ((BYTE)(WORD)(w))
117 #define HIBYTE(w)              ((BYTE)((WORD)(w) >> 8))
118
119 #define LOWORD(l)              ((WORD)(DWORD)(l))
120 #define HIWORD(l)              ((WORD)((DWORD)(l) >> 16))
121
122 #define SLOWORD(l)             ((SHORT)(LONG)(l))
123 #define SHIWORD(l)             ((SHORT)((LONG)(l) >> 16))
124
125 #define MAKEWORD(low,high)     ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
126 #define MAKELONG(low,high)     ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
127 #define MAKELPARAM(low,high)   ((LPARAM)MAKELONG(low,high))
128 #define MAKEWPARAM(low,high)   ((WPARAM)MAKELONG(low,high))
129 #define MAKELRESULT(low,high)  ((LRESULT)MAKELONG(low,high))
130
131 #define SELECTOROF(ptr)     (HIWORD(ptr))
132 #define OFFSETOF(ptr)       (LOWORD(ptr))
133
134 #ifdef __WINE__
135 /* macros to set parts of a DWORD (not in the Windows API) */
136 #define SET_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
137 #define SET_LOBYTE(dw,val)  ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
138 #define SET_HIBYTE(dw,val)  ((dw) = ((dw) & 0xffff00ff) | (LOBYTE(val) << 8))
139 #define ADD_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
140 #endif
141
142 /* min and max macros */
143 #ifndef NOMINMAX
144 #ifndef max
145 #define max(a,b)   (((a) > (b)) ? (a) : (b))
146 #endif
147 #ifndef min
148 #define min(a,b)   (((a) < (b)) ? (a) : (b))
149 #endif
150 #endif  /* NOMINMAX */
151
152 #define MAX_PATH        260
153 #define HFILE_ERROR     ((HFILE)-1)
154
155 /* The SIZE structure */
156 typedef struct tagSIZE
157 {
158     LONG cx;
159     LONG cy;
160 } SIZE, *PSIZE, *LPSIZE;
161
162 typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
163
164 /* The POINT structure */
165 typedef struct tagPOINT
166 {
167     LONG  x;
168     LONG  y;
169 } POINT, *PPOINT, *LPPOINT;
170
171 typedef struct _POINTL
172 {
173     LONG x;
174     LONG y;
175 } POINTL;
176
177 /* The POINTS structure */
178
179 typedef struct tagPOINTS
180 {
181     SHORT x;
182     SHORT y;
183 } POINTS, *PPOINTS, *LPPOINTS;
184
185 /* The RECT structure */
186 typedef struct tagRECT
187 {
188     INT  left;
189     INT  top;
190     INT  right;
191     INT  bottom;
192 } RECT, *PRECT, *LPRECT;
193 typedef const RECT *LPCRECT;
194
195
196 typedef struct tagRECTL
197 {
198     LONG left;
199     LONG top;
200     LONG right;
201     LONG bottom;
202 } RECTL, *PRECTL, *LPRECTL;
203
204 typedef const RECTL *LPCRECTL;
205
206 #ifdef __cplusplus
207 }
208 #endif
209
210 #endif /* __WINE_WINDEF_H */