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 5// Created: 2002/04/23 6// RCS-ID: $Id: missing.h 48436 2007-08-28 19:26:16Z JS $ 7// Copyright: (c) 2002 Mattia Barbon 8// Licence: wxWindows licence 9///////////////////////////////////////////////////////////////////////////// 10 11#ifndef _WX_MISSING_H_ 12#define _WX_MISSING_H_ 13 14/* 15 * The following are required for VC++ 6. 16 */ 17 18// Needed by cursor.cpp 19#ifndef IDC_HAND 20 #define IDC_HAND MAKEINTRESOURCE(32649) 21#endif 22 23// Needed by strconv.cpp 24#ifndef WC_NO_BEST_FIT_CHARS 25 #define WC_NO_BEST_FIT_CHARS 0x400 26#endif 27 28#ifndef WM_CONTEXTMENU 29 #define WM_CONTEXTMENU 0x007B 30#endif 31 32// Needed by toplevel.cpp 33#ifndef WM_UPDATEUISTATE 34 #define WM_UPDATEUISTATE 0x0128 35#endif 36 37#ifndef WM_CHANGEUISTATE 38 #define WM_CHANGEUISTATE 0x0127 39#endif 40 41#ifndef WM_PRINTCLIENT 42 #define WM_PRINTCLIENT 0x318 43#endif 44 45// Needed by toplevel.cpp 46#ifndef UIS_SET 47 #define UIS_SET 1 48 #define UIS_CLEAR 2 49 #define UIS_INITIALIZE 3 50#endif 51 52#ifndef UISF_HIDEFOCUS 53 #define UISF_HIDEFOCUS 1 54#endif 55 56#ifndef UISF_HIDEACCEL 57 #define UISF_HIDEACCEL 2 58#endif 59 60#ifndef OFN_EXPLORER 61 #define OFN_EXPLORER 0x00080000 62#endif 63 64#ifndef OFN_ENABLESIZING 65 #define OFN_ENABLESIZING 0x00800000 66#endif 67 68// Needed by window.cpp 69#if wxUSE_MOUSEWHEEL 70 #ifndef WM_MOUSEWHEEL 71 #define WM_MOUSEWHEEL 0x020A 72 #endif 73 #ifndef WHEEL_DELTA 74 #define WHEEL_DELTA 120 75 #endif 76 #ifndef SPI_GETWHEELSCROLLLINES 77 #define SPI_GETWHEELSCROLLLINES 104 78 #endif 79#endif // wxUSE_MOUSEWHEEL 80 81// Needed by window.cpp 82#ifndef VK_OEM_1 83 #define VK_OEM_1 0xBA 84 #define VK_OEM_2 0xBF 85 #define VK_OEM_3 0xC0 86 #define VK_OEM_4 0xDB 87 #define VK_OEM_5 0xDC 88 #define VK_OEM_6 0xDD 89 #define VK_OEM_7 0xDE 90#endif 91 92#ifndef VK_OEM_COMMA 93 #define VK_OEM_PLUS 0xBB 94 #define VK_OEM_COMMA 0xBC 95 #define VK_OEM_MINUS 0xBD 96 #define VK_OEM_PERIOD 0xBE 97#endif 98 99#ifndef SM_TABLETPC 100 #define SM_TABLETPC 86 101#endif 102 103#ifndef INKEDIT_CLASS 104# define INKEDIT_CLASSW L"INKEDIT" 105# ifdef UNICODE 106# define INKEDIT_CLASS INKEDIT_CLASSW 107# else 108# define INKEDIT_CLASS "INKEDIT" 109# endif 110#endif 111 112#ifndef EM_SETINKINSERTMODE 113# define EM_SETINKINSERTMODE (WM_USER + 0x0204) 114#endif 115 116#ifndef EM_SETUSEMOUSEFORINPUT 117#define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224) 118#endif 119 120#ifndef TPM_RECURSE 121#define TPM_RECURSE 1 122#endif 123 124 125#ifndef WS_EX_LAYOUTRTL 126#define WS_EX_LAYOUTRTL 0x00400000 127#endif 128 129#ifndef WS_EX_COMPOSITED 130#define WS_EX_COMPOSITED 0x02000000L 131#endif 132 133#ifndef WS_EX_LAYERED 134#define WS_EX_LAYERED 0x00080000 135#endif 136 137#ifndef LWA_ALPHA 138#define LWA_ALPHA 2 139#endif 140 141#if defined __VISUALC__ && __VISUALC__ <= 1200 && !defined MIIM_BITMAP 142#define MIIM_STRING 0x00000040 143#define MIIM_BITMAP 0x00000080 144#define MIIM_FTYPE 0x00000100 145#define HBMMENU_CALLBACK ((HBITMAP) -1) 146typedef struct tagMENUINFO 147{ 148 DWORD cbSize; 149 DWORD fMask; 150 DWORD dwStyle; 151 UINT cyMax; 152 HBRUSH hbrBack; 153 DWORD dwContextHelpID; 154 DWORD dwMenuData; 155} MENUINFO, FAR *LPMENUINFO; 156struct wxMENUITEMINFO_ 157{ 158 UINT cbSize; 159 UINT fMask; 160 UINT fType; 161 UINT fState; 162 UINT wID; 163 HMENU hSubMenu; 164 HBITMAP hbmpChecked; 165 HBITMAP hbmpUnchecked; 166 DWORD dwItemData; 167 LPTSTR dwTypeData; 168 UINT cch; 169 HBITMAP hbmpItem; 170}; 171#else 172#define wxMENUITEMINFO_ MENUITEMINFO 173#endif 174 175/* 176 * The following are required for VC++ 5 when the PSDK is not available. 177 */ 178 179#if defined __VISUALC__ && __VISUALC__ <= 1100 180 181#ifndef VER_NT_WORKSTATION 182 183typedef struct _OSVERSIONINFOEXA { 184 DWORD dwOSVersionInfoSize; 185 DWORD dwMajorVersion; 186 DWORD dwMinorVersion; 187 DWORD dwBuildNumber; 188 DWORD dwPlatformId; 189 CHAR szCSDVersion[128]; 190 WORD wServicePackMajor; 191 WORD wServicePackMinor; 192 WORD wSuiteMask; 193 BYTE wProductType; 194 BYTE wReserved; 195} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA; 196typedef struct _OSVERSIONINFOEXW { 197 DWORD dwOSVersionInfoSize; 198 DWORD dwMajorVersion; 199 DWORD dwMinorVersion; 200 DWORD dwBuildNumber; 201 DWORD dwPlatformId; 202 WCHAR szCSDVersion[128]; 203 WORD wServicePackMajor; 204 WORD wServicePackMinor; 205 WORD wSuiteMask; 206 BYTE wProductType; 207 BYTE wReserved; 208} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW; 209 210#ifdef UNICODE 211typedef OSVERSIONINFOW OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO; 212typedef OSVERSIONINFOEXW OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX; 213#else 214typedef OSVERSIONINFOA OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO; 215typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX; 216#endif 217 218#endif // defined VER_NT_WORKSTATION 219 220#ifndef CP_SYMBOL 221 #define CP_SYMBOL 42 222#endif 223 224// NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added 225// with IE4, as was IPN_FIRST which is used as a test :-(. 226// 227#ifndef IPN_FIRST 228 229typedef struct wxtagNMLVCUSTOMDRAW_ { 230 NMCUSTOMDRAW nmcd; 231 COLORREF clrText; 232 COLORREF clrTextBk; 233 int iSubItem; 234} wxNMLVCUSTOMDRAW_, *wxLPNMLVCUSTOMDRAW_; 235 236#define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_ 237#define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_ 238 239#endif // defined IPN_FIRST 240 241#endif // defined __VISUALC__ && __VISUALC__ <= 1100 242 243// ---------------------------------------------------------------------------- 244// ListView common control 245// Needed by listctrl.cpp 246// ---------------------------------------------------------------------------- 247 248#ifndef LVS_EX_FULLROWSELECT 249 #define LVS_EX_FULLROWSELECT 0x00000020 250#endif 251 252#ifndef LVS_EX_LABELTIP 253 #define LVS_EX_LABELTIP 0x00004000 254#endif 255 256#ifndef LVS_EX_SUBITEMIMAGES 257 #define LVS_EX_SUBITEMIMAGES 0x00000002 258#endif 259 260#ifndef HDN_GETDISPINFOW 261 #define HDN_GETDISPINFOW (HDN_FIRST-29) 262#endif 263 264 /* 265 * In addition to the above, the following are required for several compilers. 266 */ 267 268#if !defined(CCS_VERT) 269#define CCS_VERT 0x00000080L 270#endif 271 272#if !defined(CCS_RIGHT) 273#define CCS_RIGHT (CCS_VERT|CCS_BOTTOM) 274#endif 275 276#if !defined(TB_SETDISABLEDIMAGELIST) 277 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54) 278#endif // !defined(TB_SETDISABLEDIMAGELIST) 279 280#ifndef CFM_BACKCOLOR 281 #define CFM_BACKCOLOR 0x04000000 282#endif 283 284#ifndef HANGUL_CHARSET 285 #define HANGUL_CHARSET 129 286#endif 287 288#ifndef CCM_SETUNICODEFORMAT 289 #define CCM_SETUNICODEFORMAT 8197 290#endif 291 292// ---------------------------------------------------------------------------- 293// Tree control 294// ---------------------------------------------------------------------------- 295 296#ifndef TV_FIRST 297 #define TV_FIRST 0x1100 298#endif 299 300#ifndef TVS_FULLROWSELECT 301 #define TVS_FULLROWSELECT 0x1000 302#endif 303 304#ifndef TVM_SETBKCOLOR 305 #define TVM_SETBKCOLOR (TV_FIRST + 29) 306 #define TVM_SETTEXTCOLOR (TV_FIRST + 30) 307#endif 308 309 /* 310 * The following are required for BC++ 5.5 (none at present.) 311 */ 312 313 /* 314 * The following are specifically required for Digital Mars C++ 315 */ 316 317#ifdef __DMC__ 318 319typedef struct _OSVERSIONINFOEX { 320 DWORD dwOSVersionInfoSize; 321 DWORD dwMajorVersion; 322 DWORD dwMinorVersion; 323 DWORD dwBuildNumber; 324 DWORD dwPlatformId; 325 TCHAR szCSDVersion[ 128 ]; 326 WORD wServicePackMajor; 327 WORD wServicePackMinor; 328 WORD wSuiteMask; 329 BYTE wProductType; 330 BYTE wReserved; 331} OSVERSIONINFOEX; 332 333#ifndef _TrackMouseEvent 334 #define _TrackMouseEvent TrackMouseEvent 335#endif 336 337#ifndef LVM_SETEXTENDEDLISTVIEWSTYLE 338 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54) 339#endif 340 341#ifndef LVM_GETSUBITEMRECT 342 #define LVM_GETSUBITEMRECT (0x1000 + 56) 343#endif 344 345#ifndef LVCF_IMAGE 346 #define LVCF_IMAGE 0x0010 347#endif 348 349#ifndef Header_GetItemRect 350 #define Header_GetItemRect(w,i,r) \ 351 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r)) 352#endif 353 354#ifndef HDM_GETITEMRECT 355 #define HDM_GETITEMRECT (HDM_FIRST+7) 356#endif 357 358#ifndef ListView_GetHeader 359 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0) 360#endif 361 362#ifndef ListView_GetSubItemRect 363 #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)) 364#endif 365 366#ifndef LVM_GETHEADER 367 #define LVM_GETHEADER (LVM_FIRST+31) 368#endif 369 370#ifndef LVSICF_NOSCROLL 371 #define LVSICF_NOINVALIDATEALL 0x0001 372 #define LVSICF_NOSCROLL 0x0002 373#endif 374 375#ifndef CP_SYMBOL 376 #define CP_SYMBOL 42 377#endif 378 379// ---------------------------------------------------------------------------- 380// wxDisplay 381// ---------------------------------------------------------------------------- 382 383// The windows headers with Digital Mars lack some typedefs. 384// typedef them as my_XXX and then #define to rename to XXX in case 385// a newer version of Digital Mars fixes the headers 386// (or up to date PSDK is in use with older version) 387// also we use any required definition (MONITOR_DEFAULTTONULL) to recognize 388// whether whole missing block needs to be included 389 390#ifndef MONITOR_DEFAULTTONULL 391 392 #define HMONITOR_DECLARED 393 DECLARE_HANDLE(HMONITOR); 394 typedef BOOL(CALLBACK* my_MONITORENUMPROC)(HMONITOR,HDC,LPRECT,LPARAM); 395 #define MONITORENUMPROC my_MONITORENUMPROC 396 typedef struct my_tagMONITORINFO { 397 DWORD cbSize; 398 RECT rcMonitor; 399 RECT rcWork; 400 DWORD dwFlags; 401 } my_MONITORINFO,*my_LPMONITORINFO; 402 #define MONITORINFO my_MONITORINFO 403 #define LPMONITORINFO my_LPMONITORINFO 404 405 typedef struct my_MONITORINFOEX : public my_tagMONITORINFO 406 { 407 TCHAR szDevice[CCHDEVICENAME]; 408 } my_MONITORINFOEX, *my_LPMONITORINFOEX; 409 #define MONITORINFOEX my_MONITORINFOEX 410 #define LPMONITORINFOEX my_LPMONITORINFOEX 411 412 #ifndef MONITOR_DEFAULTTONULL 413 #define MONITOR_DEFAULTTONULL 0 414 #endif // MONITOR_DEFAULTTONULL 415 416 #ifndef MONITORINFOF_PRIMARY 417 #define MONITORINFOF_PRIMARY 1 418 #endif // MONITORINFOF_PRIMARY 419 420 #ifndef DDENUM_ATTACHEDSECONDARYDEVICES 421 #define DDENUM_ATTACHEDSECONDARYDEVICES 1 422 #endif 423 424#endif // MONITOR_DEFAULTTONULL 425 426// ---------------------------------------------------------------------------- 427// Tree control 428// ---------------------------------------------------------------------------- 429 430#ifndef TVIS_FOCUSED 431 #define TVIS_FOCUSED 0x0001 432#endif 433 434#ifndef TVS_CHECKBOXES 435 #define TVS_CHECKBOXES 0x0100 436#endif 437 438#ifndef TVITEM 439 #define TVITEM TV_ITEM 440#endif 441 442#endif 443 // DMC++ 444 445 /* 446 * The following are specifically required for OpenWatcom C++ (none at present) 447 */ 448 449#if defined(__WATCOMC__) 450#endif 451 452 /* 453 * The following are specifically required for MinGW (none at present) 454 */ 455 456#if defined (__MINGW32__) 457 458#if !wxCHECK_W32API_VERSION(3,1) 459 460#include <windows.h> 461#include "wx/msw/winundef.h" 462 463typedef struct 464{ 465 RECT rgrc[3]; 466 WINDOWPOS *lppos; 467} NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS; 468 469#endif 470 471#endif 472 473 /* 474 * In addition to the declarations for VC++, the following are required for WinCE 475 */ 476 477#ifdef __WXWINCE__ 478 #include "wx/msw/wince/missing.h" 479#endif 480 481 /* 482 * The following are specifically required for Wine 483 */ 484 485#ifdef __WINE__ 486 #ifndef ENUM_CURRENT_SETTINGS 487 #define ENUM_CURRENT_SETTINGS ((DWORD)-1) 488 #endif 489 #ifndef BROADCAST_QUERY_DENY 490 #define BROADCAST_QUERY_DENY 1112363332 491 #endif 492#endif // defined __WINE__ 493 494#endif 495 // _WX_MISSING_H_ 496