1 /***********************************************************************\ 2 * w32api.d * 3 * * 4 * Windows API header module * 5 * * 6 * Translated from MinGW API for MS-Windows 4.0 * 7 * by Stewart Gordon * 8 * * 9 * Placed into public domain * 10 \***********************************************************************/ 11 module win32.w32api; 12 13 enum __W32API_VERSION = 3.17; 14 enum __W32API_MAJOR_VERSION = 3; 15 enum __W32API_MINOR_VERSION = 17; 16 17 /* These version identifiers are used to specify the minimum version of Windows that an 18 * application will support. 19 * 20 * Previously the minimum Windows 9x and Windows NT versions could be specified. However, since 21 * Windows 9x is no longer supported, either by Microsoft or by DMD, this distinction has been 22 * removed in order to simplify the bindings. 23 */ 24 version (Windows7) { 25 enum uint _WIN32_WINNT = 0x601; 26 } else version (WindowsVista) { 27 enum uint _WIN32_WINNT = 0x600; 28 } else version (Windows2003) { 29 enum uint _WIN32_WINNT = 0x502; 30 } else version (WindowsXP) { 31 enum uint _WIN32_WINNT = 0x501; 32 } else version (Windows2000) { 33 enum uint _WIN32_WINNT = 0x500; 34 } else { 35 enum uint _WIN32_WINNT = 0x501; 36 } 37 38 version (IE8) { 39 enum uint _WIN32_IE = 0x800; 40 } version (IE7) { 41 enum uint _WIN32_IE = 0x700; 42 } else version (IE602) { 43 enum uint _WIN32_IE = 0x603; 44 } else version (IE601) { 45 enum uint _WIN32_IE = 0x601; 46 } else version (IE6) { 47 enum uint _WIN32_IE = 0x600; 48 } else version (IE56) { 49 enum uint _WIN32_IE = 0x560; 50 } else version (IE501) { 51 enum uint _WIN32_IE = 0x501; 52 } else version (IE5) { 53 enum uint _WIN32_IE = 0x500; 54 } else version (IE401) { 55 enum uint _WIN32_IE = 0x401; 56 } else version (IE4) { 57 enum uint _WIN32_IE = 0x400; 58 } else version (IE3) { 59 enum uint _WIN32_IE = 0x300; 60 } else static if (_WIN32_WINNT >= 0x410) { 61 enum uint _WIN32_IE = 0x400; 62 } else { 63 enum uint _WIN32_IE = 0; 64 } 65 66 debug (WindowsUnitTest) { 67 unittest { 68 printf("Windows NT version: %03x\n", _WIN32_WINNT); 69 printf("IE version: %03x\n", _WIN32_IE); 70 } 71 } 72 73 version (Unicode) { 74 enum bool _WIN32_UNICODE = true; 75 package template DECLARE_AW(string name) { 76 mixin("alias " ~ name ~ "W " ~ name ~ ";"); 77 } 78 } else { 79 enum bool _WIN32_UNICODE = false; 80 package template DECLARE_AW(string name) { 81 mixin("alias " ~ name ~ "A " ~ name ~ ";"); 82 } 83 }