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 #endif // wxUSE_MOUSEWHEEL
91 // Needed by window.cpp
100 #define VK_OEM_102 0xE2
104 #define VK_OEM_PLUS 0xBB
105 #define VK_OEM_COMMA 0xBC
106 #define VK_OEM_MINUS 0xBD
107 #define VK_OEM_PERIOD 0xBE
111 #define SM_TABLETPC 86
114 #ifndef INKEDIT_CLASS
115 # define INKEDIT_CLASSW L"INKEDIT"
117 # define INKEDIT_CLASS INKEDIT_CLASSW
119 # define INKEDIT_CLASS "INKEDIT"
123 #ifndef EM_SETINKINSERTMODE
124 # define EM_SETINKINSERTMODE (WM_USER + 0x0204)
127 #ifndef EM_SETUSEMOUSEFORINPUT
128 #define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224)
132 #define TPM_RECURSE 1
136 #ifndef WS_EX_LAYOUTRTL
137 #define WS_EX_LAYOUTRTL 0x00400000
140 #ifndef WS_EX_COMPOSITED
141 #define WS_EX_COMPOSITED 0x02000000L
144 #ifndef WS_EX_LAYERED
145 #define WS_EX_LAYERED 0x00080000
152 #ifndef QS_ALLPOSTMESSAGE
153 #define QS_ALLPOSTMESSAGE 0
157 * The following are required for VC++ 5 when the PSDK is not available.
160 #if defined __VISUALC__ && __VISUALC__ <= 1100
162 #ifndef VER_NT_WORKSTATION
164 typedef struct _OSVERSIONINFOEXA
{
165 DWORD dwOSVersionInfoSize
;
166 DWORD dwMajorVersion
;
167 DWORD dwMinorVersion
;
170 CHAR szCSDVersion
[128];
171 WORD wServicePackMajor
;
172 WORD wServicePackMinor
;
176 } OSVERSIONINFOEXA
, *POSVERSIONINFOEXA
, *LPOSVERSIONINFOEXA
;
177 typedef struct _OSVERSIONINFOEXW
{
178 DWORD dwOSVersionInfoSize
;
179 DWORD dwMajorVersion
;
180 DWORD dwMinorVersion
;
183 WCHAR szCSDVersion
[128];
184 WORD wServicePackMajor
;
185 WORD wServicePackMinor
;
189 } OSVERSIONINFOEXW
, *POSVERSIONINFOEXW
, *LPOSVERSIONINFOEXW
;
192 typedef OSVERSIONINFOW OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
193 typedef OSVERSIONINFOEXW OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
195 typedef OSVERSIONINFOA OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
196 typedef OSVERSIONINFOEXA OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
199 #endif // defined VER_NT_WORKSTATION
205 // NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added
206 // with IE4, as was IPN_FIRST which is used as a test :-(.
210 typedef struct wxtagNMLVCUSTOMDRAW_
{
215 } wxNMLVCUSTOMDRAW_
, *wxLPNMLVCUSTOMDRAW_
;
217 #define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_
218 #define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_
220 #endif // defined IPN_FIRST
222 #endif // defined __VISUALC__ && __VISUALC__ <= 1100
224 // ----------------------------------------------------------------------------
226 // ----------------------------------------------------------------------------
229 #define MIIM_STRING 0x00000040
230 #define MIIM_BITMAP 0x00000080
231 #define MIIM_FTYPE 0x00000100
232 #define HBMMENU_CALLBACK ((HBITMAP) -1)
234 typedef struct tagMENUINFO
241 DWORD dwContextHelpID
;
243 } MENUINFO
, FAR
*LPMENUINFO
;
244 #endif // MIIM_BITMAP &c
246 // ----------------------------------------------------------------------------
247 // definitions related to ListView and Header common controls, needed by
248 // msw/listctrl.cpp and msw/headerctrl.cpp
249 // ----------------------------------------------------------------------------
252 #define I_IMAGENONE (-2)
255 #ifndef LVS_EX_FULLROWSELECT
256 #define LVS_EX_FULLROWSELECT 0x00000020
259 // LVS_EX_LABELTIP is not supported by Windows CE, don't define it there
260 #if !defined(LVS_EX_LABELTIP) && !defined(__WXWINCE__)
261 #define LVS_EX_LABELTIP 0x00004000
264 #ifndef LVS_EX_SUBITEMIMAGES
265 #define LVS_EX_SUBITEMIMAGES 0x00000002
268 #ifndef HDN_GETDISPINFOW
269 #define HDN_GETDISPINFOW (HDN_FIRST-29)
273 #define HDS_HOTTRACK 4
276 #define HDS_FLAT 0x0200
280 #define HDF_SORTUP 0x0400
281 #define HDF_SORTDOWN 0x0200
285 * In addition to the above, the following are required for several compilers.
288 #if !defined(CCS_VERT)
289 #define CCS_VERT 0x00000080L
292 #if !defined(CCS_RIGHT)
293 #define CCS_RIGHT (CCS_VERT|CCS_BOTTOM)
296 #if !defined(TB_SETDISABLEDIMAGELIST)
297 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
298 #endif // !defined(TB_SETDISABLEDIMAGELIST)
300 #ifndef CFM_BACKCOLOR
301 #define CFM_BACKCOLOR 0x04000000
304 #ifndef HANGUL_CHARSET
305 #define HANGUL_CHARSET 129
308 #ifndef CCM_SETUNICODEFORMAT
309 #define CCM_SETUNICODEFORMAT 8197
312 // ----------------------------------------------------------------------------
314 // ----------------------------------------------------------------------------
317 #define TV_FIRST 0x1100
320 #ifndef TVS_FULLROWSELECT
321 #define TVS_FULLROWSELECT 0x1000
324 #ifndef TVM_SETBKCOLOR
325 #define TVM_SETBKCOLOR (TV_FIRST + 29)
326 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
330 * The following are required for BC++ 5.5 (none at present.)
334 * The following are specifically required for Digital Mars C++
339 #ifndef VER_NT_WORKSTATION
340 typedef struct _OSVERSIONINFOEX
{
341 DWORD dwOSVersionInfoSize
;
342 DWORD dwMajorVersion
;
343 DWORD dwMinorVersion
;
346 TCHAR szCSDVersion
[ 128 ];
347 WORD wServicePackMajor
;
348 WORD wServicePackMinor
;
353 #endif // !defined(VER_NT_WORKSTATION)
355 #ifndef _TrackMouseEvent
356 #define _TrackMouseEvent TrackMouseEvent
359 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
360 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
363 #ifndef LVM_GETSUBITEMRECT
364 #define LVM_GETSUBITEMRECT (0x1000 + 56)
368 #define LVCF_IMAGE 0x0010
371 #ifndef Header_GetItemRect
372 #define Header_GetItemRect(w,i,r) \
373 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
376 #ifndef HDM_GETITEMRECT
377 #define HDM_GETITEMRECT (HDM_FIRST+7)
380 #ifndef ListView_GetHeader
381 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
384 #ifndef ListView_GetSubItemRect
385 #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))
388 #ifndef LVM_GETHEADER
389 #define LVM_GETHEADER (LVM_FIRST+31)
393 #define HDLAYOUT HD_LAYOUT
397 #define HDITEM HD_ITEM
401 #define NMHEADER HD_NOTIFY
405 #define HDS_DRAGDROP 0x0040
408 #define HDS_FULLDRAG 0x0080
412 #ifndef HDN_BEGINDRAG
413 #define HDN_BEGINDRAG (HDN_FIRST - 11)
417 #define HDN_ENDDRAG (HDN_FIRST - 10)
420 #ifndef LVSICF_NOSCROLL
421 #define LVSICF_NOINVALIDATEALL 0x0001
422 #define LVSICF_NOSCROLL 0x0002
429 // ----------------------------------------------------------------------------
431 // ----------------------------------------------------------------------------
433 // The windows headers with Digital Mars lack some typedefs.
434 // typedef them as my_XXX and then #define to rename to XXX in case
435 // a newer version of Digital Mars fixes the headers
436 // (or up to date PSDK is in use with older version)
437 // also we use any required definition (MONITOR_DEFAULTTONULL) to recognize
438 // whether whole missing block needs to be included
440 #ifndef MONITOR_DEFAULTTONULL
442 #define HMONITOR_DECLARED
443 DECLARE_HANDLE(HMONITOR
);
444 typedef BOOL(CALLBACK
* my_MONITORENUMPROC
)(HMONITOR
,HDC
,LPRECT
,LPARAM
);
445 #define MONITORENUMPROC my_MONITORENUMPROC
446 typedef struct my_tagMONITORINFO
{
451 } my_MONITORINFO
,*my_LPMONITORINFO
;
452 #define MONITORINFO my_MONITORINFO
453 #define LPMONITORINFO my_LPMONITORINFO
455 typedef struct my_MONITORINFOEX
: public my_tagMONITORINFO
457 TCHAR szDevice
[CCHDEVICENAME
];
458 } my_MONITORINFOEX
, *my_LPMONITORINFOEX
;
459 #define MONITORINFOEX my_MONITORINFOEX
460 #define LPMONITORINFOEX my_LPMONITORINFOEX
462 #ifndef MONITOR_DEFAULTTONULL
463 #define MONITOR_DEFAULTTONULL 0
464 #endif // MONITOR_DEFAULTTONULL
466 #ifndef MONITORINFOF_PRIMARY
467 #define MONITORINFOF_PRIMARY 1
468 #endif // MONITORINFOF_PRIMARY
470 #ifndef DDENUM_ATTACHEDSECONDARYDEVICES
471 #define DDENUM_ATTACHEDSECONDARYDEVICES 1
474 #endif // MONITOR_DEFAULTTONULL
476 // ----------------------------------------------------------------------------
478 // ----------------------------------------------------------------------------
481 #define TVIS_FOCUSED 0x0001
484 #ifndef TVS_CHECKBOXES
485 #define TVS_CHECKBOXES 0x0100
489 #define TVITEM TV_ITEM
496 * The following are specifically required for OpenWatcom C++ (none at present)
499 #if defined(__WATCOMC__)
503 * The following are specifically required for MinGW (none at present)
506 #if defined (__MINGW32__)
508 #if !wxCHECK_W32API_VERSION(3,1)
511 #include "wx/msw/winundef.h"
517 } NCCALCSIZE_PARAMS
, *LPNCCALCSIZE_PARAMS
;
523 //Various defines that will be needed by mingw and possibly VC++6
524 //Used by the webview library
526 #ifndef DISPID_COMMANDSTATECHANGE
527 #define DISPID_COMMANDSTATECHANGE 105
530 #ifndef DISPID_NAVIGATECOMPLETE2
531 #define DISPID_NAVIGATECOMPLETE2 252
534 #ifndef DISPID_NAVIGATEERROR
535 #define DISPID_NAVIGATEERROR 271
538 #ifndef DISPID_NEWWINDOW3
539 #define DISPID_NEWWINDOW3 273
542 #ifndef INET_E_ERROR_FIRST
543 #define INET_E_ERROR_FIRST 0x800C0002L
546 #ifndef INET_E_INVALID_URL
547 #define INET_E_INVALID_URL 0x800C0002L
550 #ifndef INET_E_NO_SESSION
551 #define INET_E_NO_SESSION 0x800C0003L
554 #ifndef INET_E_CANNOT_CONNECT
555 #define INET_E_CANNOT_CONNECT 0x800C0004L
558 #ifndef INET_E_RESOURCE_NOT_FOUND
559 #define INET_E_RESOURCE_NOT_FOUND 0x800C0005L
562 #ifndef INET_E_OBJECT_NOT_FOUND
563 #define INET_E_OBJECT_NOT_FOUND 0x800C0006L
566 #ifndef INET_E_DATA_NOT_AVAILABLE
567 #define INET_E_DATA_NOT_AVAILABLE 0x800C0007L
570 #ifndef INET_E_DOWNLOAD_FAILURE
571 #define INET_E_DOWNLOAD_FAILURE 0x800C0008L
574 #ifndef INET_E_AUTHENTICATION_REQUIRED
575 #define INET_E_AUTHENTICATION_REQUIRED 0x800C0009L
578 #ifndef INET_E_NO_VALID_MEDIA
579 #define INET_E_NO_VALID_MEDIA 0x800C000AL
582 #ifndef INET_E_CONNECTION_TIMEOUT
583 #define INET_E_CONNECTION_TIMEOUT 0x800C000BL
586 #ifndef INET_E_INVALID_REQUEST
587 #define INET_E_INVALID_REQUEST 0x800C000CL
590 #ifndef INET_E_UNKNOWN_PROTOCOL
591 #define INET_E_UNKNOWN_PROTOCOL 0x800C000DL
594 #ifndef INET_E_SECURITY_PROBLEM
595 #define INET_E_SECURITY_PROBLEM 0x800C000EL
598 #ifndef INET_E_CANNOT_LOAD_DATA
599 #define INET_E_CANNOT_LOAD_DATA 0x800C000FL
602 #ifndef INET_E_CANNOT_INSTANTIATE_OBJECT
603 #define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L
606 #ifndef INET_E_QUERYOPTION_UNKNOWN
607 #define INET_E_QUERYOPTION_UNKNOWN 0x800C0013L
610 #ifndef INET_E_REDIRECT_FAILED
611 #define INET_E_REDIRECT_FAILED 0x800C0014L
614 #ifndef INET_E_REDIRECT_TO_DIR
615 #define INET_E_REDIRECT_TO_DIR 0x800C0015L
618 #ifndef INET_E_CANNOT_LOCK_REQUEST
619 #define INET_E_CANNOT_LOCK_REQUEST 0x800C0016L
622 #ifndef INET_E_USE_EXTEND_BINDING
623 #define INET_E_USE_EXTEND_BINDING 0x800C0017L
626 #ifndef INET_E_TERMINATED_BIND
627 #define INET_E_TERMINATED_BIND 0x800C0018L
630 #ifndef INET_E_INVALID_CERTIFICATE
631 #define INET_E_INVALID_CERTIFICATE 0x800C0019L
634 #ifndef INET_E_CODE_DOWNLOAD_DECLINED
635 #define INET_E_CODE_DOWNLOAD_DECLINED 0x800C0100L
638 #ifndef INET_E_RESULT_DISPATCHED
639 #define INET_E_RESULT_DISPATCHED 0x800C0200L
642 #ifndef INET_E_CANNOT_REPLACE_SFP_FILE
643 #define INET_E_CANNOT_REPLACE_SFP_FILE 0x800C0300L
646 #ifndef INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY
647 #define INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY 0x800C0500L
650 #ifndef INET_E_CODE_INSTALL_SUPPRESSED
651 #define INET_E_CODE_INSTALL_SUPPRESSED 0x800C0400L
654 #ifndef MUI_LANGUAGE_NAME
655 #define MUI_LANGUAGE_NAME 0x8
658 //We need to check if we are using MinGW or mingw-w64 as their
659 //definitions are different
665 #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
666 typedef enum CommandStateChangeConstants
{
667 CSC_UPDATECOMMANDS
= (int) 0xFFFFFFFF,
668 CSC_NAVIGATEFORWARD
= 0x1,
669 CSC_NAVIGATEBACK
= 0x2
670 } CommandStateChangeConstants
;
674 * In addition to the declarations for VC++, the following are required for WinCE
678 #include "wx/msw/wince/missing.h"
682 * The following are specifically required for Wine
686 #ifndef ENUM_CURRENT_SETTINGS
687 #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
689 #ifndef BROADCAST_QUERY_DENY
690 #define BROADCAST_QUERY_DENY 1112363332
692 #endif // defined __WINE__
694 #ifndef INVALID_FILE_ATTRIBUTES
695 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)