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
6 // Copyright: (c) 2002 Mattia Barbon
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_MISSING_H_
11 #define _WX_MISSING_H_
14 * The following are required for VC++ 6.
17 // Needed by cursor.cpp
19 #define IDC_HAND MAKEINTRESOURCE(32649)
22 // Needed by strconv.cpp
23 #ifndef WC_NO_BEST_FIT_CHARS
24 #define WC_NO_BEST_FIT_CHARS 0x400
27 #ifndef WM_CONTEXTMENU
28 #define WM_CONTEXTMENU 0x007B
31 #ifndef WM_CHANGEUISTATE
32 #define WM_CHANGEUISTATE 0x0127
35 #ifndef WM_UPDATEUISTATE
36 #define WM_UPDATEUISTATE 0x0128
39 #ifndef WM_QUERYUISTATE
40 #define WM_QUERYUISTATE 0x0129
43 #ifndef WM_PRINTCLIENT
44 #define WM_PRINTCLIENT 0x318
48 #define DT_HIDEPREFIX 0x00100000
51 // Needed by toplevel.cpp
55 #define UIS_INITIALIZE 3
58 #ifndef UISF_HIDEFOCUS
59 #define UISF_HIDEFOCUS 1
62 #ifndef UISF_HIDEACCEL
63 #define UISF_HIDEACCEL 2
67 #define OFN_EXPLORER 0x00080000
70 #ifndef OFN_ENABLESIZING
71 #define OFN_ENABLESIZING 0x00800000
74 // Needed by window.cpp
77 #define WM_MOUSEWHEEL 0x020A
79 #ifndef WM_MOUSEHWHEEL
80 #define WM_MOUSEHWHEEL 0x020E
83 #define WHEEL_DELTA 120
85 #ifndef SPI_GETWHEELSCROLLLINES
86 #define SPI_GETWHEELSCROLLLINES 104
88 #ifndef SPI_GETWHEELSCROLLCHARS
89 #define SPI_GETWHEELSCROLLCHARS 108
91 #endif // wxUSE_MOUSEWHEEL
93 // Needed by window.cpp
100 #define VK_OEM_6 0xDD
101 #define VK_OEM_7 0xDE
102 #define VK_OEM_102 0xE2
106 #define VK_OEM_PLUS 0xBB
107 #define VK_OEM_COMMA 0xBC
108 #define VK_OEM_MINUS 0xBD
109 #define VK_OEM_PERIOD 0xBE
113 #define SM_TABLETPC 86
116 #ifndef INKEDIT_CLASS
117 # define INKEDIT_CLASSW L"INKEDIT"
119 # define INKEDIT_CLASS INKEDIT_CLASSW
121 # define INKEDIT_CLASS "INKEDIT"
125 #ifndef EM_SETINKINSERTMODE
126 # define EM_SETINKINSERTMODE (WM_USER + 0x0204)
129 #ifndef EM_SETUSEMOUSEFORINPUT
130 #define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224)
134 #define TPM_RECURSE 1
138 #ifndef WS_EX_LAYOUTRTL
139 #define WS_EX_LAYOUTRTL 0x00400000
142 #ifndef WS_EX_COMPOSITED
143 #define WS_EX_COMPOSITED 0x02000000L
146 #ifndef WS_EX_LAYERED
147 #define WS_EX_LAYERED 0x00080000
154 #ifndef QS_ALLPOSTMESSAGE
155 #define QS_ALLPOSTMESSAGE 0
159 * The following are required for VC++ 5 when the PSDK is not available.
162 #if defined __VISUALC__ && __VISUALC__ <= 1100
164 #ifndef VER_NT_WORKSTATION
166 typedef struct _OSVERSIONINFOEXA
{
167 DWORD dwOSVersionInfoSize
;
168 DWORD dwMajorVersion
;
169 DWORD dwMinorVersion
;
172 CHAR szCSDVersion
[128];
173 WORD wServicePackMajor
;
174 WORD wServicePackMinor
;
178 } OSVERSIONINFOEXA
, *POSVERSIONINFOEXA
, *LPOSVERSIONINFOEXA
;
179 typedef struct _OSVERSIONINFOEXW
{
180 DWORD dwOSVersionInfoSize
;
181 DWORD dwMajorVersion
;
182 DWORD dwMinorVersion
;
185 WCHAR szCSDVersion
[128];
186 WORD wServicePackMajor
;
187 WORD wServicePackMinor
;
191 } OSVERSIONINFOEXW
, *POSVERSIONINFOEXW
, *LPOSVERSIONINFOEXW
;
194 typedef OSVERSIONINFOW OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
195 typedef OSVERSIONINFOEXW OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
197 typedef OSVERSIONINFOA OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
198 typedef OSVERSIONINFOEXA OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
201 #endif // defined VER_NT_WORKSTATION
207 // NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added
208 // with IE4, as was IPN_FIRST which is used as a test :-(.
212 typedef struct wxtagNMLVCUSTOMDRAW_
{
217 } wxNMLVCUSTOMDRAW_
, *wxLPNMLVCUSTOMDRAW_
;
219 #define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_
220 #define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_
222 #endif // defined IPN_FIRST
224 #endif // defined __VISUALC__ && __VISUALC__ <= 1100
226 // ----------------------------------------------------------------------------
228 // ----------------------------------------------------------------------------
231 #define MIIM_STRING 0x00000040
232 #define MIIM_BITMAP 0x00000080
233 #define MIIM_FTYPE 0x00000100
234 #define HBMMENU_CALLBACK ((HBITMAP) -1)
236 typedef struct tagMENUINFO
243 DWORD dwContextHelpID
;
245 } MENUINFO
, FAR
*LPMENUINFO
;
246 #endif // MIIM_BITMAP &c
248 // ----------------------------------------------------------------------------
249 // definitions related to ListView and Header common controls, needed by
250 // msw/listctrl.cpp and msw/headerctrl.cpp
251 // ----------------------------------------------------------------------------
254 #define I_IMAGENONE (-2)
257 #ifndef LVS_EX_FULLROWSELECT
258 #define LVS_EX_FULLROWSELECT 0x00000020
261 // LVS_EX_LABELTIP is not supported by Windows CE, don't define it there
262 #if !defined(LVS_EX_LABELTIP) && !defined(__WXWINCE__)
263 #define LVS_EX_LABELTIP 0x00004000
266 #ifndef LVS_EX_SUBITEMIMAGES
267 #define LVS_EX_SUBITEMIMAGES 0x00000002
270 #ifndef HDN_GETDISPINFOW
271 #define HDN_GETDISPINFOW (HDN_FIRST-29)
275 #define HDS_HOTTRACK 4
278 #define HDS_FLAT 0x0200
282 #define HDF_SORTUP 0x0400
283 #define HDF_SORTDOWN 0x0200
287 * In addition to the above, the following are required for several compilers.
290 #if !defined(CCS_VERT)
291 #define CCS_VERT 0x00000080L
294 #if !defined(CCS_RIGHT)
295 #define CCS_RIGHT (CCS_VERT|CCS_BOTTOM)
298 #if !defined(TB_SETDISABLEDIMAGELIST)
299 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
300 #endif // !defined(TB_SETDISABLEDIMAGELIST)
302 #ifndef CFM_BACKCOLOR
303 #define CFM_BACKCOLOR 0x04000000
306 #ifndef HANGUL_CHARSET
307 #define HANGUL_CHARSET 129
310 #ifndef CCM_SETUNICODEFORMAT
311 #define CCM_SETUNICODEFORMAT 8197
314 // ----------------------------------------------------------------------------
316 // ----------------------------------------------------------------------------
319 #define TV_FIRST 0x1100
322 #ifndef TVS_FULLROWSELECT
323 #define TVS_FULLROWSELECT 0x1000
326 #ifndef TVM_SETBKCOLOR
327 #define TVM_SETBKCOLOR (TV_FIRST + 29)
328 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
332 * The following are required for BC++ 5.5 (none at present.)
336 * The following are specifically required for Digital Mars C++
341 #ifndef VER_NT_WORKSTATION
342 typedef struct _OSVERSIONINFOEX
{
343 DWORD dwOSVersionInfoSize
;
344 DWORD dwMajorVersion
;
345 DWORD dwMinorVersion
;
348 TCHAR szCSDVersion
[ 128 ];
349 WORD wServicePackMajor
;
350 WORD wServicePackMinor
;
355 #endif // !defined(VER_NT_WORKSTATION)
357 #ifndef _TrackMouseEvent
358 #define _TrackMouseEvent TrackMouseEvent
361 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
362 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
365 #ifndef LVM_GETSUBITEMRECT
366 #define LVM_GETSUBITEMRECT (0x1000 + 56)
370 #define LVCF_IMAGE 0x0010
373 #ifndef Header_GetItemRect
374 #define Header_GetItemRect(w,i,r) \
375 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
378 #ifndef HDM_GETITEMRECT
379 #define HDM_GETITEMRECT (HDM_FIRST+7)
382 #ifndef ListView_GetHeader
383 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
386 #ifndef ListView_GetSubItemRect
387 #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))
390 #ifndef LVM_GETHEADER
391 #define LVM_GETHEADER (LVM_FIRST+31)
395 #define HDLAYOUT HD_LAYOUT
399 #define HDITEM HD_ITEM
403 #define NMHEADER HD_NOTIFY
407 #define HDS_DRAGDROP 0x0040
410 #define HDS_FULLDRAG 0x0080
414 #ifndef HDN_BEGINDRAG
415 #define HDN_BEGINDRAG (HDN_FIRST - 11)
419 #define HDN_ENDDRAG (HDN_FIRST - 10)
422 #ifndef LVSICF_NOSCROLL
423 #define LVSICF_NOINVALIDATEALL 0x0001
424 #define LVSICF_NOSCROLL 0x0002
431 // ----------------------------------------------------------------------------
433 // ----------------------------------------------------------------------------
435 // The windows headers with Digital Mars lack some typedefs.
436 // typedef them as my_XXX and then #define to rename to XXX in case
437 // a newer version of Digital Mars fixes the headers
438 // (or up to date PSDK is in use with older version)
439 // also we use any required definition (MONITOR_DEFAULTTONULL) to recognize
440 // whether whole missing block needs to be included
442 #ifndef MONITOR_DEFAULTTONULL
444 #define HMONITOR_DECLARED
445 DECLARE_HANDLE(HMONITOR
);
446 typedef BOOL(CALLBACK
* my_MONITORENUMPROC
)(HMONITOR
,HDC
,LPRECT
,LPARAM
);
447 #define MONITORENUMPROC my_MONITORENUMPROC
448 typedef struct my_tagMONITORINFO
{
453 } my_MONITORINFO
,*my_LPMONITORINFO
;
454 #define MONITORINFO my_MONITORINFO
455 #define LPMONITORINFO my_LPMONITORINFO
457 typedef struct my_MONITORINFOEX
: public my_tagMONITORINFO
459 TCHAR szDevice
[CCHDEVICENAME
];
460 } my_MONITORINFOEX
, *my_LPMONITORINFOEX
;
461 #define MONITORINFOEX my_MONITORINFOEX
462 #define LPMONITORINFOEX my_LPMONITORINFOEX
464 #ifndef MONITOR_DEFAULTTONULL
465 #define MONITOR_DEFAULTTONULL 0
466 #endif // MONITOR_DEFAULTTONULL
468 #ifndef MONITORINFOF_PRIMARY
469 #define MONITORINFOF_PRIMARY 1
470 #endif // MONITORINFOF_PRIMARY
472 #ifndef DDENUM_ATTACHEDSECONDARYDEVICES
473 #define DDENUM_ATTACHEDSECONDARYDEVICES 1
476 #endif // MONITOR_DEFAULTTONULL
478 // ----------------------------------------------------------------------------
480 // ----------------------------------------------------------------------------
483 #define TVIS_FOCUSED 0x0001
486 #ifndef TVS_CHECKBOXES
487 #define TVS_CHECKBOXES 0x0100
491 #define TVITEM TV_ITEM
498 * The following are specifically required for OpenWatcom C++ (none at present)
501 #if defined(__WATCOMC__)
505 * The following are specifically required for MinGW (none at present)
508 #if defined (__MINGW32__)
510 #if !wxCHECK_W32API_VERSION(3,1)
513 #include "wx/msw/winundef.h"
519 } NCCALCSIZE_PARAMS
, *LPNCCALCSIZE_PARAMS
;
525 //Various defines that will be needed by mingw and possibly VC++6
526 //Used by the webview library
528 #ifndef DISPID_COMMANDSTATECHANGE
529 #define DISPID_COMMANDSTATECHANGE 105
532 #ifndef DISPID_NAVIGATECOMPLETE2
533 #define DISPID_NAVIGATECOMPLETE2 252
536 #ifndef DISPID_NAVIGATEERROR
537 #define DISPID_NAVIGATEERROR 271
540 #ifndef DISPID_NEWWINDOW3
541 #define DISPID_NEWWINDOW3 273
544 #ifndef INET_E_ERROR_FIRST
545 #define INET_E_ERROR_FIRST 0x800C0002L
548 #ifndef INET_E_INVALID_URL
549 #define INET_E_INVALID_URL 0x800C0002L
552 #ifndef INET_E_NO_SESSION
553 #define INET_E_NO_SESSION 0x800C0003L
556 #ifndef INET_E_CANNOT_CONNECT
557 #define INET_E_CANNOT_CONNECT 0x800C0004L
560 #ifndef INET_E_RESOURCE_NOT_FOUND
561 #define INET_E_RESOURCE_NOT_FOUND 0x800C0005L
564 #ifndef INET_E_OBJECT_NOT_FOUND
565 #define INET_E_OBJECT_NOT_FOUND 0x800C0006L
568 #ifndef INET_E_DATA_NOT_AVAILABLE
569 #define INET_E_DATA_NOT_AVAILABLE 0x800C0007L
572 #ifndef INET_E_DOWNLOAD_FAILURE
573 #define INET_E_DOWNLOAD_FAILURE 0x800C0008L
576 #ifndef INET_E_AUTHENTICATION_REQUIRED
577 #define INET_E_AUTHENTICATION_REQUIRED 0x800C0009L
580 #ifndef INET_E_NO_VALID_MEDIA
581 #define INET_E_NO_VALID_MEDIA 0x800C000AL
584 #ifndef INET_E_CONNECTION_TIMEOUT
585 #define INET_E_CONNECTION_TIMEOUT 0x800C000BL
588 #ifndef INET_E_INVALID_REQUEST
589 #define INET_E_INVALID_REQUEST 0x800C000CL
592 #ifndef INET_E_UNKNOWN_PROTOCOL
593 #define INET_E_UNKNOWN_PROTOCOL 0x800C000DL
596 #ifndef INET_E_SECURITY_PROBLEM
597 #define INET_E_SECURITY_PROBLEM 0x800C000EL
600 #ifndef INET_E_CANNOT_LOAD_DATA
601 #define INET_E_CANNOT_LOAD_DATA 0x800C000FL
604 #ifndef INET_E_CANNOT_INSTANTIATE_OBJECT
605 #define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L
608 #ifndef INET_E_QUERYOPTION_UNKNOWN
609 #define INET_E_QUERYOPTION_UNKNOWN 0x800C0013L
612 #ifndef INET_E_REDIRECT_FAILED
613 #define INET_E_REDIRECT_FAILED 0x800C0014L
616 #ifndef INET_E_REDIRECT_TO_DIR
617 #define INET_E_REDIRECT_TO_DIR 0x800C0015L
620 #ifndef INET_E_CANNOT_LOCK_REQUEST
621 #define INET_E_CANNOT_LOCK_REQUEST 0x800C0016L
624 #ifndef INET_E_USE_EXTEND_BINDING
625 #define INET_E_USE_EXTEND_BINDING 0x800C0017L
628 #ifndef INET_E_TERMINATED_BIND
629 #define INET_E_TERMINATED_BIND 0x800C0018L
632 #ifndef INET_E_INVALID_CERTIFICATE
633 #define INET_E_INVALID_CERTIFICATE 0x800C0019L
636 #ifndef INET_E_CODE_DOWNLOAD_DECLINED
637 #define INET_E_CODE_DOWNLOAD_DECLINED 0x800C0100L
640 #ifndef INET_E_RESULT_DISPATCHED
641 #define INET_E_RESULT_DISPATCHED 0x800C0200L
644 #ifndef INET_E_CANNOT_REPLACE_SFP_FILE
645 #define INET_E_CANNOT_REPLACE_SFP_FILE 0x800C0300L
648 #ifndef INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY
649 #define INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY 0x800C0500L
652 #ifndef INET_E_CODE_INSTALL_SUPPRESSED
653 #define INET_E_CODE_INSTALL_SUPPRESSED 0x800C0400L
656 #ifndef MUI_LANGUAGE_NAME
657 #define MUI_LANGUAGE_NAME 0x8
660 //We need to check if we are using MinGW or mingw-w64 as their
661 //definitions are different
667 #ifdef __MINGW32_TOOLCHAIN__
668 typedef enum CommandStateChangeConstants
{
669 CSC_UPDATECOMMANDS
= (int) 0xFFFFFFFF,
670 CSC_NAVIGATEFORWARD
= 0x1,
671 CSC_NAVIGATEBACK
= 0x2
672 } CommandStateChangeConstants
;
676 * In addition to the declarations for VC++, the following are required for WinCE
680 #include "wx/msw/wince/missing.h"
684 * The following are specifically required for Wine
688 #ifndef ENUM_CURRENT_SETTINGS
689 #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
691 #ifndef BROADCAST_QUERY_DENY
692 #define BROADCAST_QUERY_DENY 1112363332
694 #endif // defined __WINE__
696 #ifndef INVALID_FILE_ATTRIBUTES
697 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)