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 windows.w32api; 12 nothrow: 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 (Windows10) { 25 enum uint _WIN32_WINNT = 0xA00; 26 } else version (Windows8_1) { // also Windows2012R2 27 enum uint _WIN32_WINNT = 0x603; 28 } else version (Windows8) { // also Windows2012 29 enum uint _WIN32_WINNT = 0x602; 30 } else version (Windows7) { // also Windows2008R2 31 enum uint _WIN32_WINNT = 0x601; 32 } else version (WindowsVista) { // also Windows2008 33 enum uint _WIN32_WINNT = 0x600; 34 } else version (Windows2003) { // also WindowsHomeServer, WindowsXP64 35 enum uint _WIN32_WINNT = 0x502; 36 } else version (WindowsXP) { 37 enum uint _WIN32_WINNT = 0x501; 38 } else version (Windows2000) { 39 enum uint _WIN32_WINNT = 0x500; 40 } else { 41 enum uint _WIN32_WINNT = 0x501; 42 } 43 44 version (IE10) { 45 enum uint _WIN32_IE = 0xA00; 46 } else version (IE9) { 47 enum uint _WIN32_IE = 0x900; 48 } else version (IE8) { 49 enum uint _WIN32_IE = 0x800; 50 } else version (IE7) { 51 enum uint _WIN32_IE = 0x700; 52 } else version (IE602) { 53 enum uint _WIN32_IE = 0x603; 54 } else version (IE601) { 55 enum uint _WIN32_IE = 0x601; 56 } else version (IE6) { 57 enum uint _WIN32_IE = 0x600; 58 } else version (IE56) { 59 enum uint _WIN32_IE = 0x560; 60 } else version (IE501) { 61 enum uint _WIN32_IE = 0x501; 62 } else version (IE5) { 63 enum uint _WIN32_IE = 0x500; 64 } else version (IE401) { 65 enum uint _WIN32_IE = 0x401; 66 } else version (IE4) { 67 enum uint _WIN32_IE = 0x400; 68 } else version (IE3) { 69 enum uint _WIN32_IE = 0x300; 70 } else static if (_WIN32_WINNT >= 0x410) { 71 enum uint _WIN32_IE = 0x400; 72 } else { 73 enum uint _WIN32_IE = 0; 74 } 75 76 debug (WindowsUnitTest) { 77 unittest { 78 printf("Windows NT version: %03x\n", _WIN32_WINNT); 79 printf("IE version: %03x\n", _WIN32_IE); 80 } 81 } 82 83 version (Unicode) { 84 enum bool _WIN32_UNICODE = true; 85 package template DECLARE_AW(string name) { 86 mixin("alias " ~ name ~ "W " ~ name ~ ";"); 87 } 88 } else { 89 enum bool _WIN32_UNICODE = false; 90 package template DECLARE_AW(string name) { 91 mixin("alias " ~ name ~ "A " ~ name ~ ";"); 92 } 93 }