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
100 #define VK_OEM_PLUS 0xBB
101 #define VK_OEM_COMMA 0xBC
102 #define VK_OEM_MINUS 0xBD
103 #define VK_OEM_PERIOD 0xBE
107 #define SM_TABLETPC 86
110 #ifndef INKEDIT_CLASS
111 # define INKEDIT_CLASSW L"INKEDIT"
113 # define INKEDIT_CLASS INKEDIT_CLASSW
115 # define INKEDIT_CLASS "INKEDIT"
119 #ifndef EM_SETINKINSERTMODE
120 # define EM_SETINKINSERTMODE (WM_USER + 0x0204)
123 #ifndef EM_SETUSEMOUSEFORINPUT
124 #define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224)
128 #define TPM_RECURSE 1
132 #ifndef WS_EX_LAYOUTRTL
133 #define WS_EX_LAYOUTRTL 0x00400000
136 #ifndef WS_EX_COMPOSITED
137 #define WS_EX_COMPOSITED 0x02000000L
140 #ifndef WS_EX_LAYERED
141 #define WS_EX_LAYERED 0x00080000
148 #ifndef QS_ALLPOSTMESSAGE
149 #define QS_ALLPOSTMESSAGE 0
153 * The following are required for VC++ 5 when the PSDK is not available.
156 #if defined __VISUALC__ && __VISUALC__ <= 1100
158 #ifndef VER_NT_WORKSTATION
160 typedef struct _OSVERSIONINFOEXA
{
161 DWORD dwOSVersionInfoSize
;
162 DWORD dwMajorVersion
;
163 DWORD dwMinorVersion
;
166 CHAR szCSDVersion
[128];
167 WORD wServicePackMajor
;
168 WORD wServicePackMinor
;
172 } OSVERSIONINFOEXA
, *POSVERSIONINFOEXA
, *LPOSVERSIONINFOEXA
;
173 typedef struct _OSVERSIONINFOEXW
{
174 DWORD dwOSVersionInfoSize
;
175 DWORD dwMajorVersion
;
176 DWORD dwMinorVersion
;
179 WCHAR szCSDVersion
[128];
180 WORD wServicePackMajor
;
181 WORD wServicePackMinor
;
185 } OSVERSIONINFOEXW
, *POSVERSIONINFOEXW
, *LPOSVERSIONINFOEXW
;
188 typedef OSVERSIONINFOW OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
189 typedef OSVERSIONINFOEXW OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
191 typedef OSVERSIONINFOA OSVERSIONINFO
,*POSVERSIONINFO
,*LPOSVERSIONINFO
;
192 typedef OSVERSIONINFOEXA OSVERSIONINFOEX
,*POSVERSIONINFOEX
,*LPOSVERSIONINFOEX
;
195 #endif // defined VER_NT_WORKSTATION
201 // NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added
202 // with IE4, as was IPN_FIRST which is used as a test :-(.
206 typedef struct wxtagNMLVCUSTOMDRAW_
{
211 } wxNMLVCUSTOMDRAW_
, *wxLPNMLVCUSTOMDRAW_
;
213 #define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_
214 #define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_
216 #endif // defined IPN_FIRST
218 #endif // defined __VISUALC__ && __VISUALC__ <= 1100
220 // ----------------------------------------------------------------------------
222 // ----------------------------------------------------------------------------
225 #define MIIM_STRING 0x00000040
226 #define MIIM_BITMAP 0x00000080
227 #define MIIM_FTYPE 0x00000100
228 #define HBMMENU_CALLBACK ((HBITMAP) -1)
230 typedef struct tagMENUINFO
237 DWORD dwContextHelpID
;
239 } MENUINFO
, FAR
*LPMENUINFO
;
240 #endif // MIIM_BITMAP &c
242 // ----------------------------------------------------------------------------
243 // definitions related to ListView and Header common controls, needed by
244 // msw/listctrl.cpp and msw/headerctrl.cpp
245 // ----------------------------------------------------------------------------
248 #define I_IMAGENONE (-2)
251 #ifndef LVS_EX_FULLROWSELECT
252 #define LVS_EX_FULLROWSELECT 0x00000020
255 // LVS_EX_LABELTIP is not supported by Windows CE, don't define it there
256 #if !defined(LVS_EX_LABELTIP) && !defined(__WXWINCE__)
257 #define LVS_EX_LABELTIP 0x00004000
260 #ifndef LVS_EX_SUBITEMIMAGES
261 #define LVS_EX_SUBITEMIMAGES 0x00000002
264 #ifndef HDN_GETDISPINFOW
265 #define HDN_GETDISPINFOW (HDN_FIRST-29)
269 #define HDS_HOTTRACK 4
272 #define HDS_FLAT 0x0200
276 #define HDF_SORTUP 0x0400
277 #define HDF_SORTDOWN 0x0200
281 * In addition to the above, the following are required for several compilers.
284 #if !defined(CCS_VERT)
285 #define CCS_VERT 0x00000080L
288 #if !defined(CCS_RIGHT)
289 #define CCS_RIGHT (CCS_VERT|CCS_BOTTOM)
292 #if !defined(TB_SETDISABLEDIMAGELIST)
293 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
294 #endif // !defined(TB_SETDISABLEDIMAGELIST)
296 #ifndef CFM_BACKCOLOR
297 #define CFM_BACKCOLOR 0x04000000
300 #ifndef HANGUL_CHARSET
301 #define HANGUL_CHARSET 129
304 #ifndef CCM_SETUNICODEFORMAT
305 #define CCM_SETUNICODEFORMAT 8197
308 // ----------------------------------------------------------------------------
310 // ----------------------------------------------------------------------------
313 #define TV_FIRST 0x1100
316 #ifndef TVS_FULLROWSELECT
317 #define TVS_FULLROWSELECT 0x1000
320 #ifndef TVM_SETBKCOLOR
321 #define TVM_SETBKCOLOR (TV_FIRST + 29)
322 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
326 * The following are required for BC++ 5.5 (none at present.)
330 * The following are specifically required for Digital Mars C++
335 #ifndef VER_NT_WORKSTATION
336 typedef struct _OSVERSIONINFOEX
{
337 DWORD dwOSVersionInfoSize
;
338 DWORD dwMajorVersion
;
339 DWORD dwMinorVersion
;
342 TCHAR szCSDVersion
[ 128 ];
343 WORD wServicePackMajor
;
344 WORD wServicePackMinor
;
349 #endif // !defined(VER_NT_WORKSTATION)
351 #ifndef _TrackMouseEvent
352 #define _TrackMouseEvent TrackMouseEvent
355 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
356 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
359 #ifndef LVM_GETSUBITEMRECT
360 #define LVM_GETSUBITEMRECT (0x1000 + 56)
364 #define LVCF_IMAGE 0x0010
367 #ifndef Header_GetItemRect
368 #define Header_GetItemRect(w,i,r) \
369 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
372 #ifndef HDM_GETITEMRECT
373 #define HDM_GETITEMRECT (HDM_FIRST+7)
376 #ifndef ListView_GetHeader
377 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
380 #ifndef ListView_GetSubItemRect
381 #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))
384 #ifndef LVM_GETHEADER
385 #define LVM_GETHEADER (LVM_FIRST+31)
389 #define HDLAYOUT HD_LAYOUT
393 #define HDITEM HD_ITEM
397 #define NMHEADER HD_NOTIFY
401 #define HDS_DRAGDROP 0x0040
404 #define HDS_FULLDRAG 0x0080
408 #ifndef HDN_BEGINDRAG
409 #define HDN_BEGINDRAG (HDN_FIRST - 11)
413 #define HDN_ENDDRAG (HDN_FIRST - 10)
416 #ifndef LVSICF_NOSCROLL
417 #define LVSICF_NOINVALIDATEALL 0x0001
418 #define LVSICF_NOSCROLL 0x0002
425 // ----------------------------------------------------------------------------
427 // ----------------------------------------------------------------------------
429 // The windows headers with Digital Mars lack some typedefs.
430 // typedef them as my_XXX and then #define to rename to XXX in case
431 // a newer version of Digital Mars fixes the headers
432 // (or up to date PSDK is in use with older version)
433 // also we use any required definition (MONITOR_DEFAULTTONULL) to recognize
434 // whether whole missing block needs to be included
436 #ifndef MONITOR_DEFAULTTONULL
438 #define HMONITOR_DECLARED
439 DECLARE_HANDLE(HMONITOR
);
440 typedef BOOL(CALLBACK
* my_MONITORENUMPROC
)(HMONITOR
,HDC
,LPRECT
,LPARAM
);
441 #define MONITORENUMPROC my_MONITORENUMPROC
442 typedef struct my_tagMONITORINFO
{
447 } my_MONITORINFO
,*my_LPMONITORINFO
;
448 #define MONITORINFO my_MONITORINFO
449 #define LPMONITORINFO my_LPMONITORINFO
451 typedef struct my_MONITORINFOEX
: public my_tagMONITORINFO
453 TCHAR szDevice
[CCHDEVICENAME
];
454 } my_MONITORINFOEX
, *my_LPMONITORINFOEX
;
455 #define MONITORINFOEX my_MONITORINFOEX
456 #define LPMONITORINFOEX my_LPMONITORINFOEX
458 #ifndef MONITOR_DEFAULTTONULL
459 #define MONITOR_DEFAULTTONULL 0
460 #endif // MONITOR_DEFAULTTONULL
462 #ifndef MONITORINFOF_PRIMARY
463 #define MONITORINFOF_PRIMARY 1
464 #endif // MONITORINFOF_PRIMARY
466 #ifndef DDENUM_ATTACHEDSECONDARYDEVICES
467 #define DDENUM_ATTACHEDSECONDARYDEVICES 1
470 #endif // MONITOR_DEFAULTTONULL
472 // ----------------------------------------------------------------------------
474 // ----------------------------------------------------------------------------
477 #define TVIS_FOCUSED 0x0001
480 #ifndef TVS_CHECKBOXES
481 #define TVS_CHECKBOXES 0x0100
485 #define TVITEM TV_ITEM
492 * The following are specifically required for OpenWatcom C++ (none at present)
495 #if defined(__WATCOMC__)
499 * The following are specifically required for MinGW (none at present)
502 #if defined (__MINGW32__)
504 #if !wxCHECK_W32API_VERSION(3,1)
507 #include "wx/msw/winundef.h"
513 } NCCALCSIZE_PARAMS
, *LPNCCALCSIZE_PARAMS
;
519 //Various defines that will be needed by mingw and possibly VC++6
520 //Used by the webview library
522 typedef enum CommandStateChangeConstants
{
523 CSC_UPDATECOMMANDS
= (int) 0xFFFFFFFF,
524 CSC_NAVIGATEFORWARD
= 0x1,
525 CSC_NAVIGATEBACK
= 0x2
526 } CommandStateChangeConstants
;
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 //We need to check if we are using MinGW which doesn't inlcude the urlmon
658 //defintions as opposed to MinGW-64 which does
664 //Definitions from w64 mingw-runtime package, in the public domain
666 #if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
668 #define REFRESH_NORMAL 0
669 #define REFRESH_COMPLETELY 3
671 EXTERN_C
const IID CLSID_FileProtocol
;
673 DEFINE_GUID(IID_IInternetProtocolRoot
,0x79eac9e3,0xbaf9,0x11ce,0x8c,0x82,0,0xaa,0,0x4b,0xa9,0xb);
674 DEFINE_GUID(IID_IInternetProtocol
,0x79eac9e4,0xbaf9,0x11ce,0x8c,0x82,0,0xaa,0,0x4b,0xa9,0xb);
676 typedef enum __MIDL_IBindStatusCallback_0006
678 BSCF_FIRSTDATANOTIFICATION
= 0x1,
679 BSCF_INTERMEDIATEDATANOTIFICATION
= 0x2,
680 BSCF_LASTDATANOTIFICATION
= 0x4,
681 BSCF_DATAFULLYAVAILABLE
= 0x8,
682 BSCF_AVAILABLEDATASIZEUNKNOWN
= 0x10
685 typedef struct _tagPROTOCOLDATA
693 typedef struct _tagBINDINFO
697 STGMEDIUM stgmedData
;
703 DWORD dwOptionsFlags
;
705 SECURITY_ATTRIBUTES securityAttributes
;
712 struct IInternetBindInfo
: public IUnknown
715 virtual HRESULT WINAPI
GetBindInfo(DWORD
*grfBINDF
,BINDINFO
*pbindinfo
) = 0;
716 virtual HRESULT WINAPI
GetBindString(ULONG ulStringType
,LPOLESTR
*ppwzStr
,
717 ULONG cEl
,ULONG
*pcElFetched
) = 0;
720 struct IInternetProtocolSink
: public IUnknown
723 virtual HRESULT WINAPI
Switch(PROTOCOLDATA
*pProtocolData
) = 0;
724 virtual HRESULT WINAPI
ReportProgress(ULONG ulStatusCode
,
725 LPCWSTR szStatusText
) = 0;
726 virtual HRESULT WINAPI
ReportData(DWORD grfBSCF
,ULONG ulProgress
,
727 ULONG ulProgressMax
) = 0;
728 virtual HRESULT WINAPI
ReportResult(HRESULT hrResult
,DWORD dwError
,
729 LPCWSTR szResult
) = 0;
732 struct IInternetProtocolRoot
: public IUnknown
735 virtual HRESULT WINAPI
Start(LPCWSTR szUrl
,IInternetProtocolSink
*pOIProtSink
,
736 IInternetBindInfo
*pOIBindInfo
,DWORD grfPI
,
737 HANDLE_PTR dwReserved
) = 0;
738 virtual HRESULT WINAPI
Continue(PROTOCOLDATA
*pProtocolData
) = 0;
739 virtual HRESULT WINAPI
Abort(HRESULT hrReason
,DWORD dwOptions
) = 0;
740 virtual HRESULT WINAPI
Terminate(DWORD dwOptions
) = 0;
741 virtual HRESULT WINAPI
Suspend(void) = 0;
742 virtual HRESULT WINAPI
Resume(void) = 0;
745 struct IInternetProtocol
: public IInternetProtocolRoot
748 virtual HRESULT WINAPI
Read(void *pv
,ULONG cb
,ULONG
*pcbRead
) = 0;
749 virtual HRESULT WINAPI
Seek(LARGE_INTEGER dlibMove
,DWORD dwOrigin
,
750 ULARGE_INTEGER
*plibNewPosition
) = 0;
751 virtual HRESULT WINAPI
LockRequest(DWORD dwOptions
) = 0;
752 virtual HRESULT WINAPI
UnlockRequest(void) = 0;
755 struct IInternetSession
: public IUnknown
758 virtual HRESULT WINAPI
RegisterNameSpace(IClassFactory
*pCF
,REFCLSID rclsid
,
761 const LPCWSTR
*ppwzPatterns
,
762 DWORD dwReserved
) = 0;
763 virtual HRESULT WINAPI
UnregisterNameSpace(IClassFactory
*pCF
,
764 LPCWSTR pszProtocol
) = 0;
765 virtual HRESULT WINAPI
RegisterMimeFilter(IClassFactory
*pCF
,
767 LPCWSTR pwzType
) = 0;
768 virtual HRESULT WINAPI
UnregisterMimeFilter(IClassFactory
*pCF
,
769 LPCWSTR pwzType
) = 0;
770 virtual HRESULT WINAPI
CreateBinding(LPBC pBC
,LPCWSTR szUrl
,
771 IUnknown
*pUnkOuter
,IUnknown
**ppUnk
,
772 IInternetProtocol
**ppOInetProt
,
774 virtual HRESULT WINAPI
SetSessionOption(DWORD dwOption
,LPVOID pBuffer
,
775 DWORD dwBufferLength
,
776 DWORD dwReserved
) = 0;
777 virtual HRESULT WINAPI
GetSessionOption(DWORD dwOption
,LPVOID pBuffer
,
778 DWORD
*pdwBufferLength
,
779 DWORD dwReserved
) = 0;
785 * In addition to the declarations for VC++, the following are required for WinCE
789 #include "wx/msw/wince/missing.h"
793 * The following are specifically required for Wine
797 #ifndef ENUM_CURRENT_SETTINGS
798 #define ENUM_CURRENT_SETTINGS ((DWORD)-1)
800 #ifndef BROADCAST_QUERY_DENY
801 #define BROADCAST_QUERY_DENY 1112363332
803 #endif // defined __WINE__
805 #ifndef INVALID_FILE_ATTRIBUTES
806 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)