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
80 #ifndef WM_MOUSEHWHEEL
81 #define WM_MOUSEHWHEEL 0x020E
84 #define WHEEL_DELTA 120
86 #ifndef SPI_GETWHEELSCROLLLINES
87 #define SPI_GETWHEELSCROLLLINES 104
89 #ifndef SPI_GETWHEELSCROLLCHARS
90 #define SPI_GETWHEELSCROLLCHARS 108
92 #endif // wxUSE_MOUSEWHEEL
94 // Needed by window.cpp
100 #define VK_OEM_5 0xDC
101 #define VK_OEM_6 0xDD
102 #define VK_OEM_7 0xDE
103 #define VK_OEM_102 0xE2
107 #define VK_OEM_PLUS 0xBB
108 #define VK_OEM_COMMA 0xBC
109 #define VK_OEM_MINUS 0xBD
110 #define VK_OEM_PERIOD 0xBE
114 #define SM_TABLETPC 86
117 #ifndef INKEDIT_CLASS
118 # define INKEDIT_CLASSW L"INKEDIT"
120 # define INKEDIT_CLASS INKEDIT_CLASSW
122 # define INKEDIT_CLASS "INKEDIT"
126 #ifndef EM_SETINKINSERTMODE
127 # define EM_SETINKINSERTMODE (WM_USER + 0x0204)
130 #ifndef EM_SETUSEMOUSEFORINPUT
131 #define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224)
135 #define TPM_RECURSE 1
139 #ifndef WS_EX_LAYOUTRTL
140 #define WS_EX_LAYOUTRTL 0x00400000
143 #ifndef WS_EX_COMPOSITED
144 #define WS_EX_COMPOSITED 0x02000000L
147 #ifndef WS_EX_LAYERED
148 #define WS_EX_LAYERED 0x00080000
155 #ifndef QS_ALLPOSTMESSAGE
156 #define QS_ALLPOSTMESSAGE 0
160 * The following are required for VC++ 5 when the PSDK is not available.
163 #if defined __VISUALC__ && __VISUALC__ <= 1100
165 #ifndef VER_NT_WORKSTATION
167 typedef struct _OSVERSIONINFOEXA
{
168 DWORD dwOSVersionInfoSize
;
169 DWORD dwMajorVersion
;
170 DWORD dwMinorVersion
;
173 CHAR szCSDVersion
[128];
174 WORD wServicePackMajor
;
175 WORD wServicePackMinor
;
179 } OSVERSIONINFOEXA
, *POSVERSIONINFOEXA
, *LPOSVERSIONINFOEXA
;
180 typedef struct _OSVERSIONINFOEXW
{
181 DWORD dwOSVersionInfoSize
;
182 DWORD dwMajorVersion
;
183 DWORD dwMinorVersion
;
186 WCHAR szCSDVersion
[128];
187 WORD wServicePackMajor
;
188 WORD wServicePackMinor
;
192 } OSVERSIONINFOEXW
, *POSVERSIONINFOEXW
, *LPOSVERSIONINFOEXW
;
195 typedef OSVERSIONINFOW OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
196 typedef OSVERSIONINFOEXW OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
198 typedef OSVERSIONINFOA OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
199 typedef OSVERSIONINFOEXA OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
202 #endif // defined VER_NT_WORKSTATION
208 // NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added
209 // with IE4, as was IPN_FIRST which is used as a test :-(.
213 typedef struct wxtagNMLVCUSTOMDRAW_
{
218 } wxNMLVCUSTOMDRAW_
, *wxLPNMLVCUSTOMDRAW_
;
220 #define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_
221 #define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_
223 #endif // defined IPN_FIRST
225 #endif // defined __VISUALC__ && __VISUALC__ <= 1100
227 // ----------------------------------------------------------------------------
229 // ----------------------------------------------------------------------------
232 #define MIIM_STRING 0x00000040
233 #define MIIM_BITMAP 0x00000080
234 #define MIIM_FTYPE 0x00000100
235 #define HBMMENU_CALLBACK ((HBITMAP) -1)
237 typedef struct tagMENUINFO
244 DWORD dwContextHelpID
;
246 } MENUINFO
, FAR
*LPMENUINFO
;
247 #endif // MIIM_BITMAP &c
249 // ----------------------------------------------------------------------------
250 // definitions related to ListView and Header common controls, needed by
251 // msw/listctrl.cpp and msw/headerctrl.cpp
252 // ----------------------------------------------------------------------------
255 #define I_IMAGENONE (-2)
258 #ifndef LVS_EX_FULLROWSELECT
259 #define LVS_EX_FULLROWSELECT 0x00000020
262 // LVS_EX_LABELTIP is not supported by Windows CE, don't define it there
263 #if !defined(LVS_EX_LABELTIP) && !defined(__WXWINCE__)
264 #define LVS_EX_LABELTIP 0x00004000
267 #ifndef LVS_EX_SUBITEMIMAGES
268 #define LVS_EX_SUBITEMIMAGES 0x00000002
271 #ifndef HDN_GETDISPINFOW
272 #define HDN_GETDISPINFOW (HDN_FIRST-29)
276 #define HDS_HOTTRACK 4
279 #define HDS_FLAT 0x0200
283 #define HDF_SORTUP 0x0400
284 #define HDF_SORTDOWN 0x0200
288 * In addition to the above, the following are required for several compilers.
291 #if !defined(CCS_VERT)
292 #define CCS_VERT 0x00000080L
295 #if !defined(CCS_RIGHT)
296 #define CCS_RIGHT (CCS_VERT|CCS_BOTTOM)
299 #if !defined(TB_SETDISABLEDIMAGELIST)
300 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
301 #endif // !defined(TB_SETDISABLEDIMAGELIST)
303 #ifndef CFM_BACKCOLOR
304 #define CFM_BACKCOLOR 0x04000000
307 #ifndef HANGUL_CHARSET
308 #define HANGUL_CHARSET 129
311 #ifndef CCM_SETUNICODEFORMAT
312 #define CCM_SETUNICODEFORMAT 8197
315 // ----------------------------------------------------------------------------
317 // ----------------------------------------------------------------------------
320 #define TV_FIRST 0x1100
323 #ifndef TVS_FULLROWSELECT
324 #define TVS_FULLROWSELECT 0x1000
327 #ifndef TVM_SETBKCOLOR
328 #define TVM_SETBKCOLOR (TV_FIRST + 29)
329 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
333 * The following are required for BC++ 5.5 (none at present.)
337 * The following are specifically required for Digital Mars C++
342 #ifndef VER_NT_WORKSTATION
343 typedef struct _OSVERSIONINFOEX
{
344 DWORD dwOSVersionInfoSize
;
345 DWORD dwMajorVersion
;
346 DWORD dwMinorVersion
;
349 TCHAR szCSDVersion
[ 128 ];
350 WORD wServicePackMajor
;
351 WORD wServicePackMinor
;
356 #endif // !defined(VER_NT_WORKSTATION)
358 #ifndef _TrackMouseEvent
359 #define _TrackMouseEvent TrackMouseEvent
362 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
363 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
366 #ifndef LVM_GETSUBITEMRECT
367 #define LVM_GETSUBITEMRECT (0x1000 + 56)
371 #define LVCF_IMAGE 0x0010
374 #ifndef Header_GetItemRect
375 #define Header_GetItemRect(w,i,r) \
376 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
379 #ifndef HDM_GETITEMRECT
380 #define HDM_GETITEMRECT (HDM_FIRST+7)
383 #ifndef ListView_GetHeader
384 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
387 #ifndef ListView_GetSubItemRect
388 #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))
391 #ifndef LVM_GETHEADER
392 #define LVM_GETHEADER (LVM_FIRST+31)
396 #define HDLAYOUT HD_LAYOUT
400 #define HDITEM HD_ITEM
404 #define NMHEADER HD_NOTIFY
408 #define HDS_DRAGDROP 0x0040
411 #define HDS_FULLDRAG 0x0080
415 #ifndef HDN_BEGINDRAG
416 #define HDN_BEGINDRAG (HDN_FIRST - 11)
420 #define HDN_ENDDRAG (HDN_FIRST - 10)
423 #ifndef LVSICF_NOSCROLL
424 #define LVSICF_NOINVALIDATEALL 0x0001
425 #define LVSICF_NOSCROLL 0x0002
432 // ----------------------------------------------------------------------------
434 // ----------------------------------------------------------------------------
436 // The windows headers with Digital Mars lack some typedefs.
437 // typedef them as my_XXX and then #define to rename to XXX in case
438 // a newer version of Digital Mars fixes the headers
439 // (or up to date PSDK is in use with older version)
440 // also we use any required definition (MONITOR_DEFAULTTONULL) to recognize
441 // whether whole missing block needs to be included
443 #ifndef MONITOR_DEFAULTTONULL
445 #define HMONITOR_DECLARED
446 DECLARE_HANDLE(HMONITOR
);
447 typedef BOOL(CALLBACK
* my_MONITORENUMPROC
)(HMONITOR
,HDC
,LPRECT
,LPARAM
);
448 #define MONITORENUMPROC my_MONITORENUMPROC
449 typedef struct my_tagMONITORINFO
{
454 } my_MONITORINFO
,*my_LPMONITORINFO
;
455 #define MONITORINFO my_MONITORINFO
456 #define LPMONITORINFO my_LPMONITORINFO
458 typedef struct my_MONITORINFOEX
: public my_tagMONITORINFO
460 TCHAR szDevice
[CCHDEVICENAME
];
461 } my_MONITORINFOEX
, *my_LPMONITORINFOEX
;
462 #define MONITORINFOEX my_MONITORINFOEX
463 #define LPMONITORINFOEX my_LPMONITORINFOEX
465 #ifndef MONITOR_DEFAULTTONULL
466 #define MONITOR_DEFAULTTONULL 0
467 #endif // MONITOR_DEFAULTTONULL
469 #ifndef MONITORINFOF_PRIMARY
470 #define MONITORINFOF_PRIMARY 1
471 #endif // MONITORINFOF_PRIMARY
473 #ifndef DDENUM_ATTACHEDSECONDARYDEVICES
474 #define DDENUM_ATTACHEDSECONDARYDEVICES 1
477 #endif // MONITOR_DEFAULTTONULL
479 // ----------------------------------------------------------------------------
481 // ----------------------------------------------------------------------------
484 #define TVIS_FOCUSED 0x0001
487 #ifndef TVS_CHECKBOXES
488 #define TVS_CHECKBOXES 0x0100
492 #define TVITEM TV_ITEM
499 * The following are specifically required for OpenWatcom C++ (none at present)
502 #if defined(__WATCOMC__)
506 * The following are specifically required for MinGW (none at present)
509 #if defined (__MINGW32__)
511 #if !wxCHECK_W32API_VERSION(3,1)
514 #include "wx/msw/winundef.h"
520 } NCCALCSIZE_PARAMS
, *LPNCCALCSIZE_PARAMS
;
526 //Various defines that will be needed by mingw and possibly VC++6
527 //Used by the webview library
529 #ifndef DISPID_COMMANDSTATECHANGE
530 #define DISPID_COMMANDSTATECHANGE 105
533 #ifndef DISPID_NAVIGATECOMPLETE2
534 #define DISPID_NAVIGATECOMPLETE2 252
537 #ifndef DISPID_NAVIGATEERROR
538 #define DISPID_NAVIGATEERROR 271
541 #ifndef DISPID_NEWWINDOW3
542 #define DISPID_NEWWINDOW3 273
545 #ifndef INET_E_ERROR_FIRST
546 #define INET_E_ERROR_FIRST 0x800C0002L
549 #ifndef INET_E_INVALID_URL
550 #define INET_E_INVALID_URL 0x800C0002L
553 #ifndef INET_E_NO_SESSION
554 #define INET_E_NO_SESSION 0x800C0003L
557 #ifndef INET_E_CANNOT_CONNECT
558 #define INET_E_CANNOT_CONNECT 0x800C0004L
561 #ifndef INET_E_RESOURCE_NOT_FOUND
562 #define INET_E_RESOURCE_NOT_FOUND 0x800C0005L
565 #ifndef INET_E_OBJECT_NOT_FOUND
566 #define INET_E_OBJECT_NOT_FOUND 0x800C0006L
569 #ifndef INET_E_DATA_NOT_AVAILABLE
570 #define INET_E_DATA_NOT_AVAILABLE 0x800C0007L
573 #ifndef INET_E_DOWNLOAD_FAILURE
574 #define INET_E_DOWNLOAD_FAILURE 0x800C0008L
577 #ifndef INET_E_AUTHENTICATION_REQUIRED
578 #define INET_E_AUTHENTICATION_REQUIRED 0x800C0009L
581 #ifndef INET_E_NO_VALID_MEDIA
582 #define INET_E_NO_VALID_MEDIA 0x800C000AL
585 #ifndef INET_E_CONNECTION_TIMEOUT
586 #define INET_E_CONNECTION_TIMEOUT 0x800C000BL
589 #ifndef INET_E_INVALID_REQUEST
590 #define INET_E_INVALID_REQUEST 0x800C000CL
593 #ifndef INET_E_UNKNOWN_PROTOCOL
594 #define INET_E_UNKNOWN_PROTOCOL 0x800C000DL
597 #ifndef INET_E_SECURITY_PROBLEM
598 #define INET_E_SECURITY_PROBLEM 0x800C000EL
601 #ifndef INET_E_CANNOT_LOAD_DATA
602 #define INET_E_CANNOT_LOAD_DATA 0x800C000FL
605 #ifndef INET_E_CANNOT_INSTANTIATE_OBJECT
606 #define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L
609 #ifndef INET_E_QUERYOPTION_UNKNOWN
610 #define INET_E_QUERYOPTION_UNKNOWN 0x800C0013L
613 #ifndef INET_E_REDIRECT_FAILED
614 #define INET_E_REDIRECT_FAILED 0x800C0014L
617 #ifndef INET_E_REDIRECT_TO_DIR
618 #define INET_E_REDIRECT_TO_DIR 0x800C0015L
621 #ifndef INET_E_CANNOT_LOCK_REQUEST
622 #define INET_E_CANNOT_LOCK_REQUEST 0x800C0016L
625 #ifndef INET_E_USE_EXTEND_BINDING
626 #define INET_E_USE_EXTEND_BINDING 0x800C0017L
629 #ifndef INET_E_TERMINATED_BIND
630 #define INET_E_TERMINATED_BIND 0x800C0018L
633 #ifndef INET_E_INVALID_CERTIFICATE
634 #define INET_E_INVALID_CERTIFICATE 0x800C0019L
637 #ifndef INET_E_CODE_DOWNLOAD_DECLINED
638 #define INET_E_CODE_DOWNLOAD_DECLINED 0x800C0100L
641 #ifndef INET_E_RESULT_DISPATCHED
642 #define INET_E_RESULT_DISPATCHED 0x800C0200L
645 #ifndef INET_E_CANNOT_REPLACE_SFP_FILE
646 #define INET_E_CANNOT_REPLACE_SFP_FILE 0x800C0300L
649 #ifndef INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY
650 #define INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY 0x800C0500L
653 #ifndef INET_E_CODE_INSTALL_SUPPRESSED
654 #define INET_E_CODE_INSTALL_SUPPRESSED 0x800C0400L
657 #ifndef MUI_LANGUAGE_NAME
658 #define MUI_LANGUAGE_NAME 0x8
661 //We need to check if we are using MinGW or mingw-w64 as their
662 //definitions are different
668 #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
669 typedef enum CommandStateChangeConstants
{
670 CSC_UPDATECOMMANDS
= (int) 0xFFFFFFFF,
671 CSC_NAVIGATEFORWARD
= 0x1,
672 CSC_NAVIGATEBACK
= 0x2
673 } CommandStateChangeConstants
;
677 * In addition to the declarations for VC++, the following are required for WinCE
681 #include "wx/msw/wince/missing.h"
685 * The following are specifically required for Wine
689 #ifndef ENUM_CURRENT_SETTINGS
690 #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
692 #ifndef BROADCAST_QUERY_DENY
693 #define BROADCAST_QUERY_DENY 1112363332
695 #endif // defined __WINE__
697 #ifndef INVALID_FILE_ATTRIBUTES
698 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)