1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/missing.h
3 // Purpose: Declarations for parts of the Win32 SDK that are missing in
4 // the versions that come with some compilers
7 // Copyright: (c) 2002 Mattia Barbon
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MISSING_H_
12 #define _WX_MISSING_H_
15 * The following are required for VC++ 6.
18 // Needed by cursor.cpp
20 #define IDC_HAND MAKEINTRESOURCE(32649)
23 // Needed by strconv.cpp
24 #ifndef WC_NO_BEST_FIT_CHARS
25 #define WC_NO_BEST_FIT_CHARS 0x400
28 #ifndef WM_CONTEXTMENU
29 #define WM_CONTEXTMENU 0x007B
32 #ifndef WM_CHANGEUISTATE
33 #define WM_CHANGEUISTATE 0x0127
36 #ifndef WM_UPDATEUISTATE
37 #define WM_UPDATEUISTATE 0x0128
40 #ifndef WM_QUERYUISTATE
41 #define WM_QUERYUISTATE 0x0129
44 #ifndef WM_PRINTCLIENT
45 #define WM_PRINTCLIENT 0x318
49 #define DT_HIDEPREFIX 0x00100000
52 // Needed by toplevel.cpp
56 #define UIS_INITIALIZE 3
59 #ifndef UISF_HIDEFOCUS
60 #define UISF_HIDEFOCUS 1
63 #ifndef UISF_HIDEACCEL
64 #define UISF_HIDEACCEL 2
68 #define OFN_EXPLORER 0x00080000
71 #ifndef OFN_ENABLESIZING
72 #define OFN_ENABLESIZING 0x00800000
75 // Needed by window.cpp
78 #define WM_MOUSEWHEEL 0x020A
81 #define WHEEL_DELTA 120
83 #ifndef SPI_GETWHEELSCROLLLINES
84 #define SPI_GETWHEELSCROLLLINES 104
86 #endif // wxUSE_MOUSEWHEEL
88 // Needed by window.cpp
97 #define VK_OEM_102 0xE2
101 #define VK_OEM_PLUS 0xBB
102 #define VK_OEM_COMMA 0xBC
103 #define VK_OEM_MINUS 0xBD
104 #define VK_OEM_PERIOD 0xBE
108 #define SM_TABLETPC 86
111 #ifndef INKEDIT_CLASS
112 # define INKEDIT_CLASSW L"INKEDIT"
114 # define INKEDIT_CLASS INKEDIT_CLASSW
116 # define INKEDIT_CLASS "INKEDIT"
120 #ifndef EM_SETINKINSERTMODE
121 # define EM_SETINKINSERTMODE (WM_USER + 0x0204)
124 #ifndef EM_SETUSEMOUSEFORINPUT
125 #define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224)
129 #define TPM_RECURSE 1
133 #ifndef WS_EX_LAYOUTRTL
134 #define WS_EX_LAYOUTRTL 0x00400000
137 #ifndef WS_EX_COMPOSITED
138 #define WS_EX_COMPOSITED 0x02000000L
141 #ifndef WS_EX_LAYERED
142 #define WS_EX_LAYERED 0x00080000
149 #ifndef QS_ALLPOSTMESSAGE
150 #define QS_ALLPOSTMESSAGE 0
154 * The following are required for VC++ 5 when the PSDK is not available.
157 #if defined __VISUALC__ && __VISUALC__ <= 1100
159 #ifndef VER_NT_WORKSTATION
161 typedef struct _OSVERSIONINFOEXA
{
162 DWORD dwOSVersionInfoSize
;
163 DWORD dwMajorVersion
;
164 DWORD dwMinorVersion
;
167 CHAR szCSDVersion
[128];
168 WORD wServicePackMajor
;
169 WORD wServicePackMinor
;
173 } OSVERSIONINFOEXA
, *POSVERSIONINFOEXA
, *LPOSVERSIONINFOEXA
;
174 typedef struct _OSVERSIONINFOEXW
{
175 DWORD dwOSVersionInfoSize
;
176 DWORD dwMajorVersion
;
177 DWORD dwMinorVersion
;
180 WCHAR szCSDVersion
[128];
181 WORD wServicePackMajor
;
182 WORD wServicePackMinor
;
186 } OSVERSIONINFOEXW
, *POSVERSIONINFOEXW
, *LPOSVERSIONINFOEXW
;
189 typedef OSVERSIONINFOW OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
190 typedef OSVERSIONINFOEXW OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
192 typedef OSVERSIONINFOA OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
193 typedef OSVERSIONINFOEXA OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
196 #endif // defined VER_NT_WORKSTATION
202 // NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added
203 // with IE4, as was IPN_FIRST which is used as a test :-(.
207 typedef struct wxtagNMLVCUSTOMDRAW_
{
212 } wxNMLVCUSTOMDRAW_
, *wxLPNMLVCUSTOMDRAW_
;
214 #define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_
215 #define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_
217 #endif // defined IPN_FIRST
219 #endif // defined __VISUALC__ && __VISUALC__ <= 1100
221 // ----------------------------------------------------------------------------
223 // ----------------------------------------------------------------------------
226 #define MIIM_STRING 0x00000040
227 #define MIIM_BITMAP 0x00000080
228 #define MIIM_FTYPE 0x00000100
229 #define HBMMENU_CALLBACK ((HBITMAP) -1)
231 typedef struct tagMENUINFO
238 DWORD dwContextHelpID
;
240 } MENUINFO
, FAR
*LPMENUINFO
;
241 #endif // MIIM_BITMAP &c
243 // ----------------------------------------------------------------------------
244 // definitions related to ListView and Header common controls, needed by
245 // msw/listctrl.cpp and msw/headerctrl.cpp
246 // ----------------------------------------------------------------------------
249 #define I_IMAGENONE (-2)
252 #ifndef LVS_EX_FULLROWSELECT
253 #define LVS_EX_FULLROWSELECT 0x00000020
256 // LVS_EX_LABELTIP is not supported by Windows CE, don't define it there
257 #if !defined(LVS_EX_LABELTIP) && !defined(__WXWINCE__)
258 #define LVS_EX_LABELTIP 0x00004000
261 #ifndef LVS_EX_SUBITEMIMAGES
262 #define LVS_EX_SUBITEMIMAGES 0x00000002
265 #ifndef HDN_GETDISPINFOW
266 #define HDN_GETDISPINFOW (HDN_FIRST-29)
270 #define HDS_HOTTRACK 4
273 #define HDS_FLAT 0x0200
277 #define HDF_SORTUP 0x0400
278 #define HDF_SORTDOWN 0x0200
282 * In addition to the above, the following are required for several compilers.
285 #if !defined(CCS_VERT)
286 #define CCS_VERT 0x00000080L
289 #if !defined(CCS_RIGHT)
290 #define CCS_RIGHT (CCS_VERT|CCS_BOTTOM)
293 #if !defined(TB_SETDISABLEDIMAGELIST)
294 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
295 #endif // !defined(TB_SETDISABLEDIMAGELIST)
297 #ifndef CFM_BACKCOLOR
298 #define CFM_BACKCOLOR 0x04000000
301 #ifndef HANGUL_CHARSET
302 #define HANGUL_CHARSET 129
305 #ifndef CCM_SETUNICODEFORMAT
306 #define CCM_SETUNICODEFORMAT 8197
309 // ----------------------------------------------------------------------------
311 // ----------------------------------------------------------------------------
314 #define TV_FIRST 0x1100
317 #ifndef TVS_FULLROWSELECT
318 #define TVS_FULLROWSELECT 0x1000
321 #ifndef TVM_SETBKCOLOR
322 #define TVM_SETBKCOLOR (TV_FIRST + 29)
323 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
327 * The following are required for BC++ 5.5 (none at present.)
331 * The following are specifically required for Digital Mars C++
336 #ifndef VER_NT_WORKSTATION
337 typedef struct _OSVERSIONINFOEX
{
338 DWORD dwOSVersionInfoSize
;
339 DWORD dwMajorVersion
;
340 DWORD dwMinorVersion
;
343 TCHAR szCSDVersion
[ 128 ];
344 WORD wServicePackMajor
;
345 WORD wServicePackMinor
;
350 #endif // !defined(VER_NT_WORKSTATION)
352 #ifndef _TrackMouseEvent
353 #define _TrackMouseEvent TrackMouseEvent
356 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
357 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
360 #ifndef LVM_GETSUBITEMRECT
361 #define LVM_GETSUBITEMRECT (0x1000 + 56)
365 #define LVCF_IMAGE 0x0010
368 #ifndef Header_GetItemRect
369 #define Header_GetItemRect(w,i,r) \
370 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
373 #ifndef HDM_GETITEMRECT
374 #define HDM_GETITEMRECT (HDM_FIRST+7)
377 #ifndef ListView_GetHeader
378 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
381 #ifndef ListView_GetSubItemRect
382 #define ListView_GetSubItemRect(w, i, s, c, p) (HWND)SendMessage(w,LVM_GETSUBITEMRECT,i, ((p) ? ((((LPRECT)(p))->top = s), (((LPRECT)(p))->left = c), (LPARAM)(p)) : (LPARAM)(LPRECT)NULL))
385 #ifndef LVM_GETHEADER
386 #define LVM_GETHEADER (LVM_FIRST+31)
390 #define HDLAYOUT HD_LAYOUT
394 #define HDITEM HD_ITEM
398 #define NMHEADER HD_NOTIFY
402 #define HDS_DRAGDROP 0x0040
405 #define HDS_FULLDRAG 0x0080
409 #ifndef HDN_BEGINDRAG
410 #define HDN_BEGINDRAG (HDN_FIRST - 11)
414 #define HDN_ENDDRAG (HDN_FIRST - 10)
417 #ifndef LVSICF_NOSCROLL
418 #define LVSICF_NOINVALIDATEALL 0x0001
419 #define LVSICF_NOSCROLL 0x0002
426 // ----------------------------------------------------------------------------
428 // ----------------------------------------------------------------------------
430 // The windows headers with Digital Mars lack some typedefs.
431 // typedef them as my_XXX and then #define to rename to XXX in case
432 // a newer version of Digital Mars fixes the headers
433 // (or up to date PSDK is in use with older version)
434 // also we use any required definition (MONITOR_DEFAULTTONULL) to recognize
435 // whether whole missing block needs to be included
437 #ifndef MONITOR_DEFAULTTONULL
439 #define HMONITOR_DECLARED
440 DECLARE_HANDLE(HMONITOR
);
441 typedef BOOL(CALLBACK
* my_MONITORENUMPROC
)(HMONITOR
,HDC
,LPRECT
,LPARAM
);
442 #define MONITORENUMPROC my_MONITORENUMPROC
443 typedef struct my_tagMONITORINFO
{
448 } my_MONITORINFO
,*my_LPMONITORINFO
;
449 #define MONITORINFO my_MONITORINFO
450 #define LPMONITORINFO my_LPMONITORINFO
452 typedef struct my_MONITORINFOEX
: public my_tagMONITORINFO
454 TCHAR szDevice
[CCHDEVICENAME
];
455 } my_MONITORINFOEX
, *my_LPMONITORINFOEX
;
456 #define MONITORINFOEX my_MONITORINFOEX
457 #define LPMONITORINFOEX my_LPMONITORINFOEX
459 #ifndef MONITOR_DEFAULTTONULL
460 #define MONITOR_DEFAULTTONULL 0
461 #endif // MONITOR_DEFAULTTONULL
463 #ifndef MONITORINFOF_PRIMARY
464 #define MONITORINFOF_PRIMARY 1
465 #endif // MONITORINFOF_PRIMARY
467 #ifndef DDENUM_ATTACHEDSECONDARYDEVICES
468 #define DDENUM_ATTACHEDSECONDARYDEVICES 1
471 #endif // MONITOR_DEFAULTTONULL
473 // ----------------------------------------------------------------------------
475 // ----------------------------------------------------------------------------
478 #define TVIS_FOCUSED 0x0001
481 #ifndef TVS_CHECKBOXES
482 #define TVS_CHECKBOXES 0x0100
486 #define TVITEM TV_ITEM
493 * The following are specifically required for OpenWatcom C++ (none at present)
496 #if defined(__WATCOMC__)
500 * The following are specifically required for MinGW (none at present)
503 #if defined (__MINGW32__)
505 #if !wxCHECK_W32API_VERSION(3,1)
508 #include "wx/msw/winundef.h"
514 } NCCALCSIZE_PARAMS
, *LPNCCALCSIZE_PARAMS
;
520 //Various defines that will be needed by mingw and possibly VC++6
521 //Used by the webview library
523 #ifndef DISPID_COMMANDSTATECHANGE
524 #define DISPID_COMMANDSTATECHANGE 105
527 #ifndef DISPID_NAVIGATECOMPLETE2
528 #define DISPID_NAVIGATECOMPLETE2 252
531 #ifndef DISPID_NAVIGATEERROR
532 #define DISPID_NAVIGATEERROR 271
535 #ifndef DISPID_NEWWINDOW3
536 #define DISPID_NEWWINDOW3 273
539 #ifndef INET_E_ERROR_FIRST
540 #define INET_E_ERROR_FIRST 0x800C0002L
543 #ifndef INET_E_INVALID_URL
544 #define INET_E_INVALID_URL 0x800C0002L
547 #ifndef INET_E_NO_SESSION
548 #define INET_E_NO_SESSION 0x800C0003L
551 #ifndef INET_E_CANNOT_CONNECT
552 #define INET_E_CANNOT_CONNECT 0x800C0004L
555 #ifndef INET_E_RESOURCE_NOT_FOUND
556 #define INET_E_RESOURCE_NOT_FOUND 0x800C0005L
559 #ifndef INET_E_OBJECT_NOT_FOUND
560 #define INET_E_OBJECT_NOT_FOUND 0x800C0006L
563 #ifndef INET_E_DATA_NOT_AVAILABLE
564 #define INET_E_DATA_NOT_AVAILABLE 0x800C0007L
567 #ifndef INET_E_DOWNLOAD_FAILURE
568 #define INET_E_DOWNLOAD_FAILURE 0x800C0008L
571 #ifndef INET_E_AUTHENTICATION_REQUIRED
572 #define INET_E_AUTHENTICATION_REQUIRED 0x800C0009L
575 #ifndef INET_E_NO_VALID_MEDIA
576 #define INET_E_NO_VALID_MEDIA 0x800C000AL
579 #ifndef INET_E_CONNECTION_TIMEOUT
580 #define INET_E_CONNECTION_TIMEOUT 0x800C000BL
583 #ifndef INET_E_INVALID_REQUEST
584 #define INET_E_INVALID_REQUEST 0x800C000CL
587 #ifndef INET_E_UNKNOWN_PROTOCOL
588 #define INET_E_UNKNOWN_PROTOCOL 0x800C000DL
591 #ifndef INET_E_SECURITY_PROBLEM
592 #define INET_E_SECURITY_PROBLEM 0x800C000EL
595 #ifndef INET_E_CANNOT_LOAD_DATA
596 #define INET_E_CANNOT_LOAD_DATA 0x800C000FL
599 #ifndef INET_E_CANNOT_INSTANTIATE_OBJECT
600 #define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L
603 #ifndef INET_E_QUERYOPTION_UNKNOWN
604 #define INET_E_QUERYOPTION_UNKNOWN 0x800C0013L
607 #ifndef INET_E_REDIRECT_FAILED
608 #define INET_E_REDIRECT_FAILED 0x800C0014L
611 #ifndef INET_E_REDIRECT_TO_DIR
612 #define INET_E_REDIRECT_TO_DIR 0x800C0015L
615 #ifndef INET_E_CANNOT_LOCK_REQUEST
616 #define INET_E_CANNOT_LOCK_REQUEST 0x800C0016L
619 #ifndef INET_E_USE_EXTEND_BINDING
620 #define INET_E_USE_EXTEND_BINDING 0x800C0017L
623 #ifndef INET_E_TERMINATED_BIND
624 #define INET_E_TERMINATED_BIND 0x800C0018L
627 #ifndef INET_E_INVALID_CERTIFICATE
628 #define INET_E_INVALID_CERTIFICATE 0x800C0019L
631 #ifndef INET_E_CODE_DOWNLOAD_DECLINED
632 #define INET_E_CODE_DOWNLOAD_DECLINED 0x800C0100L
635 #ifndef INET_E_RESULT_DISPATCHED
636 #define INET_E_RESULT_DISPATCHED 0x800C0200L
639 #ifndef INET_E_CANNOT_REPLACE_SFP_FILE
640 #define INET_E_CANNOT_REPLACE_SFP_FILE 0x800C0300L
643 #ifndef INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY
644 #define INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY 0x800C0500L
647 #ifndef INET_E_CODE_INSTALL_SUPPRESSED
648 #define INET_E_CODE_INSTALL_SUPPRESSED 0x800C0400L
651 //We need to check if we are using MinGW or mingw-w64 as their
652 //definitions are different
658 #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
659 typedef enum CommandStateChangeConstants
{
660 CSC_UPDATECOMMANDS
= (int) 0xFFFFFFFF,
661 CSC_NAVIGATEFORWARD
= 0x1,
662 CSC_NAVIGATEBACK
= 0x2
663 } CommandStateChangeConstants
;
667 * In addition to the declarations for VC++, the following are required for WinCE
671 #include "wx/msw/wince/missing.h"
675 * The following are specifically required for Wine
679 #ifndef ENUM_CURRENT_SETTINGS
680 #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
682 #ifndef BROADCAST_QUERY_DENY
683 #define BROADCAST_QUERY_DENY 1112363332
685 #endif // defined __WINE__
687 #ifndef INVALID_FILE_ATTRIBUTES
688 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)