comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/win32/OS.d @ 0:6dd524f61e62

add dwt win and basic java stuff
author Frank Benoit <benoit@tionex.de>
date Mon, 02 Mar 2009 14:44:16 +0100
parents
children 2847134a5fc0
comparison
equal deleted inserted replaced
-1:000000000000 0:6dd524f61e62
1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/
13 module org.eclipse.swt.internal.win32.OS;
14
15 public import org.eclipse.swt.internal.win32.WINTYPES;
16 version(TANGOSVN){
17 private import org.eclipse.swt.internal.win32.WINAPI;
18 alias org.eclipse.swt.internal.win32.WINAPI DWTWINAPI;
19 private import tango.sys.win32.UserGdi;
20 alias tango.sys.win32.UserGdi WINAPI;
21 }
22 else{
23 private import org.eclipse.swt.internal.win32.WINAPI;
24 alias org.eclipse.swt.internal.win32.WINAPI WINAPI;
25 alias org.eclipse.swt.internal.win32.WINAPI DWTWINAPI;
26 }
27
28 import org.eclipse.swt.internal.C;
29 import org.eclipse.swt.internal.Library;
30 import java.lang.all;
31 import tango.sys.SharedLib : SharedLib;
32 import tango.sys.Common : SysError;
33 static import tango.stdc.stdlib;
34
35 import tango.stdc.string : memset, strlen;
36 import tango.stdc.stringz : toString16z;
37 import tango.text.convert.Utf : toString16;
38 //import tango.io.device.File;
39
40
41 import tango.io.Console;
42 void trace(int line ){
43 getDwtLogger.trace( "OS {}", line );
44 }
45
46 // declare of Callback functions
47 extern (Windows)
48 {
49 alias int function() Function0;
50 alias int function(void*) Function1;
51 alias int function(void*, int) Function2;
52 alias int function(void*, int, int) Function3;
53 alias int function(void*, int, int, int) Function4;
54 alias int function(void*, int, int, int, int) Function5;
55 alias int function(void*, int, int, int, int, int) Function6;
56 alias int function(void*, int, int, int, int, int, int) Function7;
57 alias int function(void*, int, int, int, int, int, int, int) Function8;
58 alias int function(void*, int, int, int, int, int, int, int, int) Function9;
59 }
60
61
62 /*
63 Compile time versions
64 ANSI
65 WinCE
66
67 OS.IsUnicode
68 OS.IsWinCE
69
70 OS.IsHPC
71
72 OS.IsSP
73 OS.IsPPC
74 OS.IsWin95
75 OS.IsWinNT
76
77 */
78
79 public class LDWTRESULT {
80 public int value;
81 // initalize ONE and ZERO in static OS.this();
82 public static LDWTRESULT ONE;
83 public static LDWTRESULT ZERO;
84 public this (int value) { this.value = value; }
85 }
86
87
88 public class OS : C {
89
90 struct Symbol {
91 char[] name;
92 void** symbol;
93 int major;
94 int minor;
95 }
96 static void loadLib( Symbol[] symbols, char[] libname ){
97 if (auto lib = SharedLib.load(libname)) {
98 foreach( inout s; symbols ){
99 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){
100 *s.symbol = lib.getSymbol( s.name.ptr );
101 if( s.symbol is null ){
102 getDwtLogger.error( "{}: Symbol '{}' not found", libname, s.name );
103 }
104 }
105 }
106 } else {
107 getDwtLogger.error( "Could not load the library {}", libname );
108 }
109 }
110
111 public static HINSTANCE GetLibraryHandle(){
112 //PORTING_FIXME: GetLibraryHandle
113 // is the hInstance of the DLL or null, if not a DLL.
114 // At the moment SWT is statically linked but this needs to be fixed
115 return null;
116 }
117
118 // macro from winnt.h
119 public static int PRIMARYLANGID( int lgid ){
120 return lgid & 0x3FF;
121 }
122
123 public static int LVITEM_sizeof(){
124 return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? LVITEM.sizeof : 40;
125 }
126 public static int MENUITEMINFO_sizeof(){
127 return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 0 )) ? MENUITEMINFO.sizeof : 44;
128 }
129 public static int NMLVCUSTOMDRAW_sizeof(){
130 return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? NMLVCUSTOMDRAW.sizeof : 60;
131 }
132 public static int NMLVDISPINFO_sizeof(){
133 return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? NMLVDISPINFO.sizeof : 52;
134 }
135 public static int OPENFILENAME_sizeof(){
136 return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 0 )) ? OPENFILENAME.sizeof : 76;
137 }
138 public static int TOOLINFO_sizeof(){
139 return ( !OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION( 5, 1 )) ? TOOLINFO.sizeof : 44;
140 }
141 // private static int getNOTIFYICONDATAA_V2_SIZE (){
142 // // hm, NOTIFYICONDATAA.dwInfoFlags.offsetof did not compile
143 // return IsWinCE ? NOTIFYICONDATAA.sizeof : cast(int)(&(cast(NOTIFYICONDATAA*)null).dwInfoFlags) + int.sizeof;
144 // }
145 //
146 // private static int getNOTIFYICONDATAW_V2_SIZE (){
147 // return IsWinCE ? NOTIFYICONDATAW.sizeof : cast(int)(&(cast(NOTIFYICONDATAW*)null).dwInfoFlags) + int.sizeof;
148 // }
149 // kernel32 winxp/vista
150 public static extern(Windows) {
151 HANDLE function( ACTCTX* pActCtx ) CreateActCtx;
152 BOOL function( HACTCTX hActCtx, uint* lpCookie ) ActivateActCtx;
153 LANGID function() GetSystemDefaultUILanguage;
154 BOOL function(
155 LANGUAGEGROUP_ENUMPROC pLangGroupEnumProc, // callback function
156 DWORD dwFlags, // language groups
157 LONG_PTR lParam // callback parameter
158 )EnumSystemLanguageGroupsA;
159 BOOL function(
160 LANGUAGEGROUP_ENUMPROC pLangGroupEnumProc, // callback function
161 DWORD dwFlags, // language groups
162 LONG_PTR lParam // callback parameter
163 )EnumSystemLanguageGroupsW;
164 BOOL function(
165 LOCALE_ENUMPROC lpLocaleEnumProc, // callback function
166 DWORD dwFlags // locales
167 )EnumSystemLocalesA;
168 BOOL function(
169 LOCALE_ENUMPROC lpLocaleEnumProc, // callback function
170 DWORD dwFlags // locales
171 )EnumSystemLocalesW;
172 }
173
174 /*
175 * SWT Windows flags
176 */
177 public static BOOL IsWin32s;
178 public static BOOL IsWin95;
179 public static BOOL IsWinNT;
180
181 version(WinCE) {
182 public const static BOOL IsWinCE = true;
183 public static const BOOL IsHPC = false; //todo
184 }
185 else {
186 public const static BOOL IsWinCE = false;
187 public static const BOOL IsHPC = false;
188 }
189
190 public static const BOOL IsPPC = false;
191
192 // PORTING_FIXME, is it Windows WFSP?
193 public static const BOOL IsSP = false;
194
195 public static const BOOL IsDBLocale;
196
197 version(ANSI) {
198 public const BOOL IsUnicode = false;
199 }else{
200 public const BOOL IsUnicode = true;
201 }
202
203 public static const int WIN32_MAJOR, WIN32_MINOR, WIN32_VERSION;
204 public static const int COMCTL32_MAJOR, COMCTL32_MINOR, COMCTL32_VERSION;
205 public static const int SHELL32_MAJOR, SHELL32_MINOR, SHELL32_VERSION;
206
207 public static const char[] NO_MANIFEST = "org.eclipse.swt.internal.win32.OS.NO_MANIFEST";
208
209
210 /*
211 * Flags for Window API GetVersionEx()
212 */
213 public static const int VER_PLATFORM_WIN32s = 0;
214 public static const int VER_PLATFORM_WIN32_WINDOWS = 1;
215 public static const int VER_PLATFORM_WIN32_NT = 2;
216 public static const int VER_PLATFORM_WIN32_CE = 3;
217
218 /* Forward references */
219 public static const int HEAP_ZERO_MEMORY = 0x8;
220 public static const int ACTCTX_FLAG_RESOURCE_NAME_VALID = 0x00000008;
221 public static const int ACTCTX_FLAG_SET_PROCESS_DEFAULT = 0x00000010;
222 public static const int ACTCTX_FLAG_APPLICATION_NAME_VALID = 0x00000020;
223 public static const int ACTCTX_FLAG_OVERRIDEMANIFEST_VALID = 0x00000100;
224 public static const TCHAR* MANIFEST_RESOURCE_ID = cast(TCHAR*)1;
225 public static const int SM_DBCSENABLED = 0x2A;
226 public static const int SM_IMMENABLED = 0x52;
227 public static const int LANG_KOREAN = 0x12;
228 public static const int MAX_PATH = 260;
229
230 // static this(){
231 // NOTIFYICONDATAA_V2_SIZE = getNOTIFYICONDATAA_V2_SIZE ();
232 // NOTIFYICONDATAW_V2_SIZE = getNOTIFYICONDATAW_V2_SIZE ();
233 // NOTIFYICONDATA_V2_SIZE = IsUnicode ? getNOTIFYICONDATAW_V2_SIZE : getNOTIFYICONDATAA_V2_SIZE;
234 // OSVERSIONINFO info;
235 // IsWin32s = (info.dwPlatformId is VER_PLATFORM_WIN32s);
236 // IsWin95 = (info.dwPlatformId is VER_PLATFORM_WIN32_WINDOWS);
237 // IsWinNT = (info.dwPlatformId is VER_PLATFORM_WIN32_NT);
238 // //IsSP_ = false;
239 // //IsPPC_ = false;
240 // //IsHPC = false;
241 // IsDBLocale = false;
242 // WIN32_MAJOR = info.dwMajorVersion;
243 // WIN32_MINOR = info.dwMinorVersion;
244 // WIN32_VERSION = VERSION (WIN32_MAJOR, WIN32_MINOR);
245 // //IsUnicode = !IsWin32s && !IsWin95;
246 // DLLVERSIONINFO dvi;
247 // COMCTL32_MAJOR = dvi.dwMajorVersion;
248 // COMCTL32_MINOR = dvi.dwMinorVersion;
249 // COMCTL32_VERSION = VERSION (COMCTL32_MAJOR, COMCTL32_MINOR);
250 // SHELL32_MAJOR = dvi.dwMajorVersion;
251 // SHELL32_MINOR = dvi.dwMinorVersion;
252 // SHELL32_VERSION = VERSION (SHELL32_MAJOR, SHELL32_MINOR);
253 // }
254
255 /* Get the Windows version and the flags */
256 public static this() {
257 LDWTRESULT.ONE = new LDWTRESULT(1);
258 LDWTRESULT.ZERO = new LDWTRESULT(0);
259 /*
260 * Try the UNICODE version of GetVersionEx first
261 * and then the ANSI version. The UNICODE version
262 * is present on all versions of Windows but is not
263 * implemented on Win95/98/ME.
264 *
265 * NOTE: The value of OSVERSIONINFO.sizeof cannot
266 * be static final because it relies on the Windows
267 * platform version to be initialized and IsUnicode
268 * has not been calculated. It must be initialized
269 * here, after the platform is determined in order
270 * for the value to be correct.
271 */
272 OSVERSIONINFO info;
273 info.dwOSVersionInfoSize = OSVERSIONINFO.sizeof;
274 if(!OS.GetVersionEx(&info)){
275 MessageBoxA(null,
276 _PCHAR!("SWT Unicode version applications can't run in a non-Unicode platform !"),
277 _PCHAR!("Error"),
278 MB_OK|MB_ICONERROR);
279 tango.stdc.stdlib.exit(-1);
280 }
281 //OSVERSIONINFO info = new OSVERSIONINFOW ();
282 //info.dwOSVersionInfoSize = OSVERSIONINFOW.sizeof;
283 //if (!OS.GetVersionExW ((OSVERSIONINFOW)info)) {
284 // info = new OSVERSIONINFOA ();
285 // info.dwOSVersionInfoSize = OSVERSIONINFOA.sizeof;
286 // OS.GetVersionExA ((OSVERSIONINFOA)info);
287 //}
288 //OSVERSIONINFO.sizeof = info.dwOSVersionInfoSize;
289
290 IsWin32s = (info.dwPlatformId is VER_PLATFORM_WIN32s);
291 IsWin95 = (info.dwPlatformId is VER_PLATFORM_WIN32_WINDOWS);
292 IsWinNT = (info.dwPlatformId is VER_PLATFORM_WIN32_NT);
293 //PORTING_CHANGE: made by version
294 //IsWinCE = (info.dwPlatformId is VER_PLATFORM_WIN32_CE);
295 //PORTING_CHANGE: made by version
296 //IsSP = IsSP();
297 //PORTING_CHANGE: made by version
298 //IsPPC = IsPPC();
299 version(WinCE) {
300 IsHPC = IsWinCE && !IsPPC && !IsSP;
301 }
302 WIN32_MAJOR = info.dwMajorVersion;
303 WIN32_MINOR = info.dwMinorVersion;
304 WIN32_VERSION = VERSION (WIN32_MAJOR, WIN32_MINOR);
305
306 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 0)) {
307 loadLib( Symbols_Kernel32, `Kernel32.dll` );
308 }
309
310 //PORTING_CHANGE: made by version
311 //IsUnicode = !IsWin32s && !IsWin95;
312
313 /* Load the manifest to force the XP Theme */
314 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 1)) {
315 //enableVisualStyles();
316 }
317
318 // when to load uxtheme
319 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 1)) {
320 loadLib( Symbols_UxTheme, `UxTheme.dll` );
321 }
322 if (OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 1)) {
323 loadLib( Symbols_CoreImm, `Coreimm.dll` );
324 }
325 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 0)) {
326 loadLib( Symbols_User32, `User32.dll` );
327 }
328 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (4, 0)) {
329 loadLib( Symbols_Imm32, `Imm32.dll` );
330 }
331
332 /* Make the process DPI aware for Windows Vista */
333 if (OS.WIN32_VERSION >= OS.VERSION (6, 0)) OS.SetProcessDPIAware ();
334
335 /* Get the DBCS flag */
336 BOOL dbcsEnabled = OS.GetSystemMetrics (SM_DBCSENABLED) !is 0;
337 BOOL immEnabled = OS.GetSystemMetrics (SM_IMMENABLED) !is 0;
338 IsDBLocale = dbcsEnabled || immEnabled;
339
340 /*
341 * Bug in Windows. On Korean Windows XP when the Text
342 * Services Framework support for legacy applications
343 * is enabled, certain legacy calls segment fault.
344 * For example, when ImmSetCompositionWindow() is used
345 * to move the composition window outside of the client
346 * area, Windows crashes. The fix is to disable legacy
347 * support.
348 *
349 * Note: The bug is fixed in Service Pack 2.
350 */
351 if (!OS.IsWinCE && OS.WIN32_VERSION is OS.VERSION (5, 1)) {
352 short langID = OS.GetSystemDefaultUILanguage ();
353 short primaryLang = OS.PRIMARYLANGID (langID);
354 if (primaryLang is LANG_KOREAN) {
355 OSVERSIONINFOEX infoex;
356 infoex.dwOSVersionInfoSize = OSVERSIONINFOEX.sizeof;
357 GetVersionEx (cast(OSVERSIONINFO*) &infoex );
358 if (infoex.wServicePackMajor < 2) {
359 OS.ImmDisableTextFrameService (0);
360 }
361 }
362 }
363
364 /* Get the COMCTL32.DLL version */
365 DLLVERSIONINFO dvi;
366 dvi.cbSize = DLLVERSIONINFO.sizeof;
367 dvi.dwMajorVersion = 4;
368 dvi.dwMinorVersion = 0;
369 //PORTING_CHANGE: comctl is loaded automatically
370 //TCHAR lpLibFileName = new TCHAR (0, "comctl32.dll", true); //$NON-NLS-1$
371 //int /*long*/ hModule = OS.LoadLibrary (lpLibFileName);
372 if (auto lib = SharedLib.load( `comctl32.dll`) ) {
373 char[] name = "DllGetVersion\0"; //$NON-NLS-1$
374 void* DllGetVersion = lib.getSymbol(name.ptr);
375 if (DllGetVersion !is null){
376 alias extern(Windows) void function(DLLVERSIONINFO*) TDllVersion;
377 TDllVersion f = cast( TDllVersion )DllGetVersion;
378 f(&dvi);
379 }
380 lib.unload();
381 }
382 COMCTL32_MAJOR = dvi.dwMajorVersion;
383 COMCTL32_MINOR = dvi.dwMinorVersion;
384 COMCTL32_VERSION = VERSION (COMCTL32_MAJOR, COMCTL32_MINOR);
385
386 /* Get the Shell32.DLL version */
387 dvi = DLLVERSIONINFO.init;
388 dvi.cbSize = DLLVERSIONINFO.sizeof;
389 dvi.dwMajorVersion = 4;
390 //TCHAR lpLibFileName = new TCHAR (0, "Shell32.dll", true); //$NON-NLS-1$
391 //int /*long*/ hModule = OS.LoadLibrary (lpLibFileName);
392 if ( auto lib = SharedLib.load( `Shell32.dll`)) {
393 char[] name = "DllGetVersion\0"; //$NON-NLS-1$
394 void* DllGetVersion = lib.getSymbol(name.ptr);
395 if (DllGetVersion !is null){
396 alias extern(Windows) void function(DLLVERSIONINFO*) TDllVersion;
397 TDllVersion f = cast( TDllVersion )DllGetVersion;
398 f(&dvi);
399 }
400 lib.unload();
401 }
402 SHELL32_MAJOR = dvi.dwMajorVersion;
403 SHELL32_MINOR = dvi.dwMinorVersion;
404 SHELL32_VERSION = VERSION (SHELL32_MAJOR, SHELL32_MINOR);
405 }
406
407 /**************************************************************************
408
409 **************************************************************************/
410
411 public static void enableVisualStyles() {
412 void printError( char[] msg ){
413 char[] winMsg = SysError.lastMsg();
414 char[2000] buf;
415 getDwtLogger.error("{}: {}", msg, CodePage.from( winMsg, buf ) );
416 }
417 TCHAR[] buffer = new TCHAR[ MAX_PATH ];
418 buffer[] = 0;
419 HANDLE hModule = OS.GetLibraryHandle ();
420 while (OS.GetModuleFileName (hModule, buffer.ptr, buffer.length ) is buffer.length ) {
421 buffer.length = buffer.length + MAX_PATH;
422 buffer[] = 0;
423 }
424 auto hHeap = OS.GetProcessHeap ();
425 int byteCount = buffer.length * TCHAR.sizeof;
426 TCHAR* pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, HEAP_ZERO_MEMORY, byteCount);
427 OS.MoveMemory (pszText, buffer.ptr, byteCount);
428
429 ACTCTX pActCtx;
430 pActCtx.cbSize = ACTCTX.sizeof;
431 pActCtx.dwFlags = 0
432 | ACTCTX_FLAG_RESOURCE_NAME_VALID
433 | ACTCTX_FLAG_SET_PROCESS_DEFAULT
434 ;
435 pActCtx.lpSource = pszText;
436 pActCtx.lpApplicationName = pszText;
437 pActCtx.lpResourceName = MANIFEST_RESOURCE_ID;
438 HANDLE hActCtx = OS.CreateActCtx (&pActCtx);
439 if (hActCtx is INVALID_HANDLE_VALUE){
440 printError("CreateActCtx failed, hence theme support will not be available\n"
441 "Please check for:\n"
442 " - missing link option -L/su:windows:5 or -L/su:console:5\n"
443 " - missing link option -L/rc:org.eclipse.swt\n"
444 " - resource file 'org.eclipse.swt.res' was not accessible by linker\n"
445 );
446 }
447 else{
448 ULONG_PTR ulpActivationCookie;
449 if (!OS.ActivateActCtx(hActCtx, &ulpActivationCookie)){
450 printError("ActivateActCtx failed" );
451 }
452 }
453
454 if (pszText !is null){
455 OS.HeapFree (hHeap, 0, pszText);
456 }
457
458 /*
459 * NOTE: A single activation context is created and activated
460 * for the entire lifetime of the program. It is deactivated
461 * and released by Windows when the program exits.
462 */
463 }
464
465 /**************************************************************************
466
467 **************************************************************************/
468
469 /* Flag used on WinCE */
470
471 static const int SYS_COLOR_INDEX_FLAG = OS.IsWinCE ? 0x40000000 : 0x0;
472
473 /*
474 * NOTE: There is a bug in JVM 1.2 where loading
475 * a class with a large number of constants causes
476 * a segment fault to occur sometime later after
477 * the class is loaded. The fix is to break the
478 * class up into a hierarchy of classes that each
479 * contain a smaller number of constants. This
480 * fix is not necessary at this time but is required
481 * when all constants are uncommented. We have not
482 * done the research to determine the limit.
483 */
484
485 /* Constants */
486 public static const int ABS_DOWNDISABLED = 8;
487 public static const int ABS_DOWNHOT = 6;
488 public static const int ABS_DOWNNORMAL = 5;
489 public static const int ABS_DOWNPRESSED = 7;
490 public static const int ABS_LEFTDISABLED = 12;
491 public static const int ABS_LEFTHOT = 10;
492 public static const int ABS_LEFTNORMAL = 9;
493 public static const int ABS_LEFTPRESSED = 11;
494 public static const int ABS_RIGHTDISABLED = 16;
495 public static const int ABS_RIGHTHOT = 14;
496 public static const int ABS_RIGHTNORMAL = 13;
497 public static const int ABS_RIGHTPRESSED = 15;
498 public static const int ABS_UPDISABLED = 4;
499 public static const int ABS_UPHOT = 2;
500 public static const int ABS_UPNORMAL = 1;
501 public static const int ABS_UPPRESSED = 3;
502 public static const int AC_SRC_OVER = 0;
503 public static const int AC_SRC_ALPHA = 1;
504 // public static const int ACTCTX_FLAG_RESOURCE_NAME_VALID = 0x00000008;
505 // public static const int ACTCTX_FLAG_SET_PROCESS_DEFAULT = 0x00000010;
506 public static const int ALTERNATE = 1;
507 public static const int ASSOCF_NOTRUNCATE = 0x00000020;
508 public static const int ASSOCF_INIT_IGNOREUNKNOWN = 0x400;
509 public static const int ASSOCSTR_COMMAND = 1;
510 public static const int ASSOCSTR_DEFAULTICON = 15;
511 public static const int ASSOCSTR_FRIENDLYAPPNAME = 4;
512 public static const int ASSOCSTR_FRIENDLYDOCNAME = 3;
513 public static const int AW_SLIDE = 0x00040000;
514 public static const int AW_ACTIVATE = 0x00020000;
515 public static const int AW_BLEND = 0x00080000;
516 public static const int AW_HIDE = 0x00010000;
517 public static const int AW_CENTER = 0x00000010;
518 public static const int AW_HOR_POSITIVE = 0x00000001;
519 public static const int AW_HOR_NEGATIVE = 0x00000002;
520 public static const int AW_VER_POSITIVE = 0x00000004;
521 public static const int AW_VER_NEGATIVE = 0x00000008;
522 public static const int ATTR_INPUT = 0x00;
523 public static const int ATTR_TARGET_CONVERTED = 0x01;
524 public static const int ATTR_CONVERTED = 0x02;
525 public static const int ATTR_TARGET_NOTCONVERTED = 0x03;
526 public static const int ATTR_INPUT_ERROR = 0x04;
527 public static const int ATTR_FIXEDCONVERTED = 0x05;
528 public static const int BCM_FIRST = 0x1600;
529 public static const int BCM_GETIDEALSIZE = BCM_FIRST + 0x1;
530 public static const int BCM_GETIMAGELIST = BCM_FIRST + 0x3;
531 public static const int BCM_GETNOTE = BCM_FIRST + 0xa;
532 public static const int BCM_GETNOTELENGTH = BCM_FIRST + 0xb;
533 public static const int BCM_SETIMAGELIST = BCM_FIRST + 0x2;
534 public static const int BCM_SETNOTE = BCM_FIRST + 0x9;
535 public static const int BDR_RAISEDOUTER = 0x0001;
536 public static const int BDR_SUNKENOUTER = 0x0002;
537 public static const int BDR_RAISEDINNER = 0x0004;
538 public static const int BDR_SUNKENINNER = 0x0008;
539 public static const int BDR_OUTER = 0x0003;
540 public static const int BDR_INNER = 0x000c;
541 public static const int BDR_RAISED = 0x0005;
542 public static const int BDR_SUNKEN = 0x000a;
543 public static const int BFFM_INITIALIZED = 0x1;
544 public static const int BFFM_SETSELECTION = IsUnicode ? 0x467 : 0x466;
545 public static const int BFFM_VALIDATEFAILED = IsUnicode ? 0x4 : 0x3;
546 public static const int BFFM_VALIDATEFAILEDW = 0x4;
547 public static const int BFFM_VALIDATEFAILEDA = 0x3;
548 public static const int BF_ADJUST = 0x2000;
549 public static const int BF_LEFT = 0x0001;
550 public static const int BF_TOP = 0x0002;
551 public static const int BF_RIGHT = 0x0004;
552 public static const int BF_BOTTOM = 0x0008;
553 public static const int BF_RECT = (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM);
554 public static const int BIF_EDITBOX = 0x10;
555 public static const int BIF_NEWDIALOGSTYLE = 0x40;
556 public static const int BIF_RETURNONLYFSDIRS = 0x1;
557 public static const int BIF_VALIDATE = 0x20;
558 public static const int BITSPIXEL = 0xc;
559 public static const int BI_BITFIELDS = 3;
560 public static const int BI_RGB = 0;
561 public static const int BLACKNESS = 0x42;
562 public static const int BLACK_BRUSH = 4;
563 public static const int BUTTON_IMAGELIST_ALIGN_LEFT = 0;
564 public static const int BUTTON_IMAGELIST_ALIGN_RIGHT = 1;
565 public static const int BUTTON_IMAGELIST_ALIGN_CENTER = 4;
566 public static const int BM_CLICK = 0xf5;
567 public static const int BM_GETCHECK = 0xf0;
568 public static const int BM_SETCHECK = 0xf1;
569 public static const int BM_SETIMAGE = 0xf7;
570 public static const int BM_SETSTYLE = 0xf4;
571 public static const int BN_CLICKED = 0x0;
572 public static const int BN_DOUBLECLICKED = 0x5;
573 public static const int BPBF_COMPATIBLEBITMAP = 0;
574 public static const int BPBF_DIB = 1;
575 public static const int BPBF_TOPDOWNDIB = 2;
576 public static const int BPBF_TOPDOWNMONODIB = 3;
577 public static const int BPPF_ERASE = 0x0001;
578 public static const int BPPF_NOCLIP = 0x0002;
579 public static const int BPPF_NONCLIENT = 0x0004;
580 public static const int BP_PUSHBUTTON = 1;
581 public static const int BP_RADIOBUTTON = 2;
582 public static const int BP_CHECKBOX = 3;
583 public static const int BP_GROUPBOX = 4;
584 public static const int BST_CHECKED = 0x1;
585 public static const int BST_INDETERMINATE = 0x2;
586 public static const int BST_UNCHECKED = 0x0;
587 public static const int BS_3STATE = 0x5;
588 public static const int BS_BITMAP = 0x80;
589 public static const int BS_CENTER = 0x300;
590 public static const int BS_CHECKBOX = 0x2;
591 public static const int BS_COMMANDLINK = 0xe;
592 public static const int BS_DEFPUSHBUTTON = 0x1;
593 public static const int BS_FLAT = 0x8000;
594 public static const int BS_GROUPBOX = 0x7;
595 public static const int BS_ICON = 0x40;
596 public static const int BS_LEFT = 0x100;
597 public static const int BS_NOTIFY = 0x4000;
598 public static const int BS_OWNERDRAW = 0xb;
599 public static const int BS_PATTERN = 0x3;
600 public static const int BS_PUSHBUTTON = 0x0;
601 public static const int BS_PUSHLIKE = 0x1000;
602 public static const int BS_RADIOBUTTON = 0x4;
603 public static const int BS_RIGHT = 0x200;
604 public static const int BS_SOLID = 0x0;
605 public static const int BTNS_AUTOSIZE = 0x10;
606 public static const int BTNS_BUTTON = 0x0;
607 public static const int BTNS_CHECK = 0x2;
608 public static const int BTNS_CHECKGROUP = 0x6;
609 public static const int BTNS_DROPDOWN = 0x8;
610 public static const int BTNS_GROUP = 0x4;
611 public static const int BTNS_SEP = 0x1;
612 public static const int BTNS_SHOWTEXT = 0x40;
613 public static const int CBN_EDITCHANGE = 0x5;
614 public static const int CBN_KILLFOCUS = 0x4;
615 public static const int CBN_SELCHANGE = 0x1;
616 public static const int CBN_SETFOCUS = 0x3;
617 public static const int CBS_AUTOHSCROLL = 0x40;
618 public static const int CBS_DROPDOWN = 0x2;
619 public static const int CBS_DROPDOWNLIST = 0x3;
620 public static const int CBS_CHECKEDNORMAL = 5;
621 public static const int CBS_MIXEDNORMAL = 9;
622 public static const int CBS_NOINTEGRALHEIGHT = 0x400;
623 public static const int CBS_SIMPLE = 0x1;
624 public static const int CBS_UNCHECKEDNORMAL = 1;
625 public static const int CBS_CHECKEDDISABLED = 8;
626 public static const int CBS_CHECKEDHOT = 6;
627 public static const int CBS_CHECKEDPRESSED = 7;
628 public static const int CBS_MIXEDDISABLED = 0;
629 public static const int CBS_MIXEDHOT = 0;
630 public static const int CBS_MIXEDPRESSED = 0;
631 public static const int CBS_UNCHECKEDDISABLED = 4;
632 public static const int CBS_UNCHECKEDHOT = 2;
633 public static const int CBS_UNCHECKEDPRESSED = 3;
634 public static const int CB_ADDSTRING = 0x143;
635 public static const int CB_DELETESTRING = 0x144;
636 public static const int CB_ERR = 0xffffffff;
637 public static const int CB_ERRSPACE = 0xfffffffe;
638 public static const int CB_FINDSTRINGEXACT = 0x158;
639 public static const int CB_GETCOUNT = 0x146;
640 public static const int CB_GETCURSEL = 0x147;
641 public static const int CB_GETDROPPEDCONTROLRECT = 0x152;
642 public static const int CB_GETDROPPEDSTATE = 0x157;
643 public static const int CB_GETDROPPEDWIDTH = 0x015f;
644 public static const int CB_GETEDITSEL = 0x140;
645 public static const int CB_GETHORIZONTALEXTENT = 0x015d;
646 public static const int CB_GETITEMHEIGHT = 0x154;
647 public static const int CB_GETLBTEXT = 0x148;
648 public static const int CB_GETLBTEXTLEN = 0x149;
649 public static const int CB_INSERTSTRING = 0x14a;
650 public static const int CB_LIMITTEXT = 0x141;
651 public static const int CB_RESETCONTENT = 0x14b;
652 public static const int CB_SELECTSTRING = 0x14d;
653 public static const int CB_SETCURSEL = 0x14e;
654 public static const int CB_SETDROPPEDWIDTH= 0x0160;
655 public static const int CB_SETEDITSEL = 0x142;
656 public static const int CB_SETHORIZONTALEXTENT = 0x015e;
657 public static const int CB_SETITEMHEIGHT = 0x0153;
658 public static const int CB_SHOWDROPDOWN = 0x14f;
659 public static const int CBXS_NORMAL = 1;
660 public static const int CBXS_HOT = 2;
661 public static const int CBXS_PRESSED = 3;
662 public static const int CBXS_DISABLED = 4;
663 public static const int CCHILDREN_SCROLLBAR = 5;
664 public static const int CCM_FIRST = 0x2000;
665 public static const int CCM_SETBKCOLOR = 0x2001;
666 public static const int CCM_SETVERSION = 0x2007;
667 public static const int CCS_NODIVIDER = 0x40;
668 public static const int CCS_NORESIZE = 0x4;
669 public static const int CCS_VERT = 0x80;
670 public static const int CC_ANYCOLOR = 0x100;
671 public static const int CC_ENABLEHOOK = 0x10;
672 public static const int CC_FULLOPEN = 0x2;
673 public static const int CC_RGBINIT = 0x1;
674 public static const int CDDS_POSTERASE = 0x00000004;
675 public static const int CDDS_POSTPAINT = 0x00000002;
676 public static const int CDDS_PREERASE = 0x00000003;
677 public static const int CDDS_PREPAINT = 0x00000001;
678 public static const int CDDS_ITEM = 0x00010000;
679 public static const int CDDS_ITEMPOSTPAINT = CDDS_ITEM | CDDS_POSTPAINT;
680 public static const int CDDS_ITEMPREPAINT = CDDS_ITEM | CDDS_PREPAINT;
681 public static const int CDDS_SUBITEM = 0x00020000;
682 public static const int CDDS_SUBITEMPOSTPAINT = CDDS_ITEMPOSTPAINT | CDDS_SUBITEM;
683 public static const int CDDS_SUBITEMPREPAINT = CDDS_ITEMPREPAINT | CDDS_SUBITEM;
684 public static const int CDIS_SELECTED = 0x0001;
685 public static const int CDIS_GRAYED = 0x0002;
686 public static const int CDIS_DISABLED = 0x0004;
687 public static const int CDIS_CHECKED = 0x0008;
688 public static const int CDIS_FOCUS = 0x0010;
689 public static const int CDIS_DEFAULT = 0x0020;
690 public static const int CDIS_HOT = 0x0040;
691 public static const int CDIS_MARKED = 0x0080;
692 public static const int CDIS_INDETERMINATE = 0x0100;
693 public static const int CDM_FIRST = 0x0400 + 100;
694 public static const int CDM_GETSPEC = CDM_FIRST;
695 public static const int CDN_FIRST = -601;
696 public static const int CDN_SELCHANGE = CDN_FIRST - 1;
697 public static const int CDRF_DODEFAULT = 0x00000000;
698 public static const int CDRF_DOERASE = 0x00000008;
699 public static const int CDRF_NEWFONT = 0x00000002;
700 public static const int CDRF_NOTIFYITEMDRAW = 0x00000020;
701 public static const int CDRF_NOTIFYPOSTERASE = 0x00000040;
702 public static const int CDRF_NOTIFYPOSTPAINT = 0x00000010;
703 public static const int CDRF_NOTIFYSUBITEMDRAW = 0x00000020;
704 public static const int CDRF_SKIPDEFAULT = 0x04;
705 public static const int CDRF_SKIPPOSTPAINT = 0x00000100;
706 public static const int CFE_AUTOCOLOR = 0x40000000;
707 public static const int CFE_ITALIC = 0x2;
708 public static const int CFE_STRIKEOUT = 0x8;
709 public static const int CFE_UNDERLINE = 0x4;
710 public static const int CFM_BOLD = 0x1;
711 public static const int CFM_CHARSET = 0x8000000;
712 public static const int CFM_COLOR = 0x40000000;
713 public static const int CFM_FACE = 0x20000000;
714 public static const int CFM_ITALIC = 0x2;
715 public static const int CFM_SIZE = 0x80000000;
716 public static const int CFM_STRIKEOUT = 0x8;
717 public static const int CFM_UNDERLINE = 0x4;
718 public static const int CFM_WEIGHT = 0x400000;
719 public static const int CFS_POINT = 0x2;
720 public static const int CFS_RECT = 0x1;
721 public static const int CFS_CANDIDATEPOS = 0x0040;
722 public static const int CFS_EXCLUDE = 0x0080;
723 public static const int CF_EFFECTS = 0x100;
724 public static const int CF_INITTOLOGFONTSTRUCT = 0x40;
725 public static const int CF_SCREENFONTS = 0x1;
726 public static const int CF_TEXT = 0x1;
727 public static const int CF_UNICODETEXT = 13;
728 public static const int CF_USESTYLE = 0x80;
729 public static const int CLR_DEFAULT = 0xff000000;
730 public static const int CLR_INVALID = 0xffffffff;
731 public static const int CLR_NONE = 0xffffffff;
732 public static const int CLSCTX_INPROC_SERVER = 1;
733 public static const int COLORONCOLOR = 0x3;
734 public static const int COLOR_3DDKSHADOW = 0x15 | SYS_COLOR_INDEX_FLAG;
735 public static const int COLOR_3DFACE = 0xf | SYS_COLOR_INDEX_FLAG;
736 public static const int COLOR_3DHIGHLIGHT = 0x14 | SYS_COLOR_INDEX_FLAG;
737 public static const int COLOR_3DHILIGHT = 0x14 | SYS_COLOR_INDEX_FLAG;
738 public static const int COLOR_3DLIGHT = 0x16 | SYS_COLOR_INDEX_FLAG;
739 public static const int COLOR_3DSHADOW = 0x10 | SYS_COLOR_INDEX_FLAG;
740 public static const int COLOR_ACTIVECAPTION = 0x2 | SYS_COLOR_INDEX_FLAG;
741 public static const int COLOR_BTNFACE = 0xf | SYS_COLOR_INDEX_FLAG;
742 public static const int COLOR_BTNHIGHLIGHT = 0x14 | SYS_COLOR_INDEX_FLAG;
743 public static const int COLOR_BTNSHADOW = 0x10 | SYS_COLOR_INDEX_FLAG;
744 public static const int COLOR_BTNTEXT = 0x12 | SYS_COLOR_INDEX_FLAG;
745 public static const int COLOR_CAPTIONTEXT = 0x9 | SYS_COLOR_INDEX_FLAG;
746 public static const int COLOR_GRADIENTACTIVECAPTION = 0x1b | SYS_COLOR_INDEX_FLAG;
747 public static const int COLOR_GRADIENTINACTIVECAPTION = 0x1c | SYS_COLOR_INDEX_FLAG;
748 public static const int COLOR_GRAYTEXT = 0x11 | SYS_COLOR_INDEX_FLAG;
749 public static const int COLOR_HIGHLIGHT = 0xd | SYS_COLOR_INDEX_FLAG;
750 public static const int COLOR_HIGHLIGHTTEXT = 0xe | SYS_COLOR_INDEX_FLAG;
751 public static const int COLOR_HOTLIGHT = 26 | SYS_COLOR_INDEX_FLAG;
752 public static const int COLOR_INACTIVECAPTION = 0x3 | SYS_COLOR_INDEX_FLAG;
753 public static const int COLOR_INACTIVECAPTIONTEXT = 0x13 | SYS_COLOR_INDEX_FLAG;
754 public static const int COLOR_INFOBK = 0x18 | SYS_COLOR_INDEX_FLAG;
755 public static const int COLOR_INFOTEXT = 0x17 | SYS_COLOR_INDEX_FLAG;
756 public static const int COLOR_MENU = 0x4 | SYS_COLOR_INDEX_FLAG;
757 public static const int COLOR_MENUTEXT = 0x7 | SYS_COLOR_INDEX_FLAG;
758 public static const int COLOR_SCROLLBAR = 0x0 | SYS_COLOR_INDEX_FLAG;
759 public static const int COLOR_WINDOW = 0x5 | SYS_COLOR_INDEX_FLAG;
760 public static const int COLOR_WINDOWFRAME = 0x6 | SYS_COLOR_INDEX_FLAG;
761 public static const int COLOR_WINDOWTEXT = 0x8 | SYS_COLOR_INDEX_FLAG;
762 public static const int COMPLEXREGION = 0x3;
763 public static const int CP_ACP = 0x0;
764 public static const int CP_UTF8 = 65001;
765 public static const int CP_DROPDOWNBUTTON = 1;
766 public static const int CP_INSTALLED = 0x1;
767 public static const int CPS_COMPLETE = 0x1;
768 public static const int CS_BYTEALIGNWINDOW = 0x2000;
769 public static const int CS_DBLCLKS = 0x8;
770 public static const int CS_DROPSHADOW = 0x20000;
771 public static const int CS_GLOBALCLASS = 0x4000;
772 public static const int CS_HREDRAW = 0x2;
773 public static const int CS_VREDRAW = 0x1;
774 public static const int CW_USEDEFAULT = 0x80000000;
775 public static const TCHAR[] DATETIMEPICK_CLASS = "SysDateTimePick32"; //$NON-NLS-1$
776 public static const int DATE_LONGDATE = 0x00000002;
777 public static const int DATE_SHORTDATE = 0x00000001;
778 public static const int DATE_YEARMONTH = 0x00000008; //#if(WINVER >= 0x0500)
779 public static const int DCX_CACHE = 0x2;
780 public static const int DCX_CLIPCHILDREN = 0x8;
781 public static const int DCX_CLIPSIBLINGS = 0x10;
782 public static const int DCX_INTERSECTRGN = 0x80;
783 public static const int DCX_WINDOW = 0x1;
784 public static const int DEFAULT_CHARSET = 0x1;
785 public static const int DEFAULT_GUI_FONT = 0x11;
786 public static const int DFCS_BUTTONCHECK = 0x0;
787 public static const int DFCS_CHECKED = 0x400;
788 public static const int DFCS_FLAT = 0x4000;
789 public static const int DFCS_INACTIVE = 0x100;
790 public static const int DFCS_PUSHED = 0x200;
791 public static const int DFCS_SCROLLDOWN = 0x1;
792 public static const int DFCS_SCROLLLEFT = 0x2;
793 public static const int DFCS_SCROLLRIGHT = 0x3;
794 public static const int DFCS_SCROLLUP = 0x0;
795 public static const int DFC_BUTTON = 0x4;
796 public static const int DFC_SCROLL = 0x3;
797 public static const int DIB_RGB_COLORS = 0x0;
798 public static const int DISP_E_EXCEPTION = 0x80020009;
799 public static const int DI_NORMAL = 0x3;
800 public static const int DI_NOMIRROR = 0x10;
801 public static const int DLGC_BUTTON = 0x2000;
802 public static const int DLGC_HASSETSEL = 0x8;
803 public static const int DLGC_STATIC = 0x100;
804 public static const int DLGC_WANTALLKEYS = 0x4;
805 public static const int DLGC_WANTARROWS = 0x1;
806 public static const int DLGC_WANTCHARS = 0x80;
807 public static const int DLGC_WANTTAB = 0x2;
808 public static const int DM_SETDEFID = 0x401;
809 public static const int DSS_DISABLED = 0x20;
810 public static const int DSTINVERT = 0x550009;
811 public static const int DST_BITMAP = 0x4;
812 public static const int DST_ICON = 0x3;
813 public static const int DT_BOTTOM = 0x8;
814 public static const int DT_CALCRECT = 0x400;
815 public static const int DT_CENTER = 0x1;
816 public static const int DT_EDITCONTROL = 0x2000;
817 public static const int DT_EXPANDTABS = 0x40;
818 public static const int DT_ENDELLIPSIS = 32768;
819 public static const int DT_HIDEPREFIX = 0x100000;
820 public static const int DT_LEFT = 0x0;
821 public static const int DT_NOPREFIX = 0x800;
822 public static const int DT_RASPRINTER = 0x2;
823 public static const int DT_RIGHT = 0x2;
824 public static const int DT_SINGLELINE = 0x20;
825 public static const int DT_TOP = 0;
826 public static const int DT_VCENTER = 4;
827 public static const int DT_WORDBREAK = 0x10;
828 public static const int DTM_FIRST = 0x1000;
829 public static const int DTM_GETSYSTEMTIME = DTM_FIRST + 1;
830 public static const int DTM_SETFORMAT = IsUnicode ? DTM_FIRST + 50 : DTM_FIRST + 5;
831 public static const int DTM_SETSYSTEMTIME = DTM_FIRST + 2;
832 public static const int DTN_FIRST = 0xFFFFFD08;
833 public static const int DTN_DATETIMECHANGE = DTN_FIRST + 1;
834 public static const int DTN_CLOSEUP = DTN_FIRST + 7;
835 public static const int DTN_DROPDOWN = DTN_FIRST + 6;
836 public static const int DTS_LONGDATEFORMAT = 0x0004;
837 public static const int DTS_SHORTDATECENTURYFORMAT = 0x000C;
838 public static const int DTS_SHORTDATEFORMAT = 0x0000;
839 public static const int DTS_TIMEFORMAT = 0x0009;
840 public static const int DTS_UPDOWN = 0x0001;
841 public static const int DWM_BB_ENABLE = 0x1;
842 public static const int DWM_BB_BLURREGION = 0x2;
843 public static const int DWM_BB_TRANSITIONONMAXIMIZED = 0x4;
844 public static const int E_POINTER = 0x80004003;
845 public static const int EBP_NORMALGROUPBACKGROUND = 5;
846 public static const int EBP_NORMALGROUPCOLLAPSE = 6;
847 public static const int EBP_NORMALGROUPEXPAND = 7;
848 public static const int EBP_NORMALGROUPHEAD = 8;
849 public static const int EBNGC_NORMAL = 1;
850 public static const int EBNGC_HOT = 2;
851 public static const int EBNGC_PRESSED = 3;
852 public static const int EBP_HEADERBACKGROUND = 1;
853 public static const int EC_LEFTMARGIN = 0x1;
854 public static const int EC_RIGHTMARGIN = 0x2;
855 public static const int ECOOP_AND = 0x3;
856 public static const int ECOOP_OR = 0x2;
857 public static const int ECO_AUTOHSCROLL = 0x80;
858 public static const int EDGE_RAISED = (BDR_RAISEDOUTER | BDR_RAISEDINNER);
859 public static const int EDGE_SUNKEN = (BDR_SUNKENOUTER | BDR_SUNKENINNER);
860 public static const int EDGE_ETCHED = (BDR_SUNKENOUTER | BDR_RAISEDINNER);
861 public static const int EDGE_BUMP = (BDR_RAISEDOUTER | BDR_SUNKENINNER);
862 public static const int ELF_VENDOR_SIZE = 4;
863 public static const int EM_CANUNDO = 0xc6;
864 public static const int EM_CHARFROMPOS = 0xd7;
865 public static const int EM_DISPLAYBAND = 0x433;
866 public static const int EM_GETFIRSTVISIBLELINE = 0xce;
867 public static const int EM_GETLIMITTEXT = 0xd5;
868 public static const int EM_GETLINE = 0xc4;
869 public static const int EM_GETLINECOUNT = 0xba;
870 public static const int EM_GETMARGINS = 0xd4;
871 public static const int EM_GETPASSWORDCHAR = 0xd2;
872 public static const int EM_GETSCROLLPOS = 0x4dd;
873 public static const int EM_GETSEL = 0xb0;
874 public static const int EM_LIMITTEXT = 0xc5;
875 public static const int EM_LINEFROMCHAR = 0xc9;
876 public static const int EM_LINEINDEX = 0xbb;
877 public static const int EM_LINELENGTH = 0xc1;
878 public static const int EM_LINESCROLL = 0xb6;
879 public static const int EM_POSFROMCHAR = 0xd6;
880 public static const int EM_REPLACESEL = 0xc2;
881 public static const int EM_SCROLLCARET = 0xb7;
882 public static const int EM_SETBKGNDCOLOR = 0x443;
883 public static const int EM_SETLIMITTEXT = 0xc5;
884 public static const int EM_SETMARGINS = 211;
885 public static const int EM_SETOPTIONS = 0x44d;
886 public static const int EM_SETPARAFORMAT = 0x447;
887 public static const int EM_SETPASSWORDCHAR = 0xcc;
888 public static const int EM_SETCUEBANNER = 0x1500 + 1;
889 public static const int EM_SETREADONLY = 0xcf;
890 public static const int EM_SETSEL = 0xb1;
891 public static const int EM_SETTABSTOPS = 0xcb;
892 public static const int EM_UNDO = 199;
893 public static const int EMR_EXTCREATEFONTINDIRECTW = 82;
894 public static const int EMR_EXTTEXTOUTW = 84;
895 public static const int EN_ALIGN_LTR_EC = 0x0700;
896 public static const int EN_ALIGN_RTL_EC = 0x0701;
897 public static const int EN_CHANGE = 0x300;
898 public static const int EP_EDITTEXT = 1;
899 public static const int ERROR_NO_MORE_ITEMS = 0x103;
900 public static const int ESB_DISABLE_BOTH = 0x3;
901 public static const int ESB_ENABLE_BOTH = 0x0;
902 public static const int ES_AUTOHSCROLL = 0x80;
903 public static const int ES_AUTOVSCROLL = 0x40;
904 public static const int ES_CENTER = 0x1;
905 public static const int ES_MULTILINE = 0x4;
906 public static const int ES_NOHIDESEL = 0x100;
907 public static const int ES_PASSWORD = 0x20;
908 public static const int ES_READONLY = 0x800;
909 public static const int ES_RIGHT = 0x2;
910 public static const int ETO_CLIPPED = 0x4;
911 public static const int ETS_NORMAL = 1;
912 public static const int ETS_HOT = 2;
913 public static const int ETS_SELECTED = 3;
914 public static const int ETS_DISABLED = 4;
915 public static const int ETS_FOCUSED = 5;
916 public static const int ETS_READONLY = 6;
917 public static const int EVENT_OBJECT_FOCUS = 0x8005;
918 public static const int EVENT_OBJECT_LOCATIONCHANGE = 0x800B;
919 // public static const int EVENT_OBJECT_SELECTION = 0x8006;
920 public static const int EVENT_OBJECT_SELECTIONWITHIN = 0x8009;
921 public static const int EVENT_OBJECT_VALUECHANGE = 0x800E;
922 public static const int FALT = 0x10;
923 public static const int FCONTROL = 0x8;
924 public static const int FE_FONTSMOOTHINGCLEARTYPE = 0x0002;
925 public static const int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21;
926 public static const int FILE_ATTRIBUTE_NORMAL = 0x00000080;
927 public static const int FNERR_INVALIDFILENAME = 0x3002;
928 public static const int FNERR_BUFFERTOOSMALL = 0x3003;
929 public static const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
930 public static const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
931 public static const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
932 public static const int FR_PRIVATE = 0x10;
933 public static const int FSHIFT = 0x4;
934 public static const int FVIRTKEY = 0x1;
935 public static const int GBS_NORMAL = 1;
936 public static const int GBS_DISABLED = 2;
937 public static const int GCS_COMPSTR = 0x8;
938 public static const int GCS_RESULTSTR = 0x800;
939 public static const int GCS_COMPATTR = 0x0010;
940 public static const int GCS_COMPCLAUSE = 0x0020;
941 public static const int GCS_CURSORPOS = 0x0080;
942 public static const int GDT_VALID = 0;
943 public static const int GET_FEATURE_FROM_PROCESS = 0x2;
944 public static const int GLPS_CLOSED = 1;
945 public static const int GLPS_OPENED = 2;
946 public static const int GM_ADVANCED = 2;
947 public static const int GMDI_USEDISABLED = 0x1;
948 public static const int GMEM_FIXED = 0x0;
949 public static const int GMEM_ZEROINIT = 0x40;
950 public static const int GN_CONTEXTMENU = 1000;
951 public static const int GPTR = 0x40;
952 public static const int GRADIENT_FILL_RECT_H = 0x0;
953 public static const int GRADIENT_FILL_RECT_V = 0x1;
954 public static const int GTL_NUMBYTES = 0x10;
955 public static const int GTL_NUMCHARS = 0x8;
956 public static const int GTL_PRECISE = 0x2;
957 public static const int GT_DEFAULT = 0x0;
958 public static const int GUI_16BITTASK = 0x20;
959 public static const int GUI_CARETBLINKING = 0x1;
960 public static const int GUI_INMENUMODE = 0x4;
961 public static const int GUI_INMOVESIZE = 0x2;
962 public static const int GUI_POPUPMENUMODE = 0x10;
963 public static const int GUI_SYSTEMMENUMODE = 0x8;
964 public static const int GWL_EXSTYLE = 0xffffffec;
965 public static const int GWL_ID = -12;
966 public static const int GWL_HWNDPARENT = -8;
967 public static const int GWL_STYLE = 0xfffffff0;
968 public static const int GWL_USERDATA = 0xffffffeb;
969 public static const int GWL_WNDPROC = 0xfffffffc;
970 public static const int GWLP_ID = -12;
971 public static const int GWLP_HWNDPARENT = -8;
972 public static const int GWLP_USERDATA = 0xffffffeb;
973 public static const int GWLP_WNDPROC = 0xfffffffc;
974 public static const int GW_CHILD = 0x5;
975 public static const int GW_HWNDFIRST = 0x0;
976 public static const int GW_HWNDLAST = 0x1;
977 public static const int GW_HWNDNEXT = 0x2;
978 public static const int GW_HWNDPREV = 0x3;
979 public static const int GW_OWNER = 0x4;
980 public static const HBITMAP HBMMENU_CALLBACK = cast(HBITMAP) 0xffffffff;
981 public static const int HCBT_CREATEWND = 3;
982 public static const int HCF_HIGHCONTRASTON = 0x1;
983 public static const int HDF_BITMAP = 0x2000;
984 public static const int HDF_BITMAP_ON_RIGHT = 0x1000;
985 public static const int HDF_CENTER = 2;
986 public static const int HDF_JUSTIFYMASK = 0x3;
987 public static const int HDF_IMAGE = 0x0800;
988 public static const int HDF_LEFT = 0;
989 public static const int HDF_RIGHT = 1;
990 public static const int HDF_SORTUP = 0x0400;
991 public static const int HDF_SORTDOWN = 0x0200;
992 public static const int HDI_BITMAP = 0x0010;
993 public static const int HDI_IMAGE = 32;
994 public static const int HDI_ORDER = 0x80;
995 public static const int HDI_TEXT = 0x2;
996 public static const int HDI_WIDTH = 0x1;
997 public static const int HDI_FORMAT = 0x4;
998 public static const int HDM_FIRST = 0x1200;
999 public static const int HDM_DELETEITEM = HDM_FIRST + 2;
1000 public static const int HDM_GETBITMAPMARGIN = HDM_FIRST + 21;
1001 public static const int HDM_GETITEMCOUNT = 0x1200;
1002 public static const int HDM_GETITEMA = HDM_FIRST + 3;
1003 public static const int HDM_GETITEMW = HDM_FIRST + 11;
1004 public static const int HDM_GETITEM = IsUnicode ? HDM_GETITEMW : HDM_GETITEMA;
1005 public static const int HDM_GETITEMRECT = HDM_FIRST + 7;
1006 public static const int HDM_GETORDERARRAY = HDM_FIRST + 17;
1007 public static const int HDM_HITTEST = HDM_FIRST + 6;
1008 public static const int HDM_INSERTITEMA = HDM_FIRST + 1;
1009 public static const int HDM_INSERTITEMW = HDM_FIRST + 10;
1010 public static const int HDM_INSERTITEM = IsUnicode ? HDM_INSERTITEMW : HDM_INSERTITEMA;
1011 public static const int HDM_LAYOUT = HDM_FIRST + 5;
1012 public static const int HDM_ORDERTOINDEX = HDM_FIRST + 15;
1013 public static const int HDM_SETIMAGELIST = HDM_FIRST + 8;
1014 public static const int HDM_SETITEMA = HDM_FIRST + 4;
1015 public static const int HDM_SETITEMW = HDM_FIRST + 12;
1016 public static const int HDM_SETITEM = IsUnicode ? HDM_SETITEMW : HDM_SETITEMA;
1017 public static const int HDM_SETORDERARRAY = HDM_FIRST + 18;
1018 public static const int HDN_FIRST = 0xfffffed4;
1019 public static const int HDN_BEGINDRAG = HDN_FIRST - 10;
1020 public static const int HDN_BEGINTRACK = IsUnicode ? 0xfffffeba : 0xfffffece;
1021 public static const int HDN_BEGINTRACKW = 0xfffffeba;
1022 public static const int HDN_BEGINTRACKA = 0xfffffece;
1023 public static const int HDN_DIVIDERDBLCLICKA = HDN_FIRST - 5;
1024 public static const int HDN_DIVIDERDBLCLICKW = HDN_FIRST - 25;
1025 public static const int HDN_DIVIDERDBLCLICK = IsUnicode ? HDN_DIVIDERDBLCLICKW : HDN_DIVIDERDBLCLICKA;
1026 public static const int HDN_ENDDRAG = HDN_FIRST - 11;
1027 public static const int HDN_ITEMCHANGED = IsUnicode ? 0xfffffebf : 0xfffffed3;
1028 public static const int HDN_ITEMCHANGEDW = 0xfffffebf;
1029 public static const int HDN_ITEMCHANGEDA = 0xfffffed3;
1030 public static const int HDN_ITEMCHANGINGW = HDN_FIRST - 20;
1031 public static const int HDN_ITEMCHANGINGA = HDN_FIRST;
1032 public static const int HDN_ITEMCLICKW = HDN_FIRST - 22;
1033 public static const int HDN_ITEMCLICKA = HDN_FIRST - 2;
1034 public static const int HDN_ITEMDBLCLICKW = HDN_FIRST - 23;
1035 public static const int HDN_ITEMDBLCLICKA = HDN_FIRST - 3;
1036 public static const int HDN_ITEMDBLCLICK = IsUnicode ? HDN_ITEMDBLCLICKW : HDN_ITEMDBLCLICKA;
1037 public static const int HDS_BUTTONS = 0x2;
1038 public static const int HDS_DRAGDROP = 0x0040;
1039 public static const int HDS_FULLDRAG = 0x80;
1040 public static const int HDS_HIDDEN = 0x8;
1041 // public static const int HEAP_ZERO_MEMORY = 0x8;
1042 public static const int HELPINFO_MENUITEM = 0x2;
1043 public static const int HHT_ONDIVIDER = 0x4;
1044 public static const int HHT_ONDIVOPEN = 0x8;
1045 public static const int HICF_ARROWKEYS = 0x2;
1046 public static const int HINST_COMMCTRL = 0xffffffff;
1047 public static const int HKEY_CLASSES_ROOT = 0x80000000;
1048 public static const int HKEY_CURRENT_USER = 0x80000001;
1049 public static const int HKEY_LOCAL_MACHINE = 0x80000002;
1050 public static const int HORZRES = 0x8;
1051 public static const int HTBORDER = 0x12;
1052 public static const int HTCAPTION = 0x2;
1053 public static const int HTCLIENT = 0x1;
1054 public static const int HTERROR = -2;
1055 public static const int HTHSCROLL = 0x6;
1056 public static const int HTMENU = 0x5;
1057 public static const int HTNOWHERE = 0x0;
1058 public static const int HTSYSMENU = 0x3;
1059 public static const int HTTRANSPARENT = 0xffffffff;
1060 public static const int HTVSCROLL = 0x7;
1061 public static const int HWND_BOTTOM = 0x1;
1062 public static const int HWND_TOP = 0x0;
1063 public static const int HWND_TOPMOST = 0xffffffff;
1064 public static const int HWND_NOTOPMOST = -2;
1065 public static const int ICC_COOL_CLASSES = 0x400;
1066 public static const int ICC_DATE_CLASSES = 0x100;
1067 public static const int ICM_NOTOPEN = 0x0;
1068 public static const int ICON_BIG = 0x1;
1069 public static const int ICON_SMALL = 0x0;
1070 public static const int I_IMAGECALLBACK = -1;
1071 public static const int I_IMAGENONE = -2;
1072 public static const int IDABORT = 0x3;
1073 public static const int IDANI_CAPTION = 3;
1074 public static const int IDB_STD_SMALL_COLOR = 0x0;
1075 public static const int IDC_APPSTARTING = 0x7f8a;
1076 public static const int IDC_ARROW = 0x7f00;
1077 public static const int IDC_CROSS = 0x7f03;
1078 public static const TCHAR* IDC_HAND = cast(TCHAR*) 0x7f89;
1079 public static const int IDC_HELP = 0x7f8b;
1080 public static const int IDC_IBEAM = 0x7f01;
1081 public static const int IDC_NO = 0x7f88;
1082 public static const int IDC_SIZE = 0x7f80;
1083 public static const int IDC_SIZEALL = 0x7f86;
1084 public static const int IDC_SIZENESW = 0x7f83;
1085 public static const int IDC_SIZENS = 0x7f85;
1086 public static const int IDC_SIZENWSE = 0x7f82;
1087 public static const int IDC_SIZEWE = 0x7f84;
1088 public static const int IDC_UPARROW = 0x7f04;
1089 public static const int IDC_WAIT = 0x7f02;
1090 public static const int IDI_APPLICATION = 32512;
1091 public static const int IDNO = 0x7;
1092 public static const int IDOK = 0x1;
1093 public static const int IDRETRY = 0x4;
1094 public static const int IDYES = 0x6;
1095 public static const int ILC_COLOR = 0x0;
1096 public static const int ILC_COLOR16 = 0x10;
1097 public static const int ILC_COLOR24 = 0x18;
1098 public static const int ILC_COLOR32 = 0x20;
1099 public static const int ILC_COLOR4 = 0x4;
1100 public static const int ILC_COLOR8 = 0x8;
1101 public static const int ILC_MASK = 0x1;
1102 public static const int ILC_MIRROR = 0x2000;
1103 public static const int ILD_NORMAL = 0x0;
1104 public static const int ILD_SELECTED = 0x4;
1105 public static const int IMAGE_BITMAP = 0x0;
1106 public static const int IMAGE_CURSOR = 0x2;
1107 public static const int IMAGE_ICON = 0x1;
1108 public static const int IME_CMODE_FULLSHAPE = 0x8;
1109 public static const int IME_CMODE_KATAKANA = 0x2;
1110 public static const int IME_CMODE_NATIVE = 0x1;
1111 public static const int IME_CMODE_ROMAN = 0x10;
1112 public static const int IMEMOUSE_LDOWN = 1;
1113 public static const int INFINITE = 0xffffffff;
1114 public static const int INPUT_KEYBOARD = 1;
1115 public static const int INPUT_MOUSE = 0;
1116 public static const int INTERNET_OPTION_END_BROWSER_SESSION = 42;
1117 public static const int KEY_ENUMERATE_SUB_KEYS = 0x8;
1118 public static const int KEY_NOTIFY = 0x10;
1119 public static const int KEY_QUERY_VALUE = 0x1;
1120 public static const int KEY_READ = 0x20019;
1121 public static const int KEYEVENTF_KEYUP = 0x0002;
1122 public static const int L_MAX_URL_LENGTH = 2084;
1123 // public static const int LANG_KOREAN = 0x12;
1124 public static const int LANG_NEUTRAL = 0x0;
1125 public static const int LANG_USER_DEFAULT = 1 << 10;
1126 public static const int LAYOUT_RTL = 0x1;
1127 public static const int LAYOUT_BITMAPORIENTATIONPRESERVED = 0x8;
1128 public static const int LBN_DBLCLK = 0x2;
1129 public static const int LBN_SELCHANGE = 0x1;
1130 public static const int LBS_EXTENDEDSEL = 0x800;
1131 public static const int LBS_MULTIPLESEL = 0x8;
1132 public static const int LBS_NOINTEGRALHEIGHT = 0x100;
1133 public static const int LBS_NOTIFY = 0x1;
1134 public static const int LB_ADDSTRING = 0x180;
1135 public static const int LB_DELETESTRING = 0x182;
1136 public static const int LB_ERR = 0xffffffff;
1137 public static const int LB_ERRSPACE = 0xfffffffe;
1138 public static const int LB_FINDSTRINGEXACT = 0x1a2;
1139 public static const int LB_GETCARETINDEX = 0x19f;
1140 public static const int LB_GETCOUNT = 0x18b;
1141 public static const int LB_GETCURSEL = 0x188;
1142 public static const int LB_GETHORIZONTALEXTENT = 0x193;
1143 public static const int LB_GETITEMHEIGHT = 0x1a1;
1144 public static const int LB_GETITEMRECT = 0x198;
1145 public static const int LB_GETSEL = 0x187;
1146 public static const int LB_GETSELCOUNT = 0x190;
1147 public static const int LB_GETSELITEMS = 0x191;
1148 public static const int LB_GETTEXT = 0x189;
1149 public static const int LB_GETTEXTLEN = 0x18a;
1150 public static const int LB_GETTOPINDEX = 0x18e;
1151 public static const int LB_INITSTORAGE = 0x1a8;
1152 public static const int LB_INSERTSTRING = 0x181;
1153 public static const int LB_RESETCONTENT = 0x184;
1154 public static const int LB_SELITEMRANGE = 0x19b;
1155 public static const int LB_SELITEMRANGEEX = 0x183;
1156 public static const int LB_SETANCHORINDEX = 0xf19c;
1157 public static const int LB_SETCARETINDEX = 0x19e;
1158 public static const int LB_SETCURSEL = 0x186;
1159 public static const int LB_SETHORIZONTALEXTENT = 0x194;
1160 public static const int LB_SETSEL = 0x185;
1161 public static const int LB_SETTOPINDEX = 0x197;
1162 public static const int LF_FULLFACESIZE = 64;
1163 public static const int LF_FACESIZE = 32;
1164 public static const int LGRPID_ARABIC = 0xd;
1165 public static const int LGRPID_HEBREW = 0xc;
1166 public static const int LGRPID_INSTALLED = 1;
1167 public static const int LIF_ITEMINDEX = 0x1;
1168 public static const int LIF_STATE = 0x2;
1169 public static const int LIS_FOCUSED = 0x1;
1170 public static const int LIS_ENABLED = 0x2;
1171 public static const int LISS_HOT = 0x2;
1172 public static const int LISS_SELECTED = 0x3;
1173 public static const int LISS_SELECTEDNOTFOCUS = 0x5;
1174 public static const int LM_GETIDEALHEIGHT = 0x701;
1175 public static const int LM_SETITEM = 0x702;
1176 public static const int LM_GETITEM = 0x703;
1177 public static const int LCID_SUPPORTED = 0x2;
1178 public static const int LOCALE_IDEFAULTANSICODEPAGE = 0x1004;
1179 public static const int LOCALE_IDATE = 0x00000021;
1180 public static const int LOCALE_ITIME = 0x00000023;
1181 public static const int LOCALE_RETURN_NUMBER = 0x20000000; // #if(WINVER >= 0x0400)
1182 public static const int LOCALE_S1159 = 0x00000028;
1183 public static const int LOCALE_S2359 = 0x00000029;
1184 public static const int LOCALE_SDECIMAL = 14;
1185 public static const int LOCALE_SISO3166CTRYNAME = 0x5a;
1186 public static const int LOCALE_SISO639LANGNAME = 0x59;
1187 public static const int LOCALE_SLONGDATE = 0x00000020;
1188 public static const int LOCALE_SSHORTDATE = 0x0000001F;
1189 public static const int LOCALE_STIMEFORMAT = 0x00001003;
1190 public static const int LOCALE_SYEARMONTH = 0x00001006; // #if(WINVER >= 0x0500)
1191 public static const int LOCALE_SDAYNAME1 = 0x0000002A; // long name for Monday
1192 public static const int LOCALE_SDAYNAME2 = 0x0000002B; // long name for Tuesday
1193 public static const int LOCALE_SDAYNAME3 = 0x0000002C; // long name for Wednesday
1194 public static const int LOCALE_SDAYNAME4 = 0x0000002D; // long name for Thursday
1195 public static const int LOCALE_SDAYNAME5 = 0x0000002E; // long name for Friday
1196 public static const int LOCALE_SDAYNAME6 = 0x0000002F; // long name for Saturday
1197 public static const int LOCALE_SDAYNAME7 = 0x00000030; // long name for Sunday
1198 public static const int LOCALE_SMONTHNAME1 = 0x00000038; // long name for January
1199 public static const int LOCALE_SMONTHNAME2 = 0x00000039; // long name for February
1200 public static const int LOCALE_SMONTHNAME3 = 0x0000003A; // long name for March
1201 public static const int LOCALE_SMONTHNAME4 = 0x0000003B; // long name for April
1202 public static const int LOCALE_SMONTHNAME5 = 0x0000003C; // long name for May
1203 public static const int LOCALE_SMONTHNAME6 = 0x0000003D; // long name for June
1204 public static const int LOCALE_SMONTHNAME7 = 0x0000003E; // long name for July
1205 public static const int LOCALE_SMONTHNAME8 = 0x0000003F; // long name for August
1206 public static const int LOCALE_SMONTHNAME9 = 0x00000040; // long name for September
1207 public static const int LOCALE_SMONTHNAME10 = 0x00000041; // long name for October
1208 public static const int LOCALE_SMONTHNAME11 = 0x00000042; // long name for November
1209 public static const int LOCALE_SMONTHNAME12 = 0x00000043; // long name for December
1210 public static const int LOCALE_USER_DEFAULT = 1024;
1211 public static const int LOGPIXELSX = 0x58;
1212 public static const int LOGPIXELSY = 0x5a;
1213 public static const TCHAR* LPSTR_TEXTCALLBACK = cast(TCHAR*)0xffffffff;
1214 public static const int LR_DEFAULTCOLOR = 0x0;
1215 public static const int LR_SHARED = 0x8000;
1216 public static const int LVCFMT_BITMAP_ON_RIGHT = 0x1000;
1217 public static const int LVCFMT_CENTER = 0x2;
1218 public static const int LVCFMT_IMAGE = 0x800;
1219 public static const int LVCFMT_LEFT = 0x0;
1220 public static const int LVCFMT_RIGHT = 0x1;
1221 public static const int LVCF_FMT = 0x1;
1222 public static const int LVCF_IMAGE = 0x10;
1223 public static const int LVCFMT_JUSTIFYMASK = 0x3;
1224 public static const int LVCF_TEXT = 0x4;
1225 public static const int LVCF_WIDTH = 0x2;
1226 public static const int LVHT_ONITEM = 0xe;
1227 public static const int LVHT_ONITEMICON = 0x2;
1228 public static const int LVHT_ONITEMLABEL = 0x4;
1229 public static const int LVHT_ONITEMSTATEICON = 0x8;
1230 public static const int LVIF_IMAGE = 0x2;
1231 public static const int LVIF_INDENT = 0x10;
1232 public static const int LVIF_STATE = 0x8;
1233 public static const int LVIF_TEXT = 0x1;
1234 public static const int LVIR_BOUNDS = 0x0;
1235 public static const int LVIR_ICON = 0x1;
1236 public static const int LVIR_LABEL = 0x2;
1237 public static const int LVIR_SELECTBOUNDS = 0x3;
1238 public static const int LVIS_DROPHILITED = 0x8;
1239 public static const int LVIS_FOCUSED = 0x1;
1240 public static const int LVIS_SELECTED = 0x2;
1241 public static const int LVIS_STATEIMAGEMASK = 0xf000;
1242 public static const int LVM_FIRST = 0x1000;
1243 public static const int LVM_APPROXIMATEVIEWRECT = 0x1040;
1244 public static const int LVM_CREATEDRAGIMAGE = LVM_FIRST + 33;
1245 public static const int LVM_DELETEALLITEMS = 0x1009;
1246 public static const int LVM_DELETECOLUMN = 0x101c;
1247 public static const int LVM_DELETEITEM = 0x1008;
1248 public static const int LVM_ENSUREVISIBLE = 0x1013;
1249 public static const int LVM_GETBKCOLOR = 0x1000;
1250 public static const int LVM_GETCOLUMN = IsUnicode ? 0x105f : 0x1019;
1251 public static const int LVM_GETCOLUMNORDERARRAY = LVM_FIRST + 59;
1252 public static const int LVM_GETCOLUMNWIDTH = 0x101d;
1253 public static const int LVM_GETCOUNTPERPAGE = 0x1028;
1254 public static const int LVM_GETEXTENDEDLISTVIEWSTYLE = 0x1037;
1255 public static const int LVM_GETHEADER = 0x101f;
1256 public static const int LVM_GETIMAGELIST = 0x1002;
1257 public static const int LVM_GETITEM = IsUnicode ? 0x104b : 0x1005;
1258 public static const int LVM_GETITEMW = 0x104b;
1259 public static const int LVM_GETITEMA = 0x1005;
1260 public static const int LVM_GETITEMCOUNT = 0x1004;
1261 public static const int LVM_GETITEMRECT = 0x100e;
1262 public static const int LVM_GETITEMSTATE = 0x102c;
1263 public static const int LVM_GETNEXTITEM = 0x100c;
1264 public static const int LVM_GETSELECTEDCOLUMN = LVM_FIRST + 174;
1265 public static const int LVM_GETSELECTEDCOUNT = 0x1032;
1266 public static const int LVM_GETSTRINGWIDTH = IsUnicode ? 0x1057 : 0x1011;
1267 public static const int LVM_GETSUBITEMRECT = 0x1038;
1268 public static const int LVM_GETTEXTCOLOR = 0x1023;
1269 public static const int LVM_GETTOOLTIPS = 0x104e;
1270 public static const int LVM_GETTOPINDEX = 0x1027;
1271 public static const int LVM_HITTEST = 0x1012;
1272 public static const int LVM_INSERTCOLUMN = IsUnicode ? 0x1061 : 0x101b;
1273 public static const int LVM_INSERTITEM = IsUnicode ? 0x104d : 0x1007;
1274 public static const int LVM_REDRAWITEMS = LVM_FIRST + 21;
1275 public static const int LVM_SCROLL = 0x1014;
1276 public static const int LVM_SETBKCOLOR = 0x1001;
1277 public static const int LVM_SETCALLBACKMASK = LVM_FIRST + 11;
1278 public static const int LVM_SETCOLUMN = IsUnicode ? 0x1060 : 0x101a;
1279 public static const int LVM_SETCOLUMNORDERARRAY = LVM_FIRST + 58;
1280 public static const int LVM_SETCOLUMNWIDTH = 0x101e;
1281 public static const int LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036;
1282 public static const int LVM_SETIMAGELIST = 0x1003;
1283 public static const int LVM_SETITEM = IsUnicode ? 0x104c : 0x1006;
1284 public static const int LVM_SETITEMCOUNT = LVM_FIRST + 47;
1285 public static const int LVM_SETITEMSTATE = 0x102b;
1286 public static const int LVM_SETSELECTIONMARK = LVM_FIRST + 67;
1287 public static const int LVM_SETSELECTEDCOLUMN = LVM_FIRST + 140;
1288 public static const int LVM_SETTEXTBKCOLOR = 0x1026;
1289 public static const int LVM_SETTEXTCOLOR = 0x1024;
1290 public static const int LVM_SETTOOLTIPS = LVM_FIRST + 74;
1291 public static const int LVM_SUBITEMHITTEST = LVM_FIRST + 57;
1292 public static const int LVNI_FOCUSED = 0x1;
1293 public static const int LVNI_SELECTED = 0x2;
1294 public static const int LVN_BEGINDRAG = 0xffffff93;
1295 public static const int LVN_BEGINRDRAG = 0xffffff91;
1296 public static const int LVN_COLUMNCLICK = 0xffffff94;
1297 public static const int LVN_FIRST = 0xffffff9c;
1298 public static const int LVN_GETDISPINFOA = LVN_FIRST - 50;
1299 public static const int LVN_GETDISPINFOW = LVN_FIRST - 77;
1300 public static const int LVN_ITEMACTIVATE = 0xffffff8e;
1301 public static const int LVN_ITEMCHANGED = 0xffffff9b;
1302 public static const int LVN_MARQUEEBEGIN = 0xffffff64;
1303 public static const int LVN_ODFINDITEMA = LVN_FIRST - 52;
1304 public static const int LVN_ODFINDITEMW = LVN_FIRST - 79;
1305 public static const int LVN_ODSTATECHANGED = LVN_FIRST - 15;
1306 public static const int LVP_LISTITEM = 1;
1307 public static const int LVSCW_AUTOSIZE = 0xffffffff;
1308 public static const int LVSCW_AUTOSIZE_USEHEADER = 0xfffffffe;
1309 public static const int LVSICF_NOINVALIDATEALL = 0x1;
1310 public static const int LVSICF_NOSCROLL = 0x2;
1311 public static const int LVSIL_SMALL = 0x1;
1312 public static const int LVSIL_STATE = 0x2;
1313 public static const int LVS_EX_DOUBLEBUFFER = 0x10000;
1314 public static const int LVS_EX_FULLROWSELECT = 0x20;
1315 public static const int LVS_EX_GRIDLINES = 0x1;
1316 public static const int LVS_EX_HEADERDRAGDROP = 0x10;
1317 public static const int LVS_EX_LABELTIP = 0x4000;
1318 public static const int LVS_EX_ONECLICKACTIVATE = 0x40;
1319 public static const int LVS_EX_SUBITEMIMAGES = 0x2;
1320 public static const int LVS_EX_TRACKSELECT = 0x8;
1321 public static const int LVS_EX_TRANSPARENTBKGND = 0x800000;
1322 public static const int LVS_EX_TWOCLICKACTIVATE = 0x80;
1323 public static const int LVS_LIST = 0x3;
1324 public static const int LVS_NOCOLUMNHEADER = 0x4000;
1325 public static const int LVS_NOSCROLL = 0x2000;
1326 public static const int LVS_OWNERDATA = 0x1000;
1327 public static const int LVS_OWNERDRAWFIXED = 0x400;
1328 public static const int LVS_REPORT = 0x1;
1329 public static const int LVS_SHAREIMAGELISTS = 0x40;
1330 public static const int LVS_SHOWSELALWAYS = 0x8;
1331 public static const int LVS_SINGLESEL = 0x4;
1332 public static const int LWA_COLORKEY = 0x00000001;
1333 public static const int LWA_ALPHA = 0x00000002;
1334 public static const int MAX_LINKID_TEXT = 48;
1335 // public static const int MAX_PATH = 260;
1336 public static const int MA_NOACTIVATE = 0x3;
1337 // public static const int MANIFEST_RESOURCE_ID = 2;
1338 public static const int MB_ABORTRETRYIGNORE = 0x2;
1339 public static const int MB_APPLMODAL = 0x0;
1340 public static const int MB_ICONERROR = 0x10;
1341 public static const int MB_ICONINFORMATION = 0x40;
1342 public static const int MB_ICONQUESTION = 0x20;
1343 public static const int MB_ICONWARNING = 0x30;
1344 public static const int MB_OK = 0x0;
1345 public static const int MB_OKCANCEL = 0x1;
1346 public static const int MB_PRECOMPOSED = 0x1;
1347 public static const int MB_RETRYCANCEL = 0x5;
1348 public static const int MB_RIGHT = 0x00080000;
1349 public static const int MB_RTLREADING = 0x100000;
1350 public static const int MB_SYSTEMMODAL = 0x1000;
1351 public static const int MB_TASKMODAL = 0x2000;
1352 public static const int MB_TOPMOST = 0x00040000;
1353 public static const int MB_YESNO = 0x4;
1354 public static const int MB_YESNOCANCEL = 0x3;
1355 public static const int MCM_FIRST = 0x1000;
1356 public static const int MCM_GETCURSEL = MCM_FIRST + 1;
1357 public static const int MCM_SETCURSEL = MCM_FIRST + 2;
1358 public static const int MCN_FIRST = 0xFFFFFD12;
1359 public static const int MCN_SELCHANGE = MCN_FIRST + 1;
1360 public static const int MCN_SELECT = MCN_FIRST + 4;
1361 public static const int MCM_GETMINREQRECT = MCM_FIRST + 9;
1362 public static const int MCS_NOTODAY = 0x0010;
1363 public static const int MDIS_ALLCHILDSTYLES = 0x0001;
1364 public static const int MFS_CHECKED = 0x8;
1365 public static const int MFS_DISABLED = 0x3;
1366 public static const int MFS_GRAYED = 0x3;
1367 public static const int MFT_RADIOCHECK = 0x200;
1368 public static const int MFT_RIGHTJUSTIFY = 0x4000;
1369 public static const int MFT_RIGHTORDER = 0x2000;
1370 public static const int MFT_SEPARATOR = 0x800;
1371 public static const int MFT_STRING = 0x0;
1372 public static const int MF_BYCOMMAND = 0x0;
1373 public static const int MF_BYPOSITION = 0x400;
1374 public static const int MF_CHECKED = 0x8;
1375 public static const int MF_DISABLED = 0x2;
1376 public static const int MF_ENABLED = 0x0;
1377 public static const int MF_GRAYED = 0x1;
1378 public static const int MF_HILITE = 0x80;
1379 public static const int MF_POPUP = 0x10;
1380 public static const int MF_SEPARATOR = 0x800;
1381 public static const int MF_SYSMENU = 0x2000;
1382 public static const int MF_UNCHECKED = 0x0;
1383 public static const int MIIM_BITMAP = 0x80;
1384 public static const int MIIM_DATA = 0x20;
1385 public static const int MIIM_ID = 0x2;
1386 public static const int MIIM_STATE = 0x1;
1387 public static const int MIIM_STRING = 0x40;
1388 public static const int MIIM_SUBMENU = 0x4;
1389 public static const int MIIM_TYPE = 0x10;
1390 public static const int MIM_BACKGROUND = 0x2;
1391 public static const int MIM_STYLE = 0x10;
1392 public static const int MK_ALT = 0x20;
1393 public static const int MK_CONTROL = 0x8;
1394 public static const int MK_LBUTTON = 0x1;
1395 public static const int MK_MBUTTON = 0x10;
1396 public static const int MK_RBUTTON = 0x2;
1397 public static const int MK_SHIFT = 0x4;
1398 public static const int MK_XBUTTON1 = 0x20;
1399 public static const int MK_XBUTTON2 = 0x40;
1400 public static const int MM_TEXT = 0x1;
1401 public static const int MNC_CLOSE = 0x1;
1402 public static const int MNS_CHECKORBMP = 0x4000000;
1403 public static const int MONITOR_DEFAULTTONEAREST = 0x2;
1404 public static const int MONITORINFOF_PRIMARY = 0x1;
1405 public static const TCHAR[] MONTHCAL_CLASS = "SysMonthCal32"; //$NON-NLS-1$
1406 public static const int MOUSEEVENTF_ABSOLUTE = 0x8000;
1407 public static const int MOUSEEVENTF_LEFTDOWN = 0x0002;
1408 public static const int MOUSEEVENTF_LEFTUP = 0x0004;
1409 public static const int MOUSEEVENTF_MIDDLEDOWN = 0x0020;
1410 public static const int MOUSEEVENTF_MIDDLEUP = 0x0040;
1411 public static const int MOUSEEVENTF_MOVE = 0x0001;
1412 public static const int MOUSEEVENTF_RIGHTDOWN = 0x0008;
1413 public static const int MOUSEEVENTF_RIGHTUP = 0x0010;
1414 public static const int MOUSEEVENTF_VIRTUALDESK = 0x4000;
1415 public static const int MOUSEEVENTF_WHEEL = 0x0800;
1416 public static const int MOUSEEVENTF_XDOWN = 0x0080;
1417 public static const int MOUSEEVENTF_XUP = 0x0100;
1418 public static const int MSGF_DIALOGBOX = 0;
1419 public static const int MSGF_COMMCTRL_BEGINDRAG = 0x4200;
1420 public static const int MSGF_COMMCTRL_SIZEHEADER = 0x4201;
1421 public static const int MSGF_COMMCTRL_DRAGSELECT = 0x4202;
1422 public static const int MSGF_COMMCTRL_TOOLBARCUST = 0x4203;
1423 public static const int MSGF_MAINLOOP = 8;
1424 public static const int MSGF_MENU = 2;
1425 public static const int MSGF_MOVE = 3;
1426 public static const int MSGF_MESSAGEBOX = 1;
1427 public static const int MSGF_NEXTWINDOW = 6;
1428 public static const int MSGF_SCROLLBAR = 5;
1429 public static const int MSGF_SIZE = 4;
1430 public static const int MSGF_USER = 4096;
1431 public static const int MWMO_INPUTAVAILABLE = 0x4;
1432 public static const int NI_COMPOSITIONSTR = 0x15;
1433 public static const int NIF_ICON = 0x00000002;
1434 public static const int NIF_INFO = 0x00000010;
1435 public static const int NIF_MESSAGE = 0x00000001;
1436 public static const int NIF_STATE = 0x00000008;
1437 public static const int NIF_TIP = 0x00000004;
1438 public static const int NIIF_ERROR = 0x00000003;
1439 public static const int NIIF_INFO = 0x00000001;
1440 public static const int NIIF_NONE = 0x00000000;
1441 public static const int NIIF_WARNING = 0x00000002;
1442 public static const int NIM_ADD = 0x00000000;
1443 public static const int NIM_DELETE = 0x00000002;
1444 public static const int NIM_MODIFY = 0x00000001;
1445 public static const int NIN_SELECT = 0x400 + 0;
1446 public static const int NINF_KEY = 0x1;
1447 public static const int NIN_KEYSELECT = NIN_SELECT | NINF_KEY;
1448 public static const int NIN_BALLOONSHOW = 0x400 + 2;
1449 public static const int NIN_BALLOONHIDE = 0x400 + 3;
1450 public static const int NIN_BALLOONTIMEOUT = 0x400 + 4;
1451 public static const int NIN_BALLOONUSERCLICK = 0x400 + 5;
1452 public static const int NIS_HIDDEN = 0x00000001;
1453 public static const int NM_FIRST = 0x0;
1454 public static const int NM_CLICK = 0xfffffffe;
1455 public static const int NM_CUSTOMDRAW = NM_FIRST - 12;
1456 public static const int NM_DBLCLK = 0xfffffffd;
1457 public static const int NM_RECOGNIZEGESTURE = NM_FIRST - 16;
1458 public static const int NM_RELEASEDCAPTURE = NM_FIRST - 16;
1459 public static const int NM_RETURN = 0xfffffffc;
1460 public static int NOTIFYICONDATAA_V2_SIZE;
1461 public static int NOTIFYICONDATAW_V2_SIZE;
1462 public static int NOTIFYICONDATA_V2_SIZE;
1463 public static const int NOTSRCCOPY = 0x330008;
1464 public static const int NULLREGION = 0x1;
1465 public static const int NULL_BRUSH = 0x5;
1466 public static const int NULL_PEN = 0x8;
1467 public static const int NUMRESERVED = 106;
1468 public static const int OBJID_CARET = 0xFFFFFFF8;
1469 public static const int OBJID_CLIENT = 0xFFFFFFFC;
1470 public static const int OBJID_MENU = 0xFFFFFFFD;
1471 public static const int OBJID_WINDOW = 0x00000000;
1472 public static const int OBJ_BITMAP = 0x7;
1473 public static const int OBJ_FONT = 0x6;
1474 public static const int OBJ_PEN = 0x1;
1475 public static const int OBJID_HSCROLL = 0xFFFFFFFA;
1476 public static const int OBJID_VSCROLL = 0xFFFFFFFB;
1477 public static const TCHAR* OBM_CHECKBOXES = cast(TCHAR*)0x7ff7;
1478 public static const int ODS_SELECTED = 0x1;
1479 public static const int ODT_MENU = 0x1;
1480 public static const int OFN_ALLOWMULTISELECT = 0x200;
1481 public static const int OFN_EXPLORER = 0x80000;
1482 public static const int OFN_ENABLEHOOK = 0x20;
1483 public static const int OFN_HIDEREADONLY = 0x4;
1484 public static const int OFN_NOCHANGEDIR = 0x8;
1485 public static const int OFN_OVERWRITEPROMPT = 0x2;
1486 public static const int OIC_BANG = 0x7F03;
1487 public static const int OIC_HAND = 0x7F01;
1488 public static const int OIC_INFORMATION = 0x7F04;
1489 public static const int OIC_QUES = 0x7F02;
1490 public static const int OIC_WINLOGO = 0x7F05;
1491 public static const int OPAQUE = 0x2;
1492 public static const int PATCOPY = 0xf00021;
1493 public static const int PATINVERT = 0x5a0049;
1494 public static const int PBM_GETPOS = 0x408;
1495 public static const int PBM_GETRANGE = 0x407;
1496 public static const int PBM_GETSTATE = 0x400 + 17;
1497 public static const int PBM_SETBARCOLOR = 0x409;
1498 public static const int PBM_SETBKCOLOR = 0x2001;
1499 public static const int PBM_SETMARQUEE = 0x400 + 10;
1500 public static const int PBM_SETPOS = 0x402;
1501 public static const int PBM_SETRANGE32 = 0x406;
1502 public static const int PBM_SETSTATE = 0x400 + 16;
1503 public static const int PBM_STEPIT = 0x405;
1504 public static const int PBS_MARQUEE = 0x08;
1505 public static const int PBS_SMOOTH = 0x1;
1506 public static const int PBS_VERTICAL = 0x4;
1507 public static const int PBS_NORMAL = 1;
1508 public static const int PBS_HOT = 2;
1509 public static const int PBS_PRESSED = 3;
1510 public static const int PBS_DISABLED = 4;
1511 public static const int PBS_DEFAULTED = 5;
1512 public static const int PBST_NORMAL = 0x0001;
1513 public static const int PBST_ERROR = 0x0002;
1514 public static const int PBST_PAUSED = 0x0003;
1515 public static const int PD_ALLPAGES = 0x0;
1516 public static const int PD_COLLATE = 0x10;
1517 public static const int PD_PAGENUMS = 0x2;
1518 public static const int PD_PRINTTOFILE = 0x20;
1519 public static const int PD_RETURNDC = 0x100;
1520 public static const int PD_SELECTION = 0x1;
1521 public static const int PD_USEDEVMODECOPIESANDCOLLATE = 0x40000;
1522 public static const int PT_CLOSEFIGURE = 1;
1523 public static const int PT_LINETO = 2;
1524 public static const int PT_BEZIERTO = 4;
1525 public static const int PT_MOVETO = 6;
1526 public static const int PFM_TABSTOPS = 0x10;
1527 public static const int PHYSICALHEIGHT = 0x6f;
1528 public static const int PHYSICALOFFSETX = 0x70;
1529 public static const int PHYSICALOFFSETY = 0x71;
1530 public static const int PHYSICALWIDTH = 0x6e;
1531 public static const int PLANES = 0xe;
1532 public static const int PM_NOREMOVE = 0x0;
1533 public static const int PM_NOYIELD = 0x2;
1534 public static const int QS_HOTKEY = 0x0080;
1535 public static const int QS_KEY = 0x0001;
1536 public static const int QS_MOUSEMOVE = 0x0002;
1537 public static const int QS_MOUSEBUTTON = 0x0004;
1538 public static const int QS_MOUSE = QS_MOUSEMOVE | QS_MOUSEBUTTON;
1539 public static const int QS_INPUT = QS_KEY | QS_MOUSE;
1540 public static const int QS_POSTMESSAGE = 0x0008;
1541 public static const int QS_TIMER = 0x0010;
1542 public static const int QS_PAINT = 0x0020;
1543 public static const int QS_SENDMESSAGE = 0x0040;
1544 public static const int QS_ALLINPUT = QS_MOUSEMOVE | QS_MOUSEBUTTON | QS_KEY | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_SENDMESSAGE;
1545 public static const int PM_QS_INPUT = QS_INPUT << 16;
1546 public static const int PM_QS_POSTMESSAGE = (QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16;
1547 public static const int PM_QS_PAINT = QS_PAINT << 16;
1548 public static const int PM_QS_SENDMESSAGE = QS_SENDMESSAGE << 16;
1549 public static const int PM_REMOVE = 0x1;
1550 public static const TCHAR[] PROGRESS_CLASS = "msctls_progress32"; //$NON-NLS-1$
1551 public static const int PP_BAR = 1;
1552 public static const int PP_BARVERT = 2;
1553 public static const int PP_CHUNK = 3;
1554 public static const int PP_CHUNKVERT = 4;
1555 public static const int PRF_CHILDREN = 16;
1556 public static const int PRF_CLIENT = 0x4;
1557 public static const int PRF_ERASEBKGND = 0x8;
1558 public static const int PRF_NONCLIENT = 0x2;
1559 public static const int PROGRESSCHUNKSIZE = 2411;
1560 public static const int PROGRESSSPACESIZE = 2412;
1561 public static const int PS_DASH = 0x1;
1562 public static const int PS_DASHDOT = 0x3;
1563 public static const int PS_DASHDOTDOT = 0x4;
1564 public static const int PS_DOT = 0x2;
1565 public static const int PS_ENDCAP_FLAT = 0x200;
1566 public static const int PS_ENDCAP_SQUARE = 0x100;
1567 public static const int PS_ENDCAP_ROUND = 0x000;
1568 public static const int PS_ENDCAP_MASK = 0xF00;
1569 public static const int PS_GEOMETRIC = 0x10000;
1570 public static const int PS_JOIN_BEVEL = 0x1000;
1571 public static const int PS_JOIN_MASK = 0xF000;
1572 public static const int PS_JOIN_MITER = 0x2000;
1573 public static const int PS_JOIN_ROUND = 0x0000;
1574 public static const int PS_SOLID = 0x0;
1575 public static const int PS_STYLE_MASK = 0xf;
1576 public static const int PS_TYPE_MASK = 0x000f0000;
1577 public static const int PS_USERSTYLE = 0x7;
1578 public static const int R2_COPYPEN = 0xd;
1579 public static const int R2_XORPEN = 0x7;
1580 public static const int RASTERCAPS = 0x26;
1581 public static const int RASTER_FONTTYPE = 0x1;
1582 public static const int RBBIM_CHILD = 0x10;
1583 public static const int RBBIM_CHILDSIZE = 0x20;
1584 public static const int RBBIM_COLORS = 0x2;
1585 public static const int RBBIM_HEADERSIZE = 0x800;
1586 public static const int RBBIM_ID = 0x100;
1587 public static const int RBBIM_IDEALSIZE = 0x200;
1588 public static const int RBBIM_SIZE = 0x40;
1589 public static const int RBBIM_STYLE = 0x1;
1590 public static const int RBBIM_TEXT = 0x4;
1591 public static const int RBBS_BREAK = 0x1;
1592 public static const int RBBS_GRIPPERALWAYS = 0x80;
1593 public static const int RBBS_NOGRIPPER = 0x00000100;
1594 public static const int RBBS_USECHEVRON = 0x00000200;
1595 public static const int RBBS_VARIABLEHEIGHT = 0x40;
1596 public static const int RBN_FIRST = 0xfffffcc1;
1597 public static const int RBN_BEGINDRAG = RBN_FIRST - 4;
1598 public static const int RBN_CHILDSIZE = RBN_FIRST - 8;
1599 public static const int RBN_CHEVRONPUSHED = RBN_FIRST - 10;
1600 public static const int RBN_HEIGHTCHANGE = 0xfffffcc1;
1601 public static const int RBS_DBLCLKTOGGLE = 0x8000;
1602 public static const int RBS_BANDBORDERS = 0x400;
1603 public static const int RBS_VARHEIGHT = 0x200;
1604 public static const int RB_DELETEBAND = 0x402;
1605 public static const int RB_GETBANDBORDERS = 0x422;
1606 public static const int RB_GETBANDCOUNT = 0x40c;
1607 public static const int RB_GETBANDINFO = IsUnicode ? 0x41c : 0x41d;
1608 public static const int RB_GETBANDMARGINS = 0x428;
1609 public static const int RB_GETBARHEIGHT = 0x41b;
1610 public static const int RB_GETBKCOLOR = 0x414;
1611 public static const int RB_GETRECT = 0x409;
1612 public static const int RB_GETTEXTCOLOR = 0x416;
1613 public static const int RB_IDTOINDEX = 0x410;
1614 public static const int RB_INSERTBAND = IsUnicode ? 0x40a : 0x401;
1615 public static const int RB_MOVEBAND = 0x427;
1616 public static const int RB_SETBANDINFO = IsUnicode ? 0x40b : 0x406;
1617 public static const int RB_SETBKCOLOR = 0x413;
1618 public static const int RB_SETTEXTCOLOR = 0x415;
1619 public static const int RC_BITBLT = 0x1;
1620 public static const int RC_PALETTE = 0x100;
1621 public static const int RDW_ALLCHILDREN = 0x80;
1622 public static const int RDW_ERASE = 0x4;
1623 public static const int RDW_FRAME = 0x400;
1624 public static const int RDW_INVALIDATE = 0x1;
1625 public static const int RDW_UPDATENOW = 0x100;
1626 public static const int READ_CONTROL = 0x20000;
1627 public static const TCHAR[] REBARCLASSNAME = "ReBarWindow32"; //$NON-NLS-1$
1628 public static const int RGN_AND = 0x1;
1629 public static const int RGN_COPY = 5;
1630 public static const int RGN_DIFF = 0x4;
1631 public static const int RGN_ERROR = 0;
1632 public static const int RGN_OR = 0x2;
1633 public static const int RP_BAND = 3;
1634 public static const int SBP_ARROWBTN = 0x1;
1635 public static const int SBP_THUMBBTNHORZ = 2;
1636 public static const int SBP_THUMBBTNVERT = 3;
1637 public static const int SBP_LOWERTRACKHORZ = 4;
1638 public static const int SBP_UPPERTRACKHORZ = 5;
1639 public static const int SBP_LOWERTRACKVERT = 6;
1640 public static const int SBP_UPPERTRACKVERT = 7;
1641 public static const int SBP_GRIPPERHORZ = 8;
1642 public static const int SBP_GRIPPERVERT = 9;
1643 public static const int SBP_SIZEBOX = 10;
1644 public static const int SBS_HORZ = 0x0;
1645 public static const int SBS_VERT = 0x1;
1646 public static const int SB_BOTH = 0x3;
1647 public static const int SB_BOTTOM = 0x7;
1648 public static const int SB_CTL = 0x2;
1649 public static const int SB_ENDSCROLL = 0x8;
1650 public static const int SB_HORZ = 0x0;
1651 public static const int SB_LINEDOWN = 0x1;
1652 public static const int SB_LINEUP = 0x0;
1653 public static const int SB_PAGEDOWN = 0x3;
1654 public static const int SB_PAGEUP = 0x2;
1655 public static const int SB_THUMBPOSITION = 0x4;
1656 public static const int SB_THUMBTRACK = 0x5;
1657 public static const int SB_TOP = 0x6;
1658 public static const int SB_VERT = 0x1;
1659 public static const int SCF_ALL = 0x4;
1660 public static const int SCF_DEFAULT = 0x0;
1661 public static const int SCF_SELECTION = 0x1;
1662 public static const int SC_CLOSE = 0xf060;
1663 public static const int SC_HSCROLL = 0xf080;
1664 public static const int SC_KEYMENU = 0xf100;
1665 public static const int SC_MAXIMIZE = 0xf030;
1666 public static const int SC_MINIMIZE = 0xf020;
1667 public static const int SC_NEXTWINDOW = 0xF040;
1668 public static const int SC_RESTORE = 0xf120;
1669 public static const int SC_SIZE = 0xf000;
1670 public static const int SC_TASKLIST = 0xf130;
1671 public static const int SC_VSCROLL = 0xf070;
1672 public static const int SCRBS_NORMAL = 1;
1673 public static const int SCRBS_HOT = 2;
1674 public static const int SCRBS_PRESSED = 3;
1675 public static const int SCRBS_DISABLED = 4;
1676 public static const int SEM_FAILCRITICALERRORS = 0x1;
1677 public static const int SET_FEATURE_ON_PROCESS = 0x2;
1678 public static const int SF_RTF = 0x2;
1679 public static const int SHCMBF_HIDDEN = 0x2;
1680 public static const int SHCMBM_OVERRIDEKEY = 0x400 + 403;
1681 public static const int SHCMBM_SETSUBMENU = 0x590;
1682 public static const int SHCMBM_GETSUBMENU = 0x591;
1683 public static const int SHGFI_ICON = 0x000000100;
1684 public static const int SHGFI_SMALLICON= 0x1;
1685 public static const int SHGFI_USEFILEATTRIBUTES = 0x000000010;
1686 public static const int SHMBOF_NODEFAULT = 0x1;
1687 public static const int SHMBOF_NOTIFY = 0x2;
1688 public static const int SHRG_RETURNCMD = 0x1;
1689 public static const int SIF_ALL = 0x17;
1690 public static const int SIF_DISABLENOSCROLL = 0x8;
1691 public static const int SIF_PAGE = 0x2;
1692 public static const int SIF_POS = 0x4;
1693 public static const int SIF_RANGE = 0x1;
1694 public static const int SIF_TRACKPOS = 0x10;
1695 public static const int SIP_DOWN = 1;
1696 public static const int SIP_UP = 0;
1697 public static const int SIPF_ON = 0x1;
1698 public static const int SIZE_RESTORED = 0;
1699 public static const int SIZE_MINIMIZED = 1;
1700 public static const int SIZE_MAXIMIZED = 2;
1701 public static const int SIZEPALETTE = 104;
1702 public static const int SM_CMONITORS = 80;
1703 public static const int SM_CXBORDER = 0x5;
1704 public static const int SM_CXCURSOR = 0xd;
1705 public static const int SM_CXDOUBLECLK = 36;
1706 public static const int SM_CYDOUBLECLK = 37;
1707 public static const int SM_CXEDGE = 0x2d;
1708 public static const int SM_CXFOCUSBORDER = 83;
1709 public static const int SM_CXHSCROLL = 0x15;
1710 public static const int SM_CXICON = 0x0b;
1711 public static const int SM_CYICON = 0x0c;
1712 public static const int SM_CXVIRTUALSCREEN = 78;
1713 public static const int SM_CYVIRTUALSCREEN = 79;
1714 public static const int SM_CXSMICON = 49;
1715 public static const int SM_CYSMICON = 50;
1716 public static const int SM_CXSCREEN = 0x0;
1717 public static const int SM_XVIRTUALSCREEN = 76;
1718 public static const int SM_YVIRTUALSCREEN = 77;
1719 public static const int SM_CXVSCROLL = 0x2;
1720 public static const int SM_CYBORDER = 0x6;
1721 public static const int SM_CYCURSOR = 0xe;
1722 public static const int SM_CYFOCUSBORDER = 84;
1723 public static const int SM_CYHSCROLL = 0x3;
1724 public static const int SM_CYMENU = 0xf;
1725 public static const int SM_CXMINTRACK = 34;
1726 public static const int SM_CYMINTRACK = 35;
1727 public static const int SM_CMOUSEBUTTONS = 43;
1728 public static const int SM_CYSCREEN = 0x1;
1729 public static const int SM_CYVSCROLL = 0x14;
1730 // public static const int SM_DBCSENABLED = 0x2A;
1731 // public static const int SM_IMMENABLED = 0x52;
1732 public static const int SPI_GETFONTSMOOTHINGTYPE = 0x200A;
1733 public static const int SPI_GETHIGHCONTRAST = 66;
1734 public static const int SPI_GETWORKAREA = 0x30;
1735 public static const int SPI_GETMOUSEVANISH = 0x1020;
1736 public static const int SPI_GETNONCLIENTMETRICS = 41;
1737 public static const int SPI_GETWHEELSCROLLLINES = 104;
1738 public static const int SPI_GETCARETWIDTH = 0x2006;
1739 public static const int SPI_SETSIPINFO = 224;
1740 public static const int SPI_SETHIGHCONTRAST = 67;
1741 public static const int SRCAND = 0x8800c6;
1742 public static const int SRCCOPY = 0xcc0020;
1743 public static const int SRCINVERT = 0x660046;
1744 public static const int SRCPAINT = 0xee0086;
1745 public static const int SS_BITMAP = 0xe;
1746 public static const int SS_CENTER = 0x1;
1747 public static const int SS_CENTERIMAGE = 0x200;
1748 public static const int SS_EDITCONTROL = 0x2000;
1749 public static const int SS_ICON = 0x3;
1750 public static const int SS_LEFT = 0x0;
1751 public static const int SS_LEFTNOWORDWRAP = 0xc;
1752 public static const int SS_NOTIFY = 0x100;
1753 public static const int SS_OWNERDRAW = 0xd;
1754 public static const int SS_REALSIZEIMAGE = 0x800;
1755 public static const int SS_RIGHT = 0x2;
1756 public static const int SSA_FALLBACK = 0x00000020;
1757 public static const int SSA_GLYPHS = 0x00000080;
1758 public static const int SSA_METAFILE = 0x00000800;
1759 public static const int SSA_LINK = 0x00001000;
1760 public static const int STANDARD_RIGHTS_READ = 0x20000;
1761 public static const int STARTF_USESHOWWINDOW = 0x1;
1762 public static const int STATE_SYSTEM_INVISIBLE = 0x00008000;
1763 public static const int STATE_SYSTEM_OFFSCREEN = 0x00010000;
1764 public static const int STATE_SYSTEM_UNAVAILABLE = 0x00000001;
1765 public static const int STD_COPY = 0x1;
1766 public static const int STD_CUT = 0x0;
1767 public static const int STD_FILENEW = 0x6;
1768 public static const int STD_FILEOPEN = 0x7;
1769 public static const int STD_FILESAVE = 0x8;
1770 public static const int STD_PASTE = 0x2;
1771 public static const int STM_GETIMAGE = 0x173;
1772 public static const int STM_SETIMAGE = 0x172;
1773 public static const int SWP_ASYNCWINDOWPOS = 0x4000;
1774 public static const int SWP_DRAWFRAME = 0x20;
1775 public static const int SWP_NOACTIVATE = 0x10;
1776 public static const int SWP_NOCOPYBITS = 0x100;
1777 public static const int SWP_NOMOVE = 0x2;
1778 public static const int SWP_NOREDRAW = 0x8;
1779 public static const int SWP_NOSIZE = 0x1;
1780 public static const int SWP_NOZORDER = 0x4;
1781 public static const int SW_ERASE = 0x4;
1782 public static const int SW_HIDE = 0x0;
1783 public static const int SW_INVALIDATE = 0x2;
1784 public static const int SW_MINIMIZE = 0x6;
1785 public static const int SW_PARENTOPENING = 0x3;
1786 public static const int SW_RESTORE = IsWinCE ? 0xd : 0x9;
1787 public static const int SW_SCROLLCHILDREN = 0x1;
1788 public static const int SW_SHOW = 0x5;
1789 public static const int SW_SHOWMAXIMIZED = IsWinCE ? 0xb : 0x3;
1790 public static const int SW_SHOWMINIMIZED = 0x2;
1791 public static const int SW_SHOWMINNOACTIVE = 0x7;
1792 public static const int SW_SHOWNA = 0x8;
1793 public static const int SW_SHOWNOACTIVATE = 0x4;
1794 public static const int SYNCHRONIZE = 0x100000;
1795 public static const int SYSRGN = 0x4;
1796 public static const int SYSTEM_FONT = 0xd;
1797 public static const int S_OK = 0x0;
1798 public static const int TABP_TABITEM = 1;
1799 public static const int TABP_TABITEMLEFTEDGE = 2;
1800 public static const int TABP_TABITEMRIGHTEDGE = 3;
1801 public static const int TABP_TABITEMBOTHEDGE = 4;
1802 public static const int TABP_TOPTABITEM = 5;
1803 public static const int TABP_TOPTABITEMLEFTEDGE = 6;
1804 public static const int TABP_TOPTABITEMRIGHTEDGE = 7;
1805 public static const int TABP_TOPTABITEMBOTHEDGE = 8;
1806 public static const int TABP_PANE = 9;
1807 public static const int TABP_BODY = 10;
1808 public static const int TBIF_COMMAND = 0x20;
1809 public static const int TBIF_STATE = 0x4;
1810 public static const int TBIF_IMAGE = 0x1;
1811 public static const int TBIF_LPARAM = 0x10;
1812 public static const int TBIF_SIZE = 0x40;
1813 public static const int TBIF_STYLE = 0x8;
1814 public static const int TBIF_TEXT = 0x2;
1815 public static const int TB_GETEXTENDEDSTYLE = 0x400 + 85;
1816 public static const int TBM_GETLINESIZE = 0x418;
1817 public static const int TBM_GETPAGESIZE = 0x416;
1818 public static const int TBM_GETPOS = 0x400;
1819 public static const int TBM_GETRANGEMAX = 0x402;
1820 public static const int TBM_GETRANGEMIN = 0x401;
1821 public static const int TBM_GETTHUMBRECT = 0x419;
1822 public static const int TBM_SETLINESIZE = 0x417;
1823 public static const int TBM_SETPAGESIZE = 0x415;
1824 public static const int TBM_SETPOS = 0x405;
1825 public static const int TBM_SETRANGEMAX = 0x408;
1826 public static const int TBM_SETRANGEMIN = 0x407;
1827 public static const int TBM_SETTICFREQ = 0x414;
1828 public static const int TBN_DROPDOWN = 0xfffffd3a;
1829 public static const int TBN_FIRST = 0xfffffd44;
1830 public static const int TBN_HOTITEMCHANGE = 0xFFFFFD37;
1831 public static const int TBSTATE_CHECKED = 0x1;
1832 public static const int TBSTATE_PRESSED = 0x02;
1833 public static const int TBSTYLE_CUSTOMERASE = 0x2000;
1834 public static const int TBSTYLE_DROPDOWN = 0x8;
1835 public static const int TBSTATE_ENABLED = 0x4;
1836 public static const int TBSTYLE_AUTOSIZE = 0x10;
1837 public static const int TBSTYLE_EX_DOUBLEBUFFER = 0x80;
1838 public static const int TBSTYLE_EX_DRAWDDARROWS = 0x1;
1839 public static const int TBSTYLE_EX_HIDECLIPPEDBUTTONS = 0x10;
1840 public static const int TBSTYLE_EX_MIXEDBUTTONS = 0x8;
1841 public static const int TBSTYLE_FLAT = 0x800;
1842 public static const int TBSTYLE_LIST = 0x1000;
1843 public static const int TBSTYLE_TOOLTIPS = 0x100;
1844 public static const int TBSTYLE_TRANSPARENT = 0x8000;
1845 public static const int TBSTYLE_WRAPABLE = 0x200;
1846 public static const int TBS_AUTOTICKS = 0x1;
1847 public static const int TBS_BOTH = 0x8;
1848 public static const int TBS_DOWNISLEFT = 0x0400;
1849 public static const int TBS_HORZ = 0x0;
1850 public static const int TBS_VERT = 0x2;
1851 public static const int TB_ADDSTRING = IsUnicode ? 0x44d : 0x41c;
1852 public static const int TB_AUTOSIZE = 0x421;
1853 public static const int TB_BUTTONCOUNT = 0x418;
1854 public static const int TB_BUTTONSTRUCTSIZE = 0x41e;
1855 public static const int TB_COMMANDTOINDEX = 0x419;
1856 public static const int TB_DELETEBUTTON = 0x416;
1857 public static const int TB_ENDTRACK = 0x8;
1858 public static const int TB_GETBUTTON = 0x417;
1859 public static const int TB_GETBUTTONINFO = IsUnicode ? 0x43f : 0x441;
1860 public static const int TB_GETBUTTONSIZE = 0x43a;
1861 public static const int TB_GETBUTTONTEXT = IsUnicode ? 0x44b : 0x42d;
1862 public static const int TB_GETDISABLEDIMAGELIST = 0x437;
1863 public static const int TB_GETHOTIMAGELIST = 0x435;
1864 public static const int TB_GETHOTITEM = 0x0400 + 71;
1865 public static const int TB_GETIMAGELIST = 0x431;
1866 public static const int TB_GETITEMRECT = 0x41d;
1867 public static const int TB_GETPADDING = 0x0400 + 86;
1868 public static const int TB_GETROWS = 0x428;
1869 public static const int TB_GETSTATE = 0x412;
1870 public static const int TB_GETTOOLTIPS = 0x423;
1871 public static const int TB_INSERTBUTTON = IsUnicode ? 0x443 : 0x415;
1872 public static const int TB_LOADIMAGES = 0x432;
1873 public static const int TB_MAPACCELERATOR = 0x0400 + (IsUnicode ? 90 : 78);
1874 public static const int TB_SETBITMAPSIZE = 0x420;
1875 public static const int TB_SETBUTTONINFO = IsUnicode ? 0x440 : 0x442;
1876 public static const int TB_SETBUTTONSIZE = 0x41f;
1877 public static const int TB_SETDISABLEDIMAGELIST = 0x436;
1878 public static const int TB_SETEXTENDEDSTYLE = 0x454;
1879 public static const int TB_SETHOTIMAGELIST = 0x434;
1880 public static const int TB_SETHOTITEM = 0x0400 + 72;
1881 public static const int TB_SETIMAGELIST = 0x430;
1882 public static const int TB_SETPARENT = 0x400 + 37;
1883 public static const int TB_SETROWS = 0x427;
1884 public static const int TB_SETSTATE = 0x411;
1885 public static const int TB_THUMBPOSITION = 0x4;
1886 public static const int TCIF_IMAGE = 0x2;
1887 public static const int TCIF_TEXT = 0x1;
1888 public static const int TCI_SRCCHARSET = 0x1;
1889 public static const int TCI_SRCCODEPAGE = 0x2;
1890 public static const int TCM_ADJUSTRECT = 0x1328;
1891 public static const int TCM_DELETEITEM = 0x1308;
1892 public static const int TCM_GETCURSEL = 0x130b;
1893 public static const int TCM_GETITEMCOUNT = 0x1304;
1894 public static const int TCM_GETITEMRECT = 0x130a;
1895 public static const int TCM_GETTOOLTIPS = 0x132d;
1896 public static const int TCM_HITTEST = 0x130d;
1897 public static const int TCM_INSERTITEM = IsUnicode ? 0x133e : 0x1307;
1898 public static const int TCM_SETCURSEL = 0x130c;
1899 public static const int TCM_SETIMAGELIST = 0x1303;
1900 public static const int TCM_SETITEM = IsUnicode ? 0x133d : 0x1306;
1901 public static const int TCN_SELCHANGE = 0xfffffdd9;
1902 public static const int TCN_SELCHANGING = 0xfffffdd8;
1903 public static const int TCS_BOTTOM = 0x0002;
1904 public static const int TCS_FOCUSNEVER = 0x8000;
1905 public static const int TCS_MULTILINE = 0x200;
1906 public static const int TCS_TABS = 0x0;
1907 public static const int TCS_TOOLTIPS = 0x4000;
1908 public static const int TECHNOLOGY = 0x2;
1909 public static const int TF_ATTR_INPUT = 0;
1910 public static const int TF_ATTR_TARGET_CONVERTED = 1;
1911 public static const int TF_ATTR_CONVERTED = 2;
1912 public static const int TF_ATTR_TARGET_NOTCONVERTED = 3;
1913 public static const int TF_ATTR_INPUT_ERROR = 4;
1914 public static const int TF_ATTR_FIXEDCONVERTED = 5;
1915 public static const int TF_ATTR_OTHER = -1;
1916 public alias TF_DA_COLORTYPE.TF_CT_NONE TF_CT_NONE;
1917 public alias TF_DA_COLORTYPE.TF_CT_SYSCOLOR TF_CT_SYSCOLOR;
1918 public alias TF_DA_COLORTYPE.TF_CT_COLORREF TF_CT_COLORREF;
1919 public alias TF_DA_LINESTYLE.TF_LS_NONE TF_LS_NONE;
1920 public alias TF_DA_LINESTYLE.TF_LS_SOLID TF_LS_SOLID;
1921 public alias TF_DA_LINESTYLE.TF_LS_DOT TF_LS_DOT;
1922 public alias TF_DA_LINESTYLE.TF_LS_DASH TF_LS_DASH;
1923 public alias TF_DA_LINESTYLE.TF_LS_SQUIGGLE TF_LS_SQUIGGLE;
1924 public static const int TIME_NOSECONDS = 0x2;
1925 public static const int TIS_NORMAL = 1;
1926 public static const int TIS_HOT = 2;
1927 public static const int TIS_SELECTED = 3;
1928 public static const int TIS_DISABLED = 4;
1929 public static const int TIS_FOCUSED = 5;
1930 public static const int TKP_TRACK = 1;
1931 public static const int TKP_TRACKVERT = 2;
1932 public static const int TKP_THUMB = 3;
1933 public static const int TKP_THUMBBOTTOM = 4;
1934 public static const int TKP_THUMBTOP = 5;
1935 public static const int TKP_THUMBVERT = 6;
1936 public static const int TKP_THUMBLEFT = 7;
1937 public static const int TKP_THUMBRIGHT = 8;
1938 public static const int TKP_TICS = 9;
1939 public static const int TKP_TICSVERT = 10;
1940 public static const int TME_HOVER = 0x1;
1941 public static const int TME_LEAVE = 0x2;
1942 public static const int TME_QUERY = 0x40000000;
1943 public static const int TMPF_VECTOR = 0x2;
1944 public static const int TMT_CONTENTMARGINS = 3602;
1945 public static const TCHAR[] TOOLBARCLASSNAME = "ToolbarWindow32"; //$NON-NLS-1$
1946 public static const TCHAR[] TOOLTIPS_CLASS = "tooltips_class32"; //$NON-NLS-1$
1947 public static const int TP_BUTTON = 1;
1948 public static const int TP_DROPDOWNBUTTON = 2;
1949 public static const int TP_SPLITBUTTON = 3;
1950 public static const int TP_SPLITBUTTONDROPDOWN = 4;
1951 public static const int TP_SEPARATOR = 5;
1952 public static const int TP_SEPARATORVERT = 6;
1953 public static const int TPM_LEFTALIGN = 0x0;
1954 public static const int TPM_LEFTBUTTON = 0x0;
1955 public static const int TPM_RIGHTBUTTON = 0x2;
1956 public static const int TPM_RIGHTALIGN = 0x8;
1957 public static const TCHAR[] TRACKBAR_CLASS = "msctls_trackbar32"; //$NON-NLS-1$
1958 public static const int TRANSPARENT = 0x1;
1959 public static const int TREIS_DISABLED = 4;
1960 public static const int TREIS_HOT = 2;
1961 public static const int TREIS_NORMAL = 1;
1962 public static const int TREIS_SELECTED = 3;
1963 public static const int TREIS_SELECTEDNOTFOCUS = 5;
1964 public static const int TS_MIN = 0;
1965 public static const int TS_TRUE = 1;
1966 public static const int TS_DRAW = 2;
1967 public static const int TS_NORMAL = 1;
1968 public static const int TS_HOT = 2;
1969 public static const int TS_PRESSED = 3;
1970 public static const int TS_DISABLED = 4;
1971 public static const int TS_CHECKED = 5;
1972 public static const int TS_HOTCHECKED = 6;
1973 public static const int TTDT_AUTOMATIC = 0;
1974 public static const int TTDT_RESHOW = 1;
1975 public static const int TTDT_AUTOPOP = 2;
1976 public static const int TTDT_INITIAL = 3;
1977 public static const int TTF_ABSOLUTE = 0x80;
1978 public static const int TTF_IDISHWND = 0x1;
1979 public static const int TTF_SUBCLASS = 0x10;
1980 public static const int TTF_RTLREADING = 0x4;
1981 public static const int TTF_TRACK = 0x20;
1982 public static const int TTF_TRANSPARENT = 0x100;
1983 public static const int TTI_NONE = 0;
1984 public static const int TTI_INFO = 1;
1985 public static const int TTI_WARNING = 2;
1986 public static const int TTI_ERROR= 3;
1987 public static const int TTM_ACTIVATE = 0x400 + 1;
1988 public static const int TTM_ADDTOOL = IsUnicode ? 0x432 : 0x404;
1989 public static const int TTM_ADJUSTRECT = 0x400 + 31;
1990 public static const int TTM_GETCURRENTTOOLA = 0x400 + 15;
1991 public static const int TTM_GETCURRENTTOOLW = 0x400 + 59;
1992 public static const int TTM_GETCURRENTTOOL = 0x400 + (IsUnicode ? 59 : 15);
1993 public static const int TTM_GETDELAYTIME = 0x400 + 21;
1994 public static const int TTM_DELTOOL = IsUnicode ? 0x433 : 0x405;
1995 public static const int TTM_GETTOOLINFO = 0x400 + (IsUnicode ? 53 : 8);
1996 public static const int TTM_NEWTOOLRECT = 0x400 + (IsUnicode ? 52 : 6);
1997 public static const int TTM_POP = 0x400 + 28;
1998 public static const int TTM_SETDELAYTIME = 0x400 + 3;
1999 public static const int TTM_SETMAXTIPWIDTH = 0x418;
2000 public static const int TTM_SETTITLEA = 0x400 + 32;
2001 public static const int TTM_SETTITLEW = 0x400 + 33;
2002 public static const int TTM_SETTITLE = 0x400 + (IsUnicode ? 33 : 32);
2003 public static const int TTM_TRACKPOSITION = 1042;
2004 public static const int TTM_TRACKACTIVATE = 1041;
2005 public static const int TTM_UPDATE = 0x41D;
2006 public static const int TTN_FIRST = 0xfffffdf8;
2007 public static const int TTN_GETDISPINFO = IsUnicode ? 0xfffffdee : 0xfffffdf8;
2008 public static const int TTN_GETDISPINFOW = 0xfffffdee;
2009 public static const int TTN_GETDISPINFOA = 0xfffffdf8;
2010 public static const int TTN_POP = TTN_FIRST - 2;
2011 public static const int TTN_SHOW = TTN_FIRST - 1;
2012 public static const int TTS_ALWAYSTIP = 0x1;
2013 public static const int TTS_BALLOON = 0x40;
2014 public static const int TTS_NOANIMATE = 0x10;
2015 public static const int TTS_NOFADE = 0x20;
2016 public static const int TTS_NOPREFIX = 0x02;
2017 public static const int TV_FIRST = 0x1100;
2018 public static const int TVE_COLLAPSE = 0x1;
2019 public static const int TVE_COLLAPSERESET = 0x8000;
2020 public static const int TVE_EXPAND = 0x2;
2021 public static const int TVGN_CARET = 0x9;
2022 public static const int TVGN_CHILD = 0x4;
2023 public static const int TVGN_DROPHILITED = 0x8;
2024 public static const int TVGN_FIRSTVISIBLE = 0x5;
2025 public static const int TVGN_LASTVISIBLE = 0xa;
2026 public static const int TVGN_NEXT = 0x1;
2027 public static const int TVGN_NEXTVISIBLE = 0x6;
2028 public static const int TVGN_PARENT = 0x3;
2029 public static const int TVGN_PREVIOUS = 0x2;
2030 public static const int TVGN_PREVIOUSVISIBLE = 0x7;
2031 public static const int TVGN_ROOT = 0x0;
2032 public static const int TVHT_ONITEM = 0x46;
2033 public static const int TVHT_ONITEMBUTTON = 16;
2034 public static const int TVHT_ONITEMICON = 0x2;
2035 public static const int TVHT_ONITEMINDENT = 0x8;
2036 public static const int TVHT_ONITEMRIGHT = 0x20;
2037 public static const int TVHT_ONITEMLABEL = 0x4;
2038 public static const int TVHT_ONITEMSTATEICON = 0x40;
2039 public static const int TVIF_HANDLE = 0x10;
2040 public static const int TVIF_IMAGE = 0x2;
2041 public static const int TVIF_INTEGRAL = 0x0080;
2042 public static const int TVIF_PARAM = 0x4;
2043 public static const int TVIF_SELECTEDIMAGE = 0x20;
2044 public static const int TVIF_STATE = 0x8;
2045 public static const int TVIF_TEXT = 0x1;
2046 public static const int TVIS_DROPHILITED = 0x8;
2047 public static const int TVIS_EXPANDED = 0x20;
2048 public static const int TVIS_SELECTED = 0x2;
2049 public static const int TVIS_STATEIMAGEMASK = 0xf000;
2050 public static const int /*long*/ TVI_FIRST = -0x0FFFF;
2051 public static const int /*long*/ TVI_LAST = -0x0FFFE;
2052 public static const int /*long*/ TVI_ROOT = -0x10000;
2053 public static const int /*long*/ TVI_SORT = -0x0FFFD;
2054 public static const int TVM_CREATEDRAGIMAGE = TV_FIRST + 18;
2055 public static const int TVM_DELETEITEM = 0x1101;
2056 public static const int TVM_ENSUREVISIBLE = 0x1114;
2057 public static const int TVM_EXPAND = 0x1102;
2058 public static const int TVM_GETBKCOLOR = 0x111f;
2059 public static const int TVM_GETCOUNT = 0x1105;
2060 public static const int TVM_GETEXTENDEDSTYLE = TV_FIRST + 45;
2061 public static const int TVM_GETIMAGELIST = 0x1108;
2062 public static const int TVM_GETITEM = IsUnicode ? 0x113e : 0x110c;
2063 public static const int TVM_GETITEMHEIGHT = 0x111c;
2064 public static const int TVM_GETITEMRECT = 0x1104;
2065 public static const int TVM_GETITEMSTATE = TV_FIRST + 39;
2066 public static const int TVM_GETNEXTITEM = 0x110a;
2067 public static const int TVM_GETTEXTCOLOR = 0x1120;
2068 public static const int TVM_GETTOOLTIPS = TV_FIRST + 25;
2069 public static const int TVM_GETVISIBLECOUNT = TV_FIRST + 16;
2070 public static const int TVM_HITTEST = 0x1111;
2071 public static const int TVM_INSERTITEM = IsUnicode ? 0x1132 : 0x1100;
2072 public static const int TVM_MAPACCIDTOHTREEITEM = TV_FIRST + 42;
2073 public static const int TVM_MAPHTREEITEMTOACCID = TV_FIRST + 43;
2074 public static const int TVM_SELECTITEM = 0x110b;
2075 public static const int TVM_SETBKCOLOR = 0x111d;
2076 public static const int TVM_SETEXTENDEDSTYLE = TV_FIRST + 44;
2077 public static const int TVM_SETIMAGELIST = 0x1109;
2078 public static const int TVM_SETINSERTMARK = 0x111a;
2079 public static const int TVM_SETITEM = IsUnicode ? 0x113f : 0x110d;
2080 public static const int TVM_SETITEMHEIGHT = TV_FIRST + 27;
2081 public static const int TVM_SETSCROLLTIME = TV_FIRST + 33;
2082 public static const int TVM_SETTEXTCOLOR = 0x111e;
2083 public static const int TVM_SORTCHILDREN = TV_FIRST + 19;
2084 public static const int TVM_SORTCHILDRENCB = TV_FIRST + 21;
2085 public static const int TVN_BEGINDRAGW = 0xfffffe38;
2086 public static const int TVN_BEGINDRAGA = 0xfffffe69;
2087 public static const int TVN_BEGINRDRAGW = 0xfffffe37;
2088 public static const int TVN_BEGINRDRAGA = 0xfffffe68;
2089 public static const int TVN_FIRST = 0xfffffe70;
2090 public static const int TVN_GETDISPINFOA = TVN_FIRST - 3;
2091 public static const int TVN_GETDISPINFOW = TVN_FIRST - 52;
2092 public static const int TVN_ITEMCHANGINGW = TVN_FIRST - 17;
2093 public static const int TVN_ITEMCHANGINGA = TVN_FIRST - 16;
2094 public static const int TVN_ITEMEXPANDEDA = TVN_FIRST -6;
2095 public static const int TVN_ITEMEXPANDEDW = TVN_FIRST - 55;
2096 public static const int TVN_ITEMEXPANDINGW = 0xfffffe3a;
2097 public static const int TVN_ITEMEXPANDINGA = 0xfffffe6b;
2098 public static const int TVN_SELCHANGEDW = 0xfffffe3d;
2099 public static const int TVN_SELCHANGEDA = 0xfffffe6e;
2100 public static const int TVN_SELCHANGINGW = 0xfffffe3e;
2101 public static const int TVN_SELCHANGINGA = 0xfffffe6f;
2102 public static const int TVP_GLYPH = 2;
2103 public static const int TVP_TREEITEM = 1;
2104 public static const int TVSIL_NORMAL = 0x0;
2105 public static const int TVSIL_STATE = 0x2;
2106 public static const int TVS_DISABLEDRAGDROP = 0x10;
2107 public static const int TVS_EX_AUTOHSCROLL = 0x0020;
2108 public static const int TVS_EX_DOUBLEBUFFER = 0x0004;
2109 public static const int TVS_EX_DIMMEDCHECKBOXES = 0x0200;
2110 public static const int TVS_EX_DRAWIMAGEASYNC = 0x0400;
2111 public static const int TVS_EX_EXCLUSIONCHECKBOXES = 0x0100;
2112 public static const int TVS_EX_FADEINOUTEXPANDOS = 0x0040;
2113 public static const int TVS_EX_MULTISELECT = 0x0002;
2114 public static const int TVS_EX_NOINDENTSTATE = 0x0008;
2115 public static const int TVS_EX_PARTIALCHECKBOXES = 0x0080;
2116 public static const int TVS_EX_RICHTOOLTIP = 0x0010;
2117 public static const int TVS_FULLROWSELECT = 0x1000;
2118 public static const int TVS_HASBUTTONS = 0x1;
2119 public static const int TVS_HASLINES = 0x2;
2120 public static const int TVS_LINESATROOT = 0x4;
2121 public static const int TVS_NOHSCROLL = 0x8000;
2122 public static const int TVS_NONEVENHEIGHT = 0x4000;
2123 public static const int TVS_NOSCROLL = 0x2000;
2124 public static const int TVS_NOTOOLTIPS = 0x80;
2125 public static const int TVS_SHOWSELALWAYS = 0x20;
2126 public static const int TVS_TRACKSELECT = 0x200;
2127 public static const int UDM_GETACCEL = 0x046C;
2128 public static const int UDM_GETRANGE32 = 0x0470;
2129 public static const int UDM_GETPOS = 0x468;
2130 public static const int UDM_GETPOS32 = 0x0472;
2131 public static const int UDM_SETACCEL = 0x046B;
2132 public static const int UDM_SETRANGE32 = 0x046f;
2133 public static const int UDM_SETPOS = 0x467;
2134 public static const int UDM_SETPOS32 = 0x0471;
2135 public static const int UDN_DELTAPOS = -722;
2136 public static const int UDS_ALIGNLEFT = 0x008;
2137 public static const int UDS_ALIGNRIGHT = 0x004;
2138 public static const int UDS_AUTOBUDDY = 0x0010;
2139 public static const int UDS_WRAP = 0x0001;
2140 public static const int UIS_CLEAR = 2;
2141 public static const int UIS_INITIALIZE = 3;
2142 public static const int UIS_SET = 1;
2143 public static const int UISF_HIDEACCEL = 0x2;
2144 public static const int UISF_HIDEFOCUS = 0x1;
2145 public static const TCHAR[] UPDOWN_CLASS = "msctls_updown32"; //$NON-NLS-1$
2146 public static const int USP_E_SCRIPT_NOT_IN_FONT = 0x80040200;
2147 public static const int VERTRES = 0xa;
2148 public static const int VK_BACK = 0x8;
2149 public static const int VK_CANCEL = 0x3;
2150 public static const int VK_CAPITAL = 0x14;
2151 public static const int VK_CONTROL = 0x11;
2152 public static const int VK_DECIMAL = 0x6E;
2153 public static const int VK_DELETE = 0x2e;
2154 public static const int VK_DIVIDE = 0x6f;
2155 public static const int VK_DOWN = 0x28;
2156 public static const int VK_END = 0x23;
2157 public static const int VK_ESCAPE = 0x1b;
2158 public static const int VK_F1 = 0x70;
2159 public static const int VK_F10 = 0x79;
2160 public static const int VK_F11 = 0x7a;
2161 public static const int VK_F12 = 0x7b;
2162 public static const int VK_F13 = 0x7c;
2163 public static const int VK_F14 = 0x7d;
2164 public static const int VK_F15 = 0x7e;
2165 public static const int VK_F2 = 0x71;
2166 public static const int VK_F3 = 0x72;
2167 public static const int VK_F4 = 0x73;
2168 public static const int VK_F5 = 0x74;
2169 public static const int VK_F6 = 0x75;
2170 public static const int VK_F7 = 0x76;
2171 public static const int VK_F8 = 0x77;
2172 public static const int VK_F9 = 0x78;
2173 public static const int VK_HOME = 0x24;
2174 public static const int VK_INSERT = 0x2d;
2175 public static const int VK_LBUTTON = 0x1;
2176 public static const int VK_LEFT = 0x25;
2177 public static const int VK_MBUTTON = 0x4;
2178 public static const int VK_MENU = 0x12;
2179 public static const int VK_MULTIPLY = 0x6A;
2180 public static const int VK_N = 0x4e;
2181 public static const int VK_NEXT = 0x22;
2182 public static const int VK_NUMLOCK = 0x90;
2183 public static const int VK_NUMPAD0 = 0x60;
2184 public static const int VK_NUMPAD1 = 0x61;
2185 public static const int VK_NUMPAD2 = 0x62;
2186 public static const int VK_NUMPAD3 = 0x63;
2187 public static const int VK_NUMPAD4 = 0x64;
2188 public static const int VK_NUMPAD5 = 0x65;
2189 public static const int VK_NUMPAD6 = 0x66;
2190 public static const int VK_NUMPAD7 = 0x67;
2191 public static const int VK_NUMPAD8 = 0x68;
2192 public static const int VK_NUMPAD9 = 0x69;
2193 public static const int VK_PAUSE = 0x13;
2194 public static const int VK_PRIOR = 0x21;
2195 public static const int VK_RBUTTON = 0x2;
2196 public static const int VK_RETURN = 0xd;
2197 public static const int VK_RIGHT = 0x27;
2198 public static const int VK_SCROLL = 0x91;
2199 public static const int VK_SEPARATOR = 0x6C;
2200 public static const int VK_SHIFT = 0x10;
2201 public static const int VK_SNAPSHOT = 0x2C;
2202 public static const int VK_SPACE = 0x20;
2203 public static const int VK_SUBTRACT = 0x6D;
2204 public static const int VK_TAB = 0x9;
2205 public static const int VK_UP = 0x26;
2206 public static const int VK_XBUTTON1 = 0x05;
2207 public static const int VK_XBUTTON2 = 0x06;
2208 public static const int VK_ADD = 0x6B;
2209 public static const int VK_APP1 = 0xc1;
2210 public static const int VK_APP2 = 0xc2;
2211 public static const int VK_APP3 = 0xc3;
2212 public static const int VK_APP4 = 0xc4;
2213 public static const int VK_APP5 = 0xc5;
2214 public static const int VK_APP6 = 0xc6;
2215 public static const TCHAR[] WC_HEADER = "SysHeader32"; //$NON-NLS-1$
2216 public static const TCHAR[] WC_LINK = "SysLink"; //$NON-NLS-1$
2217 public static const TCHAR[] WC_LISTVIEW = "SysListView32"; //$NON-NLS-1$
2218 public static const TCHAR[] WC_TABCONTROL = "SysTabControl32"; //$NON-NLS-1$
2219 public static const TCHAR[] WC_TREEVIEW = "SysTreeView32"; //$NON-NLS-1$
2220 public static const int WINDING = 2;
2221 public static const int WH_CBT = 5;
2222 public static const int WH_GETMESSAGE = 0x3;
2223 public static const int WH_MSGFILTER = 0xFFFFFFFF;
2224 public static const int WH_FOREGROUNDIDLE = 11;
2225 public static const int WHEEL_DELTA = 120;
2226 public static const int WHEEL_PAGESCROLL = 0xFFFFFFFF;
2227 public static const int WHITE_BRUSH = 0;
2228 public static const int WM_ACTIVATE = 0x6;
2229 public static const int WM_ACTIVATEAPP = 0x1c;
2230 public static const int WM_APP = 0x8000;
2231 public static const int WM_DWMCOLORIZATIONCOLORCHANGED = 0x320;
2232 public static const int WM_CANCELMODE = 0x1f;
2233 public static const int WM_CAPTURECHANGED = 0x0215;
2234 public static const int WM_CHANGEUISTATE = 0x0127;
2235 public static const int WM_CHAR = 0x102;
2236 public static const int WM_CLEAR = 0x303;
2237 public static const int WM_CLOSE = 0x10;
2238 public static const int WM_COMMAND = 0x111;
2239 public static const int WM_CONTEXTMENU = 0x7b;
2240 public static const int WM_COPY = 0x301;
2241 public static const int WM_CREATE = 0x0001;
2242 public static const int WM_CTLCOLORBTN = 0x135;
2243 public static const int WM_CTLCOLORDLG = 0x136;
2244 public static const int WM_CTLCOLOREDIT = 0x133;
2245 public static const int WM_CTLCOLORLISTBOX = 0x134;
2246 public static const int WM_CTLCOLORMSGBOX = 0x132;
2247 public static const int WM_CTLCOLORSCROLLBAR = 0x137;
2248 public static const int WM_CTLCOLORSTATIC = 0x138;
2249 public static const int WM_CUT = 0x300;
2250 public static const int WM_DEADCHAR = 0x103;
2251 public static const int WM_DESTROY = 0x2;
2252 public static const int WM_DRAWITEM = 0x2b;
2253 public static const int WM_ENDSESSION = 0x16;
2254 public static const int WM_ENTERIDLE = 0x121;
2255 public static const int WM_ERASEBKGND = 0x14;
2256 public static const int WM_GETDLGCODE = 0x87;
2257 public static const int WM_GETFONT = 0x31;
2258 // public static const int WM_GETICON = 0x7f;
2259 public static const int WM_GETOBJECT = 0x003D;
2260 public static const int WM_GETMINMAXINFO = 0x0024;
2261 public static const int WM_HELP = 0x53;
2262 public static const int WM_HOTKEY = 0x0312;
2263 public static const int WM_HSCROLL = 0x114;
2264 public static const int WM_IME_CHAR = 0x286;
2265 public static const int WM_IME_COMPOSITION = 0x10f;
2266 public static const int WM_IME_COMPOSITION_START = 0x010D;
2267 public static const int WM_IME_ENDCOMPOSITION = 0x010E;
2268 public static const int WM_INITDIALOG = 0x110;
2269 public static const int WM_INITMENUPOPUP = 0x117;
2270 public static const int WM_INPUTLANGCHANGE = 0x51;
2271 public static const int WM_KEYDOWN = 0x100;
2272 public static const int WM_KEYFIRST = 0x100;
2273 public static const int WM_KEYLAST = 0x108;
2274 public static const int WM_KEYUP = 0x101;
2275 public static const int WM_KILLFOCUS = 0x8;
2276 public static const int WM_LBUTTONDBLCLK = 0x203;
2277 public static const int WM_LBUTTONDOWN = 0x201;
2278 public static const int WM_LBUTTONUP = 0x202;
2279 public static const int WM_MBUTTONDBLCLK = 0x209;
2280 public static const int WM_MBUTTONDOWN = 0x207;
2281 public static const int WM_MBUTTONUP = 0x208;
2282 public static const int WM_MEASUREITEM = 0x2c;
2283 public static const int WM_MENUCHAR = 0x120;
2284 public static const int WM_MENUSELECT = 0x11f;
2285 public static const int WM_MOUSEACTIVATE = 0x21;
2286 public static const int WM_MOUSEFIRST = 0x200;
2287 public static const int WM_MOUSEHOVER = 0x2a1;
2288 public static const int WM_MOUSELEAVE = 0x2a3;
2289 public static const int WM_MOUSEMOVE = 0x200;
2290 public static const int WM_MOUSEWHEEL = 0x20a;
2291 public static const int WM_MOUSELAST = 0x20d;
2292 public static const int WM_MOVE = 0x3;
2293 public static const int WM_NCACTIVATE = 0x86;
2294 public static const int WM_NCCALCSIZE = 0x83;
2295 public static const int WM_NCHITTEST = 0x84;
2296 public static const int WM_NCLBUTTONDOWN = 0x00A1;
2297 public static const int WM_NCPAINT = 0x85;
2298 public static const int WM_NOTIFY = 0x4e;
2299 public static const int WM_NULL = 0x0;
2300 public static const int WM_PAINT = 0xf;
2301 public static const int WM_PALETTECHANGED = 0x311;
2302 public static const int WM_PARENTNOTIFY = 0x0210;
2303 public static const int WM_PASTE = 0x302;
2304 public static const int WM_PRINT = 0x0317;
2305 public static const int WM_PRINTCLIENT = 0x0318;
2306 public static const int WM_QUERYENDSESSION = 0x11;
2307 public static const int WM_QUERYNEWPALETTE = 0x30f;
2308 public static const int WM_QUERYOPEN = 0x13;
2309 public static const int WM_QUERYUISTATE = 0x129;
2310 public static const int WM_RBUTTONDBLCLK = 0x206;
2311 public static const int WM_RBUTTONDOWN = 0x204;
2312 public static const int WM_RBUTTONUP = 0x205;
2313 public static const int WM_SETCURSOR = 0x20;
2314 public static const int WM_SETFOCUS = 0x7;
2315 public static const int WM_SETFONT = 0x30;
2316 public static const int WM_SETICON = 0x80;
2317 public static const int WM_SETREDRAW = 0xb;
2318 public static const int WM_SETTEXT = 12;
2319 public static const int WM_SETTINGCHANGE = 0x1A;
2320 public static const int WM_SHOWWINDOW = 0x18;
2321 public static const int WM_SIZE = 0x5;
2322 public static const int WM_SYSCHAR = 0x106;
2323 public static const int WM_SYSCOLORCHANGE = 0x15;
2324 public static const int WM_SYSCOMMAND = 0x112;
2325 public static const int WM_SYSKEYDOWN = 0x104;
2326 public static const int WM_SYSKEYUP = 0x105;
2327 public static const int WM_TIMER = 0x113;
2328 public static const int WM_THEMECHANGED = 0x031a;
2329 public static const int WM_UNDO = 0x304;
2330 public static const int WM_UPDATEUISTATE = 0x0128;
2331 public static const int WM_USER = 0x400;
2332 public static const int WM_VSCROLL = 0x115;
2333 public static const int WM_WINDOWPOSCHANGED = 0x47;
2334 public static const int WM_WINDOWPOSCHANGING = 0x46;
2335 public static const int WS_BORDER = 0x800000;
2336 public static const int WS_CAPTION = 0xc00000;
2337 public static const int WS_CHILD = 0x40000000;
2338 public static const int WS_MINIMIZE = 0x20000000; //PORTING_TODO: from org.eclipse.swt, why?
2339 public static const int WS_CLIPCHILDREN = 0x2000000;
2340 public static const int WS_CLIPSIBLINGS = 0x4000000;
2341 public static const int WS_DISABLED = 0x4000000;
2342 public static const int WS_EX_APPWINDOW = 0x40000;
2343 public static const int WS_EX_CAPTIONOKBTN = 0x80000000;
2344 public static const int WS_EX_CLIENTEDGE = 0x200;
2345 public static const int WS_EX_COMPOSITED = 0x2000000;
2346 public static const int WS_EX_DLGMODALFRAME = 0x1;
2347 public static const int WS_EX_LAYERED = 0x00080000;
2348 public static const int WS_EX_LAYOUTRTL = 0x00400000;
2349 public static const int WS_EX_LEFTSCROLLBAR = 0x00004000;
2350 public static const int WS_EX_MDICHILD = 0x00000040;
2351 public static const int WS_EX_NOINHERITLAYOUT = 0x00100000;
2352 public static const int WS_EX_NOACTIVATE = 0x08000000;
2353 public static const int WS_EX_RIGHT = 0x00001000;
2354 public static const int WS_EX_RTLREADING = 0x00002000;
2355 public static const int WS_EX_STATICEDGE = 0x20000;
2356 public static const int WS_EX_TOOLWINDOW = 0x80;
2357 public static const int WS_EX_TOPMOST = 0x8;
2358 public static const int WS_EX_TRANSPARENT = 0x20;
2359 public static const int WS_HSCROLL = 0x100000;
2360 public static const int WS_MAXIMIZEBOX = IsWinCE ? 0x20000 : 0x10000;
2361 public static const int WS_MINIMIZEBOX = IsWinCE ? 0x10000 : 0x20000;
2362 public static const int WS_OVERLAPPED = IsWinCE ? WS_BORDER | WS_CAPTION : 0x0;
2363 public static const int WS_OVERLAPPEDWINDOW = 0xcf0000;
2364 public static const int WS_POPUP = 0x80000000;
2365 public static const int WS_SYSMENU = 0x80000;
2366 public static const int WS_TABSTOP = 0x10000;
2367 public static const int WS_THICKFRAME = 0x40000;
2368 public static const int WS_VISIBLE = 0x10000000;
2369 public static const int WS_VSCROLL = 0x200000;
2370 public static const int WM_XBUTTONDOWN = 0x020B;
2371 public static const int WM_XBUTTONUP = 0x020C;
2372 public static const int WM_XBUTTONDBLCLK = 0x020D;
2373 public static const int XBUTTON1 = 0x1;
2374 public static const int XBUTTON2 = 0x2;
2375
2376
2377 /** Ansi/Unicode wrappers */
2378 // Unicode/Ansi alias
2379 version(ANSI) {
2380 alias WINAPI.AddFontResourceExA AddFontResourceEx;
2381 alias WINAPI.AssocQueryStringA AssocQueryString;
2382 alias WINAPI.CallWindowProcA CallWindowProc;
2383 alias WINAPI.CharLowerA CharLower;
2384 alias WINAPI.CharUpperA CharUpper;
2385 alias WINAPI.ChooseColorA ChooseColor;
2386 alias WINAPI.ChooseFontA ChooseFont;
2387 alias WINAPI.CreateAcceleratorTableA CreateAcceleratorTable;
2388 alias WINAPI.CreateDCA CreateDC;
2389 alias WINAPI.CreateEnhMetaFileA CreateEnhMetaFile;
2390 alias WINAPI.CreateEventA CreateEvent;
2391 alias WINAPI.CreateFileA CreateFile;
2392 alias WINAPI.CreateFontIndirectA CreateFontIndirect;
2393 alias WINAPI.CreateWindowExA CreateWindowEx;
2394 alias WINAPI.DefFrameProcA DefFrameProc;
2395 alias WINAPI.DefMDIChildProcA DefMDIChildProc;
2396 alias WINAPI.DefWindowProcA DefWindowProc;
2397 alias WINAPI.DeleteFileA DeleteFile;
2398 alias WINAPI.DispatchMessageA DispatchMessage;
2399 alias WINAPI.DragQueryFileA DragQueryFile;
2400 alias WINAPI.DrawStateA DrawState;
2401 alias WINAPI.DrawTextA DrawText;
2402 alias WINAPI.EnumFontFamiliesExA EnumFontFamiliesEx;
2403 alias WINAPI.EnumFontFamiliesA EnumFontFamilies;
2404 alias WINAPI.EnumSystemLanguageGroupsA EnumSystemLanguageGroups;
2405 alias EnumSystemLocalesA EnumSystemLocales;
2406 alias WINAPI.ExpandEnvironmentStringsA ExpandEnvironmentStrings;
2407 alias WINAPI.ExtTextOutA ExtTextOut;
2408 alias WINAPI.ExtractIconExA ExtractIconEx;
2409 alias WINAPI.FindResourceA FindResource;
2410 alias WINAPI.FindWindowA FindWindow;
2411 alias WINAPI.FormatMessageA FormatMessage;
2412 alias WINAPI.GetCharABCWidthsA GetCharABCWidths;
2413 alias WINAPI.GetCharWidthA GetCharWidth;
2414 alias WINAPI.GetCharacterPlacementA GetCharacterPlacement;
2415 alias WINAPI.GetClassInfoA GetClassInfo;
2416 alias WINAPI.GetClassNameA GetClassName;
2417 alias WINAPI.GetClipboardFormatNameA GetClipboardFormatName;
2418 alias WINAPI.GetDateFormatA GetDateFormat;
2419 alias WINAPI.GetTimeFormatA GetTimeFormat;
2420 alias WINAPI.GetKeyNameTextA GetKeyNameText;
2421 alias WINAPI.GetLocaleInfoA GetLocaleInfo;
2422 alias WINAPI.GetMenuItemInfoA GetMenuItemInfo;
2423 alias WINAPI.GetMessageA GetMessage;
2424 alias WINAPI.GetModuleFileNameA GetModuleFileName;
2425 alias WINAPI.GetModuleHandleA GetModuleHandle;
2426 alias WINAPI.GetMonitorInfoA GetMonitorInfo;
2427 alias WINAPI.GetObjectA GetObject;
2428 alias WINAPI.GetOpenFileNameA GetOpenFileName;
2429 alias WINAPI.GetOutlineTextMetricsA GetOutlineTextMetrics;
2430 alias WINAPI.GetProfileStringA _GetProfileString;
2431 alias WINAPI.GetPropA GetProp;
2432 alias WINAPI.GetSaveFileNameA GetSaveFileName;
2433 alias WINAPI.GetStartupInfoA GetStartupInfo;
2434 alias WINAPI.GetTextExtentPoint32A GetTextExtentPoint32;
2435 alias WINAPI.GetTextMetricsA GetTextMetrics;
2436 alias WINAPI.GetVersionExA GetVersionEx;
2437 alias WINAPI.GetWindowLongA GetWindowLong;
2438 alias WINAPI.GetWindowLongA GetWindowLongPtr; // is a macro
2439 alias WINAPI.GetWindowTextA _GetWindowText;
2440 alias WINAPI.GetWindowTextLengthA GetWindowTextLength;
2441 alias WINAPI.GlobalAddAtomA GlobalAddAtom;
2442 // alias WINAPI.ImmGetCompositionFontA ImmGetCompositionFont;
2443 // alias WINAPI.ImmGetCompositionStringA ImmGetCompositionString;
2444 // alias WINAPI.ImmSetCompositionFontA ImmSetCompositionFont;
2445 alias WINAPI.InsertMenuA InsertMenu;
2446 alias WINAPI.InsertMenuItemA InsertMenuItem;
2447 alias WINAPI.LoadBitmapA LoadBitmap;
2448 alias WINAPI.LoadCursorA LoadCursor;
2449 alias WINAPI.LoadIconA LoadIcon;
2450 alias WINAPI.LoadImageA LoadImage;
2451 alias WINAPI.LoadLibraryA LoadLibrary;
2452 alias WINAPI.LoadStringA LoadString;
2453 alias WINAPI.MapVirtualKeyA MapVirtualKey;
2454 alias WINAPI.MessageBoxA MessageBox;
2455 alias WINAPI.OutputDebugStringA OutputDebugString;
2456 alias WINAPI.PeekMessageA PeekMessage;
2457 alias WINAPI.PostMessageA PostMessage;
2458 alias WINAPI.PostThreadMessageA PostThreadMessage;
2459 alias WINAPI.PrintDlgA PrintDlg;
2460 alias WINAPI.RegEnumKeyExA RegEnumKeyEx;
2461 alias WINAPI.RegOpenKeyExA RegOpenKeyEx;
2462 alias WINAPI.RegQueryInfoKeyA RegQueryInfoKey;
2463 alias WINAPI.RegQueryValueExA RegQueryValueEx;
2464 alias WINAPI.RegisterClassA RegisterClass;
2465 alias WINAPI.RegisterClipboardFormatA RegisterClipboardFormat;
2466 alias WINAPI.RegOpenKeyExA RegOpenKeyEx;
2467 alias WINAPI.RegisterWindowMessageA RegisterWindowMessage;
2468 alias WINAPI.RemovePropA RemoveProp;
2469 alias WINAPI.SHBrowseForFolderA SHBrowseForFolder;
2470 alias WINAPI.SHGetPathFromIDListA SHGetPathFromIDList;
2471 alias WINAPI.SendMessageA SendMessage;
2472 alias WINAPI.SetMenuItemInfoA SetMenuItemInfo;
2473 alias WINAPI.SetPropA SetProp;
2474 alias WINAPI.SetWindowLongA SetWindowLong;
2475 alias WINAPI.SetWindowLongA SetWindowLongPtr;
2476 alias WINAPI.SetWindowTextA SetWindowText;
2477 alias WINAPI.SetWindowsHookExA SetWindowsHookEx;
2478 alias WINAPI.ShellExecuteExA ShellExecuteEx;
2479 alias WINAPI.Shell_NotifyIconA Shell_NotifyIcon;
2480 alias WINAPI.StartDocA StartDoc;
2481 alias WINAPI.SystemParametersInfoA SystemParametersInfo;
2482 alias WINAPI.TranslateAcceleratorA TranslateAccelerator;
2483 alias WINAPI.UnregisterClassA UnregisterClass;
2484 alias WINAPI.VkKeyScanA VkKeyScan;
2485 }else{
2486 alias DWTWINAPI.AddFontResourceExW AddFontResourceEx;
2487 alias DWTWINAPI.AssocQueryStringW AssocQueryString;
2488 alias WINAPI.CallWindowProcW CallWindowProc;
2489 alias WINAPI.CharLowerW CharLower;
2490 alias WINAPI.CharUpperW CharUpper;
2491 alias WINAPI.ChooseColorW ChooseColor;
2492 alias WINAPI.ChooseFontW ChooseFont;
2493 alias WINAPI.CreateAcceleratorTableW CreateAcceleratorTable;
2494 alias WINAPI.CreateDCW CreateDC;
2495 alias WINAPI.CreateEnhMetaFileW CreateEnhMetaFile;
2496 alias WINAPI.CreateEventW CreateEvent;
2497 alias WINAPI.CreateFileW CreateFile;
2498 alias WINAPI.CreateFontIndirectW CreateFontIndirect;
2499 alias WINAPI.CreateWindowExW CreateWindowEx;
2500 alias WINAPI.DefFrameProcW DefFrameProc;
2501 alias WINAPI.DefMDIChildProcW DefMDIChildProc;
2502 alias WINAPI.DefWindowProcW DefWindowProc;
2503 alias WINAPI.DeleteFileW DeleteFile;
2504 alias WINAPI.DispatchMessageW DispatchMessage;
2505 alias WINAPI.DragQueryFileW DragQueryFile;
2506 alias WINAPI.DrawStateW DrawState;
2507 alias WINAPI.DrawTextW DrawText;
2508 alias WINAPI.EnumFontFamiliesExW EnumFontFamiliesEx;
2509 alias WINAPI.EnumFontFamiliesW EnumFontFamilies;
2510 alias EnumSystemLanguageGroupsW EnumSystemLanguageGroups;
2511 alias EnumSystemLocalesW EnumSystemLocales;
2512 alias WINAPI.ExpandEnvironmentStringsW ExpandEnvironmentStrings;
2513 alias WINAPI.ExtTextOutW ExtTextOut;
2514 alias DWTWINAPI.ExtractIconExW ExtractIconEx;
2515 alias WINAPI.FindResourceW FindResource;
2516 alias WINAPI.FindWindowW FindWindow;
2517 alias WINAPI.FormatMessageW FormatMessage;
2518 alias WINAPI.GetCharABCWidthsW GetCharABCWidths;
2519 alias WINAPI.GetCharWidthW GetCharWidth;
2520 alias WINAPI.GetCharacterPlacementW GetCharacterPlacement;
2521 alias WINAPI.GetClassInfoW GetClassInfo;
2522 alias WINAPI.GetClassNameW GetClassName;
2523 alias WINAPI.GetClipboardFormatNameW GetClipboardFormatName;
2524 alias WINAPI.GetDateFormatW GetDateFormat;
2525 alias WINAPI.GetTimeFormatW GetTimeFormat;
2526 alias WINAPI.GetKeyNameTextW GetKeyNameText;
2527 alias WINAPI.GetLocaleInfoW GetLocaleInfo;
2528 alias WINAPI.GetMenuItemInfoW GetMenuItemInfo;
2529 alias WINAPI.GetMessageW GetMessage;
2530 alias WINAPI.GetModuleFileNameW GetModuleFileName;
2531 alias WINAPI.GetModuleHandleW GetModuleHandle;
2532 alias DWTWINAPI.GetMonitorInfoW GetMonitorInfo;
2533 alias WINAPI.GetObjectW GetObject;
2534 alias WINAPI.GetOpenFileNameW GetOpenFileName;
2535 alias WINAPI.GetOutlineTextMetricsW GetOutlineTextMetrics;
2536 alias WINAPI.GetProfileStringW _GetProfileString;
2537 alias WINAPI.GetPropW GetProp;
2538 alias WINAPI.GetSaveFileNameW GetSaveFileName;
2539 alias WINAPI.CreateProcessW CreateProcess;
2540 alias WINAPI.GetStartupInfoW GetStartupInfo;
2541 alias WINAPI.GetTextExtentPoint32W GetTextExtentPoint32;
2542 alias WINAPI.GetTextMetricsW GetTextMetrics;
2543 alias WINAPI.GetVersionExW GetVersionEx;
2544 alias WINAPI.GetWindowLongW GetWindowLong;
2545 alias WINAPI.GetWindowLongW GetWindowLongPtr; // is a macro
2546 alias WINAPI.GetWindowTextW _GetWindowText;
2547 alias WINAPI.GetWindowTextLengthW GetWindowTextLength;
2548 alias WINAPI.GlobalAddAtomW GlobalAddAtom;
2549 // alias WINAPI.ImmGetCompositionFontW ImmGetCompositionFont;
2550 // alias WINAPI.ImmGetCompositionStringW ImmGetCompositionString;
2551 // alias WINAPI.ImmSetCompositionFontW ImmSetCompositionFont;
2552 alias WINAPI.InsertMenuW InsertMenu;
2553 alias WINAPI.InsertMenuItemW InsertMenuItem;
2554 alias WINAPI.LoadBitmapW LoadBitmap;
2555 alias WINAPI.LoadCursorW LoadCursor;
2556 alias WINAPI.LoadIconW LoadIcon;
2557 alias WINAPI.LoadImageW LoadImage;
2558 alias WINAPI.LoadLibraryW LoadLibrary;
2559 alias WINAPI.LoadStringW LoadString;
2560 alias WINAPI.MapVirtualKeyW MapVirtualKey;
2561 alias WINAPI.MessageBoxW MessageBox;
2562 alias WINAPI.OutputDebugStringW OutputDebugString;
2563 alias WINAPI.PeekMessageW PeekMessage;
2564 alias WINAPI.PostMessageW PostMessage;
2565 alias WINAPI.PostThreadMessageW PostThreadMessage;
2566 alias WINAPI.PrintDlgW PrintDlg;
2567 alias WINAPI.RegEnumKeyExW RegEnumKeyEx;
2568 alias WINAPI.RegOpenKeyExW RegOpenKeyEx;
2569 alias WINAPI.RegQueryInfoKeyW RegQueryInfoKey;
2570 alias WINAPI.RegQueryValueExW RegQueryValueEx;
2571 alias WINAPI.RegisterClassW RegisterClass;
2572 alias WINAPI.RegisterClipboardFormatW RegisterClipboardFormat;
2573 alias WINAPI.RegOpenKeyExW RegOpenKeyEx;
2574 alias WINAPI.RegisterWindowMessageW RegisterWindowMessage;
2575 alias WINAPI.RemovePropW RemoveProp;
2576 alias DWTWINAPI.SHBrowseForFolderW SHBrowseForFolder;
2577 alias DWTWINAPI.SHGetPathFromIDListW SHGetPathFromIDList;
2578 alias WINAPI.SendMessageW SendMessage;
2579 alias WINAPI.SetMenuItemInfoW SetMenuItemInfo;
2580 alias WINAPI.SetWindowLongW SetWindowLong;
2581 alias WINAPI.SetWindowLongW SetWindowLongPtr;
2582 alias WINAPI.SetWindowTextW SetWindowText;
2583 alias WINAPI.SetWindowsHookExW SetWindowsHookEx;
2584 alias WINAPI.SetPropW SetProp;
2585 alias DWTWINAPI.ShellExecuteExW ShellExecuteEx;
2586 alias DWTWINAPI.Shell_NotifyIconW Shell_NotifyIcon;
2587 alias WINAPI.StartDocW StartDoc;
2588 alias WINAPI.SystemParametersInfoW SystemParametersInfo;
2589 alias WINAPI.TranslateAcceleratorW TranslateAccelerator;
2590 alias WINAPI.UnregisterClassW UnregisterClass;
2591 alias WINAPI.VkKeyScanW VkKeyScan;
2592 }
2593
2594
2595
2596
2597 // ----------------------------------------------------------------------------
2598 // UxTheme dummies until dynamic loading is in place.
2599 // ----------------------------------------------------------------------------
2600 public static extern(Windows) {
2601 BOOL function (
2602 ) IsAppThemed;
2603
2604 HRESULT function(
2605 HTHEME hTheme,
2606 HDC hdc,
2607 int iPartId,
2608 int iStateId,
2609 RECT *pRect,
2610 RECT *pClipRect
2611 ) DrawThemeBackground;
2612
2613 HRESULT function(
2614 HTHEME hTheme,
2615 HDC hdc,
2616 int iPartId,
2617 int iStateId,
2618 LPCRECT pDestRect,
2619 UINT uEdge,
2620 UINT uFlags,
2621 LPRECT pContentRect
2622 ) DrawThemeEdge;
2623
2624 HRESULT function(
2625 HTHEME hTheme,
2626 HDC hdc,
2627 int iPartId,
2628 int iStateId,
2629 LPCRECT pRect,
2630 HIMAGELIST himl,
2631 int iImageIndex
2632 ) DrawThemeIcon;
2633
2634 HRESULT function(
2635 HWND hwnd,
2636 HDC hdc,
2637 RECT *prc
2638 ) DrawThemeParentBackground;
2639
2640 HRESULT function(
2641 HTHEME hTheme,
2642 HDC hdc,
2643 int iPartId,
2644 int iStateId,
2645 LPCWSTR pszText,
2646 int iCharCount,
2647 DWORD dwTextFlags,
2648 DWORD dwTextFlags2,
2649 LPCRECT pRect
2650 ) DrawThemeText;
2651
2652 HTHEME function(
2653 HWND hwnd,
2654 LPCWSTR pszClassList
2655 ) OpenThemeData;
2656
2657 HRESULT function(
2658 )BufferedPaintInit;
2659
2660 HRESULT function(
2661 HTHEME hTheme
2662 ) CloseThemeData;
2663
2664 HRESULT function(
2665 ) BufferedPaintUnInit;
2666
2667 HPAINTBUFFER function(
2668 HDC hdcTarget,
2669 RECT *prcTarget,
2670 uint/+BP_BUFFERFORMAT+/ dwFormat,
2671 void*/+BP_PAINTPARAMS+/ pPaintParams,
2672 HDC *phdc
2673 ) BeginBufferedPaint;
2674
2675 HRESULT function(
2676 HPAINTBUFFER hBufferedPaint,
2677 BOOL fUpdateTarget
2678 ) EndBufferedPaint;
2679
2680 HRESULT function(
2681 HTHEME hTheme,
2682 HDC hdc,
2683 int iPartId,
2684 int iStateId,
2685 LPCWSTR pszText,
2686 int iCharCount,
2687 DWORD dwTextFlags,
2688 LPCRECT pBoundingRect,
2689 LPRECT pExtentRect
2690 ) GetThemeTextExtent;
2691
2692 HRESULT function(
2693 HWND hwnd,
2694 LPCWSTR pszSubAppName,
2695 LPCWSTR pszSubIdList
2696 ) SetWindowTheme;
2697
2698 } // public static
2699
2700 static Symbol[] Symbols_UxTheme = [
2701 { "IsAppThemed", cast(void**)& IsAppThemed, 5, 1 },
2702 { "DrawThemeBackground", cast(void**)& DrawThemeBackground, 5, 1 },
2703 { "DrawThemeEdge", cast(void**)& DrawThemeEdge, 5, 1 },
2704 { "DrawThemeIcon", cast(void**)& DrawThemeIcon, 5, 1 },
2705 { "DrawThemeParentBackground", cast(void**)& DrawThemeParentBackground, 5, 1 },
2706 { "DrawThemeText", cast(void**)& DrawThemeText, 5, 1 },
2707 { "OpenThemeData", cast(void**)& OpenThemeData, 5, 1 },
2708 { "CloseThemeData", cast(void**)& CloseThemeData, 5, 1 },
2709 { "GetThemeTextExtent", cast(void**)& GetThemeTextExtent, 5, 1 },
2710 { "SetWindowTheme", cast(void**)& SetWindowTheme, 5, 1 },
2711 { "BufferedPaintUnInit", cast(void**)& BufferedPaintUnInit, 6, 0 },
2712 { "BufferedPaintInit", cast(void**)& BufferedPaintInit, 6, 0 },
2713 { "BeginBufferedPaint", cast(void**)& BeginBufferedPaint, 6, 0 },
2714 { "EndBufferedPaint", cast(void**)& EndBufferedPaint, 6, 0 },
2715 ];
2716
2717 static void loadLib_UxTheme(){
2718 if (auto lib = SharedLib.load(`uxtheme.dll`)) {
2719 foreach( inout s; Symbols_UxTheme ){
2720 if( OS.WIN32_VERSION >= OS.VERSION( s.major, s.minor )){
2721 *s.symbol = lib.getSymbol( s.name.ptr );
2722 if( *s.symbol is null ){
2723 getDwtLogger.error("UxTheme.dll: Symbol '{}' not found", s.name );
2724 }
2725 }
2726 }
2727 } else {
2728 getDwtLogger.error("Could not load the library UxTheme.dll");
2729 }
2730 }
2731 //----------------------------------------------------------------------
2732 // Coreimm.lib (WinCE)
2733 // this function vars exist primarily for link error elimination
2734 //----------------------------------------------------------------------
2735 public static extern(Windows) {
2736
2737 BOOL function(
2738 HWND hwnd,
2739 COLORREF *pcrKey,
2740 BYTE *pbAlpha,
2741 DWORD *pdwFlags
2742 )GetLayeredWindowAttributes;
2743
2744 BOOL function(
2745 HWND hwnd,
2746 COLORREF crKey,
2747 BYTE bAlpha,
2748 DWORD dwFlags
2749 )SetLayeredWindowAttributes;
2750
2751 BOOL function(
2752 HWND hwnd, // Window to copy
2753 HDC hdcBlt, // HDC to print into
2754 UINT nFlags // Optional flags
2755 ) PrintWindow;
2756 } // public static extern(Windows)
2757
2758
2759 static Symbol[] Symbols_CoreImm = [
2760 ];
2761
2762 // user32.dll vista
2763 public static extern(Windows){
2764 BOOL function() SetProcessDPIAware;
2765 BOOL function( HWND hWnd )IsHungAppWindow;
2766 }
2767
2768 static Symbol[] Symbols_User32 = [
2769 { "SetProcessDPIAware", cast(void**)& SetProcessDPIAware, 6, 0 },
2770 { "GetLayeredWindowAttributes", cast(void**)& GetLayeredWindowAttributes, 5, 1 },
2771 { "SetLayeredWindowAttributes", cast(void**)& SetLayeredWindowAttributes, 5, 0 },
2772 { "PrintWindow", cast(void**)& PrintWindow, 5, 1 },
2773 { "IsHungAppWindow", cast(void**)& IsHungAppWindow, 5, 0 },
2774 ];
2775
2776 // Imm32.lib
2777 public static extern(Windows) {
2778 HIMC function( HWND hWnd ) ImmGetContext;
2779 BOOL function( DWORD idThread ) ImmDisableTextFrameService;
2780 HIMC function( HWND hWnd, HIMC hIMC ) ImmAssociateContext;
2781
2782 HIMC function() ImmCreateContext;
2783 int function( HIMC hIMC ) ImmDestroyContext;
2784 BOOL function( HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence ) ImmGetConversionStatus;
2785 HWND function( HWND hWnd ) ImmGetDefaultIMEWnd;
2786 BOOL function( HIMC hIMC ) ImmGetOpenStatus;
2787 BOOL function( HWND hWnd, HIMC hIMC ) ImmReleaseContext;
2788 version(ANSI) {
2789 BOOL function( HIMC hIMC, LOGFONTA* lplf ) ImmSetCompositionFont;
2790 LONG function( HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen ) ImmGetCompositionString;
2791 BOOL function( HIMC hIMC, LPLOGFONTA lplf ) ImmGetCompositionFont;
2792
2793 } else {
2794 BOOL function( HIMC hIMC, LOGFONTW* lplf ) ImmSetCompositionFont;
2795 LONG function( HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen ) ImmGetCompositionString;
2796 BOOL function( HIMC hIMC, LOGFONTW* lplf ) ImmGetCompositionFont;
2797 }
2798 BOOL function( HIMC hIMC, LPCOMPOSITIONFORM lpCompForm ) ImmSetCompositionWindow;
2799 BOOL function( HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence ) ImmSetConversionStatus;
2800 BOOL function( HIMC hIMC, BOOL fOpen ) ImmSetOpenStatus;
2801 BOOL function(
2802 HIMC hIMC,
2803 DWORD dwAction,
2804 DWORD dwIndex,
2805 DWORD dwValue
2806 )ImmNotifyIME;
2807
2808 LONG function(
2809 HIMC hIMC,
2810 DWORD dwIndex,
2811 LPVOID lpBuf,
2812 DWORD dwBufLen
2813 ) ImmGetCompositionStringA;
2814
2815 LONG function(
2816 HIMC hIMC,
2817 DWORD dwIndex,
2818 LPVOID lpBuf,
2819 DWORD dwBufLen
2820 ) ImmGetCompositionStringW;
2821
2822 BOOL function(
2823 HIMC hIMC,
2824 LPCANDIDATEFORM lpCandidate
2825 ) ImmSetCandidateWindow;
2826
2827 }
2828
2829 static Symbol[] Symbols_Imm32 = [
2830 { "ImmAssociateContext", cast(void**)& ImmAssociateContext, 5, 1 },
2831 { "ImmCreateContext", cast(void**)& ImmCreateContext, 5, 1 },
2832 { "ImmDestroyContext", cast(void**)& ImmDestroyContext, 5, 1 },
2833 { "ImmGetContext", cast(void**)& ImmGetContext, 5, 1 },
2834 { "ImmGetConversionStatus", cast(void**)& ImmGetConversionStatus, 5, 1 },
2835 { "ImmGetDefaultIMEWnd", cast(void**)& ImmGetDefaultIMEWnd, 5, 1 },
2836 { "ImmGetOpenStatus", cast(void**)& ImmGetOpenStatus, 5, 1 },
2837 { "ImmReleaseContext", cast(void**)& ImmReleaseContext, 5, 1 },
2838 { "ImmSetCompositionFontW", cast(void**)& ImmSetCompositionFont, 5, 1 },
2839 { "ImmGetCompositionStringW", cast(void**)& ImmGetCompositionString, 5, 1 },
2840 { "ImmGetCompositionFontW", cast(void**)& ImmGetCompositionFont, 5, 1 },
2841 { "ImmSetCompositionWindow", cast(void**)& ImmSetCompositionWindow, 5, 1 },
2842 { "ImmSetConversionStatus", cast(void**)& ImmSetConversionStatus, 5, 1 },
2843 { "ImmSetOpenStatus", cast(void**)& ImmSetOpenStatus, 5, 1 },
2844 { "ImmDisableTextFrameService", cast(void**)& ImmDisableTextFrameService, 5, 1 },
2845 { "ImmNotifyIME", cast(void**)& ImmNotifyIME, 5, 1 },
2846 { "ImmGetCompositionStringW", cast(void**)& ImmGetCompositionStringW, 5, 1 },
2847 { "ImmGetCompositionStringA", cast(void**)& ImmGetCompositionStringA, 5, 1 },
2848 { "ImmSetCandidateWindow", cast(void**)& ImmSetCandidateWindow, 5, 1 },
2849 ];
2850
2851 version(ANSI){
2852 }else{
2853 static Symbol[] Symbols_Kernel32 = [
2854 { "CreateActCtxW", cast(void**)& CreateActCtx, 5, 1 },
2855 { "ActivateActCtx", cast(void**)& ActivateActCtx, 5, 1 },
2856 { "GetSystemDefaultUILanguage", cast(void**)& GetSystemDefaultUILanguage, 5, 0 },
2857 { "EnumSystemLanguageGroupsW", cast(void**)& EnumSystemLanguageGroupsW, 4, 0 },
2858 { "EnumSystemLanguageGroupsA", cast(void**)& EnumSystemLanguageGroupsA, 4, 0 },
2859 { "EnumSystemLocalesW", cast(void**)& EnumSystemLocalesW, 4, 0 },
2860 { "EnumSystemLocalesA", cast(void**)& EnumSystemLocalesA, 4, 0 },
2861 ];
2862 }
2863
2864
2865 //------------------------------------------------------------------------
2866 /** All Natives */
2867 alias WINAPI.AbortDoc AbortDoc;
2868 alias WINAPI.ActivateKeyboardLayout ActivateKeyboardLayout;
2869 alias WINAPI.AdjustWindowRectEx AdjustWindowRectEx;
2870 alias DWTWINAPI.AlphaBlend AlphaBlend;
2871 alias WINAPI.Arc Arc;
2872 alias WINAPI.BeginDeferWindowPos BeginDeferWindowPos;
2873 alias WINAPI.BeginPaint BeginPaint;
2874 alias WINAPI.BeginPath BeginPath;
2875 alias WINAPI.BitBlt BitBlt;
2876 alias WINAPI.BringWindowToTop BringWindowToTop;
2877 alias WINAPI.CallNextHookEx CallNextHookEx;
2878 alias WINAPI.CallWindowProcA CallWindowProcA;
2879 alias WINAPI.CallWindowProcW CallWindowProcW;
2880 alias WINAPI.CharLowerA CharLowerA;
2881 alias WINAPI.CharLowerW CharLowerW;
2882 alias WINAPI.CharUpperA CharUpperA;
2883 alias WINAPI.CharUpperW CharUpperW;
2884 alias WINAPI.CheckMenuItem CheckMenuItem;
2885 alias WINAPI.ChooseColorA ChooseColorA;
2886 alias WINAPI.ChooseColorW ChooseColorW;
2887 alias WINAPI.ChooseFontA ChooseFontA;
2888 alias WINAPI.ChooseFontW ChooseFontW;
2889 alias WINAPI.ClientToScreen ClientToScreen;
2890 alias WINAPI.CloseHandle CloseHandle;
2891 alias WINAPI.CloseClipboard CloseClipboard;
2892 alias WINAPI.CloseEnhMetaFile CloseEnhMetaFile;
2893 alias WINAPI.CloseMetaFile CloseMetaFile;
2894 alias WINAPI.CombineRgn CombineRgn;
2895 alias DWTWINAPI.CommDlgExtendedError CommDlgExtendedError;
2896
2897 version(WinCE){
2898 alias WINAPI.CommandBar_AddAdornments CommandBar_AddAdornments;
2899 alias WINAPI.CommandBar_Create CommandBar_Create;
2900 alias WINAPI.CommandBar_Destroy CommandBar_Destroy;
2901 alias WINAPI.CommandBar_DrawMenuBar CommandBar_DrawMenuBar;
2902 alias WINAPI.CommandBar_Height CommandBar_Height;
2903 alias WINAPI.CommandBar_InsertMenubarEx CommandBar_InsertMenubarEx;
2904 alias WINAPI.CommandBar_Show CommandBar_Show;
2905 }
2906
2907 alias WINAPI.CopyImage CopyImage;
2908 alias WINAPI.CreateAcceleratorTableA CreateAcceleratorTableA;
2909 alias WINAPI.CreateAcceleratorTableW CreateAcceleratorTableW;
2910 alias WINAPI.CreateBitmap CreateBitmap;
2911 alias WINAPI.CreateCaret CreateCaret;
2912 alias WINAPI.CreateCompatibleBitmap CreateCompatibleBitmap;
2913 alias WINAPI.CreateCompatibleDC CreateCompatibleDC;
2914 alias WINAPI.CreateCursor CreateCursor;
2915 alias WINAPI.CreateDCA CreateDCA;
2916 alias WINAPI.CreateDCW CreateDCW;
2917 alias WINAPI.CreateDIBSection CreateDIBSection;
2918 alias WINAPI.CreateEventA CreateEventA;
2919 alias WINAPI.CreateEventW CreateEventW;
2920 alias WINAPI.CreateFileA CreateFileA;
2921 alias WINAPI.CreateFileW CreateFileW;
2922 alias WINAPI.CreateFontIndirectA CreateFontIndirectA;
2923 alias WINAPI.CreateFontIndirectW CreateFontIndirectW;
2924 alias WINAPI.CreateIconIndirect CreateIconIndirect;
2925 alias WINAPI.CreateMenu CreateMenu;
2926 alias WINAPI.CreatePalette CreatePalette;
2927 alias WINAPI.CreatePatternBrush CreatePatternBrush;
2928 alias WINAPI.CreatePen CreatePen;
2929 alias WINAPI.CreatePolygonRgn CreatePolygonRgn;
2930 alias WINAPI.CreatePopupMenu CreatePopupMenu;
2931 alias WINAPI.CreateRectRgn CreateRectRgn;
2932 alias WINAPI.CreateSolidBrush CreateSolidBrush;
2933 alias WINAPI.CreateWindowExA CreateWindowExA;
2934 alias WINAPI.CreateWindowExW CreateWindowExW;
2935 alias WINAPI.DefFrameProcA DefFrameProcA;
2936 alias WINAPI.DefFrameProcW DefFrameProcW;
2937 alias WINAPI.DefMDIChildProcA DefMDIChildProcA;
2938 alias WINAPI.DefMDIChildProcW DefMDIChildProcW;
2939 alias WINAPI.DefWindowProcA DefWindowProcA;
2940 alias WINAPI.DefWindowProcW DefWindowProcW;
2941 alias WINAPI.DeferWindowPos DeferWindowPos;
2942 alias WINAPI.DeleteDC DeleteDC;
2943 alias WINAPI.DeleteEnhMetaFile DeleteEnhMetaFile;
2944 alias WINAPI.DeleteMenu DeleteMenu;
2945 alias WINAPI.DeleteObject DeleteObject;
2946 alias WINAPI.DestroyAcceleratorTable DestroyAcceleratorTable;
2947 alias WINAPI.DestroyCaret DestroyCaret;
2948 alias WINAPI.DestroyCursor DestroyCursor;
2949 alias WINAPI.DestroyIcon DestroyIcon;
2950 alias WINAPI.DestroyMenu DestroyMenu;
2951 alias WINAPI.DestroyWindow DestroyWindow;
2952 alias WINAPI.DispatchMessageA DispatchMessageA;
2953 alias WINAPI.DispatchMessageW DispatchMessageW;
2954 alias WINAPI.DragDetect DragDetect;
2955 alias WINAPI.DragFinish DragFinish;
2956 alias WINAPI.DragQueryFileA DragQueryFileA;
2957 alias WINAPI.DragQueryFileW DragQueryFileW;
2958 alias WINAPI.DrawEdge DrawEdge;
2959 alias WINAPI.DrawFocusRect DrawFocusRect;
2960 alias WINAPI.DrawFrameControl DrawFrameControl;
2961 alias WINAPI.DrawIconEx DrawIconEx;
2962 alias WINAPI.DrawMenuBar DrawMenuBar;
2963 alias WINAPI.DrawStateA DrawStateA;
2964 alias WINAPI.DrawStateW DrawStateW;
2965 alias WINAPI.DrawTextA DrawTextA;
2966 alias WINAPI.DrawTextW DrawTextW;
2967 alias WINAPI.Ellipse Ellipse;
2968 alias WINAPI.EnableMenuItem EnableMenuItem;
2969 alias WINAPI.EnableScrollBar EnableScrollBar;
2970 alias WINAPI.EnableWindow EnableWindow;
2971 alias WINAPI.EndDeferWindowPos EndDeferWindowPos;
2972 alias WINAPI.EndDoc EndDoc;
2973 alias WINAPI.EndPage EndPage;
2974 alias WINAPI.EndPaint EndPaint;
2975 alias WINAPI.EndPath EndPath;
2976 alias WINAPI.EnumDisplayMonitors EnumDisplayMonitors;
2977 alias WINAPI.EnumEnhMetaFile EnumEnhMetaFile;
2978 alias WINAPI.EnumFontFamiliesA EnumFontFamiliesA;
2979 alias WINAPI.EnumFontFamiliesExA EnumFontFamiliesExA;
2980 alias WINAPI.EnumFontFamiliesExW EnumFontFamiliesExW;
2981 alias WINAPI.EnumFontFamiliesW EnumFontFamiliesW;
2982 alias DWTWINAPI.EqualRect EqualRect;
2983 alias WINAPI.EqualRgn EqualRgn;
2984 alias WINAPI.ExcludeClipRect ExcludeClipRect;
2985 alias WINAPI.ExpandEnvironmentStringsA ExpandEnvironmentStringsA;
2986 alias WINAPI.ExpandEnvironmentStringsW ExpandEnvironmentStringsW;
2987 alias WINAPI.ExtTextOutA ExtTextOutA;
2988 alias WINAPI.ExtTextOutW ExtTextOutW;
2989 alias DWTWINAPI.ExtractIconExA ExtractIconExA;
2990 alias DWTWINAPI.ExtractIconExW ExtractIconExW;
2991 alias WINAPI.ExtCreatePen ExtCreatePen;
2992 alias WINAPI.ExtCreateRegion ExtCreateRegion;
2993 alias WINAPI.FillRect FillRect;
2994 alias WINAPI.FindResourceA FindResourceA;
2995 alias WINAPI.FindResourceW FindResourceW;
2996 alias WINAPI.FindWindowA FindWindowA;
2997 alias WINAPI.FindWindowW FindWindowW;
2998 alias WINAPI.FormatMessageA FormatMessageA;
2999 alias WINAPI.FormatMessageW FormatMessageW;
3000 alias WINAPI.FreeLibrary FreeLibrary;
3001 alias WINAPI.GdiSetBatchLimit GdiSetBatchLimit;
3002 alias WINAPI.GetACP GetACP;
3003 alias WINAPI.GetAsyncKeyState GetAsyncKeyState;
3004 alias WINAPI.GetActiveWindow GetActiveWindow;
3005 alias WINAPI.GetBkColor GetBkColor;
3006 alias WINAPI.GetCapture GetCapture;
3007 alias WINAPI.GetCaretPos GetCaretPos;
3008 alias WINAPI.GetCharABCWidthsA GetCharABCWidthsA;
3009 alias WINAPI.GetCharABCWidthsW GetCharABCWidthsW;
3010 alias WINAPI.GetCharWidthA GetCharWidthA;
3011 alias WINAPI.GetCharWidthW GetCharWidthW;
3012 alias WINAPI.GetCharacterPlacementA GetCharacterPlacementA;
3013 alias WINAPI.GetCharacterPlacementW GetCharacterPlacementW;
3014 alias WINAPI.GetClassInfoA GetClassInfoA;
3015 alias WINAPI.GetClassInfoW GetClassInfoW;
3016 alias WINAPI.GetClientRect GetClientRect;
3017 alias WINAPI.GetClipBox GetClipBox;
3018 alias WINAPI.GetClipRgn GetClipRgn;
3019 alias WINAPI.GetClipboardData GetClipboardData;
3020 alias WINAPI.GetClipboardFormatNameA GetClipboardFormatNameA;
3021 alias WINAPI.GetClipboardFormatNameW GetClipboardFormatNameW;
3022 alias DWTWINAPI.GetComboBoxInfo GetComboBoxInfo;
3023 alias WINAPI.GetCurrentObject GetCurrentObject;
3024 alias WINAPI.GetCurrentProcessId GetCurrentProcessId;
3025 alias WINAPI.GetCurrentThreadId GetCurrentThreadId;
3026 alias WINAPI.GetCursor GetCursor;
3027 alias WINAPI.GetCursorPos GetCursorPos;
3028 alias WINAPI.GetDC GetDC;
3029 alias WINAPI.GetDCEx GetDCEx;
3030 alias WINAPI.GetDIBColorTable GetDIBColorTable;
3031 alias WINAPI.GetDIBits GetDIBits;
3032 alias WINAPI.GetDesktopWindow GetDesktopWindow;
3033 alias WINAPI.GetDeviceCaps GetDeviceCaps;
3034 alias WINAPI.GetDialogBaseUnits GetDialogBaseUnits;
3035 alias WINAPI.GetDlgItem GetDlgItem;
3036 alias WINAPI.GetDoubleClickTime GetDoubleClickTime;
3037 alias WINAPI.GetFocus GetFocus;
3038 alias WINAPI.GetFontLanguageInfo GetFontLanguageInfo;
3039 alias DWTWINAPI.GetGUIThreadInfo GetGUIThreadInfo;
3040 alias WINAPI.GetIconInfo GetIconInfo;
3041 alias WINAPI.GetKeyNameTextA GetKeyNameTextA;
3042 alias WINAPI.GetKeyNameTextW GetKeyNameTextW;
3043 alias WINAPI.GetKeyState GetKeyState;
3044 alias WINAPI.GetKeyboardLayout GetKeyboardLayout;
3045 alias WINAPI.GetKeyboardLayoutList GetKeyboardLayoutList;
3046 alias WINAPI.GetKeyboardState GetKeyboardState;
3047 alias WINAPI.GetLastActivePopup GetLastActivePopup;
3048 alias WINAPI.GetLastError GetLastError;
3049 alias DWTWINAPI.GetLayout GetLayout;
3050 alias WINAPI.GetLocaleInfoA GetLocaleInfoA;
3051 alias WINAPI.GetLocaleInfoW GetLocaleInfoW;
3052 alias WINAPI.GetMenu GetMenu;
3053 alias DWTWINAPI.GetMenuBarInfo GetMenuBarInfo;
3054 alias WINAPI.GetMenuDefaultItem GetMenuDefaultItem;
3055 alias DWTWINAPI.GetMenuInfo GetMenuInfo;
3056 alias WINAPI.GetMenuItemCount GetMenuItemCount;
3057 alias WINAPI.GetMenuItemInfoA GetMenuItemInfoA;
3058 alias WINAPI.GetMenuItemInfoW GetMenuItemInfoW;
3059 alias WINAPI.GetMenuItemRect GetMenuItemRect;
3060 alias WINAPI.GetMessageA GetMessageA;
3061 alias WINAPI.GetMessagePos GetMessagePos;
3062 alias WINAPI.GetMessageTime GetMessageTime;
3063 alias WINAPI.GetMetaRgn GetMetaRgn;
3064 alias WINAPI.GetMessageW GetMessageW;
3065 alias WINAPI.GetModuleFileNameA GetModuleFileNameA;
3066 alias WINAPI.GetModuleFileNameW GetModuleFileNameW;
3067 alias WINAPI.GetModuleHandleA GetModuleHandleA;
3068 alias WINAPI.GetModuleHandleW GetModuleHandleW;
3069 alias WINAPI.GetMonitorInfoA GetMonitorInfoA;
3070 alias DWTWINAPI.GetMonitorInfoW GetMonitorInfoW;
3071 alias WINAPI.GetNearestPaletteIndex GetNearestPaletteIndex;
3072 alias WINAPI.GetPath GetPath;
3073 alias WINAPI.GetObjectA GetObjectA;
3074 alias WINAPI.GetObjectW GetObjectW;
3075 alias WINAPI.GetOpenFileNameA GetOpenFileNameA;
3076 alias WINAPI.GetOpenFileNameW GetOpenFileNameW;
3077 alias WINAPI.GetPaletteEntries GetPaletteEntries;
3078 alias WINAPI.GetParent GetParent;
3079 alias WINAPI.GetPixel GetPixel;
3080 alias WINAPI.GetPolyFillMode GetPolyFillMode;
3081 alias WINAPI.GetProcAddress GetProcAddress;
3082 alias WINAPI.GetProcessHeap GetProcessHeap;
3083 alias WINAPI.GetProfileStringA GetProfileStringA;
3084 alias WINAPI.GetProfileStringW GetProfileStringW;
3085 alias WINAPI.GetROP2 GetROP2;
3086 alias DWTWINAPI.GetRandomRgn GetRandomRgn;
3087 alias WINAPI.GetRegionData GetRegionData;
3088 alias WINAPI.GetRgnBox GetRgnBox;
3089 alias WINAPI.GetSaveFileNameA GetSaveFileNameA;
3090 alias WINAPI.GetSaveFileNameW GetSaveFileNameW;
3091 alias WINAPI.GetScrollInfo GetScrollInfo;
3092 alias WINAPI.GetStockObject GetStockObject;
3093 alias WINAPI.GetSysColor GetSysColor;
3094 alias WINAPI.GetSysColorBrush GetSysColorBrush;
3095 //alias DWTWINAPI.GetSystemDefaultUILanguage GetSystemDefaultUILanguage;
3096 alias WINAPI.GetSystemMenu GetSystemMenu;
3097 alias WINAPI.GetSystemMetrics GetSystemMetrics;
3098 alias WINAPI.GetSystemPaletteEntries GetSystemPaletteEntries;
3099 alias WINAPI.GetTextCharset GetTextCharset;
3100 alias WINAPI.GetTextColor GetTextColor;
3101 alias WINAPI.GetTextExtentPoint32A GetTextExtentPoint32A;
3102 alias WINAPI.GetTextExtentPoint32W GetTextExtentPoint32W;
3103 alias WINAPI.GetTextMetricsA GetTextMetricsA;
3104 alias WINAPI.GetTextMetricsW GetTextMetricsW;
3105 alias WINAPI.GetTickCount GetTickCount;
3106 alias WINAPI.GetUpdateRect GetUpdateRect;
3107 alias WINAPI.GetUpdateRgn GetUpdateRgn;
3108 alias WINAPI.GetVersion GetVersion;
3109 alias WINAPI.GetVersionExA GetVersionExA;
3110 alias WINAPI.GetVersionExW GetVersionExW;
3111 alias WINAPI.GetWindow GetWindow;
3112 alias WINAPI.GetWindowDC GetWindowDC;
3113 alias WINAPI.GetWindowOrgEx GetWindowOrgEx;
3114 alias WINAPI.GetWindowLongA GetWindowLongA;
3115 alias WINAPI.GetWindowLongW GetWindowLongW;
3116 alias WINAPI.GetWindowPlacement GetWindowPlacement;
3117 alias WINAPI.GetWindowRect GetWindowRect;
3118 alias WINAPI.GetWindowRgn GetWindowRgn;
3119 alias WINAPI.GetWindowTextA GetWindowTextA;
3120 alias WINAPI.GetWindowTextLengthA GetWindowTextLengthA;
3121 alias WINAPI.GetWindowTextLengthW GetWindowTextLengthW;
3122 alias WINAPI.GetWindowTextW GetWindowTextW;
3123 alias WINAPI.GetWindowThreadProcessId GetWindowThreadProcessId;
3124 alias WINAPI.GlobalAlloc GlobalAlloc;
3125 alias WINAPI.GlobalFree GlobalFree;
3126 alias WINAPI.GlobalLock GlobalLock;
3127 alias WINAPI.GlobalSize GlobalSize;
3128 alias WINAPI.GlobalUnlock GlobalUnlock;
3129 alias DWTWINAPI.GradientFill GradientFill;
3130 alias WINAPI.HeapAlloc HeapAlloc;
3131 alias WINAPI.HeapFree HeapFree;
3132 alias WINAPI.HideCaret HideCaret;
3133 alias DWTWINAPI.IIDFromString IIDFromString;
3134 alias WINAPI.ImageList_Add ImageList_Add;
3135 alias WINAPI.ImageList_AddMasked ImageList_AddMasked;
3136 alias WINAPI.ImageList_BeginDrag ImageList_BeginDrag;
3137 alias WINAPI.ImageList_Create ImageList_Create;
3138 alias WINAPI.ImageList_Destroy ImageList_Destroy;
3139 alias WINAPI.ImageList_DragEnter ImageList_DragEnter;
3140 alias WINAPI.ImageList_DragLeave ImageList_DragLeave;
3141 alias WINAPI.ImageList_DragMove ImageList_DragMove;
3142 alias WINAPI.ImageList_DragShowNolock ImageList_DragShowNolock;
3143 alias WINAPI.ImageList_Draw ImageList_Draw;
3144 alias WINAPI.ImageList_EndDrag ImageList_EndDrag;
3145 alias WINAPI.ImageList_GetIcon ImageList_GetIcon;
3146 alias WINAPI.ImageList_GetIconSize ImageList_GetIconSize;
3147 alias WINAPI.ImageList_GetImageCount ImageList_GetImageCount;
3148 alias WINAPI.ImageList_Remove ImageList_Remove;
3149 alias WINAPI.ImageList_Replace ImageList_Replace;
3150 alias WINAPI.ImageList_ReplaceIcon ImageList_ReplaceIcon;
3151 alias WINAPI.ImageList_SetIconSize ImageList_SetIconSize;
3152 // alias WINAPI.ImmAssociateContext ImmAssociateContext;
3153 // alias WINAPI.ImmCreateContext ImmCreateContext;
3154 // alias WINAPI.ImmDestroyContext ImmDestroyContext;
3155 // alias WINAPI.ImmGetCompositionFontA ImmGetCompositionFontA;
3156 // alias WINAPI.ImmGetCompositionFontW ImmGetCompositionFontW;
3157 // alias WINAPI.ImmGetCompositionStringA ImmGetCompositionStringA;
3158 // alias WINAPI.ImmGetCompositionStringW ImmGetCompositionStringW;
3159 // alias WINAPI.ImmGetContext ImmGetContext;
3160 // alias WINAPI.ImmGetConversionStatus ImmGetConversionStatus;
3161 // alias WINAPI.ImmGetDefaultIMEWnd ImmGetDefaultIMEWnd;
3162 // alias WINAPI.ImmGetOpenStatus ImmGetOpenStatus;
3163 // alias WINAPI.ImmReleaseContext ImmReleaseContext;
3164 // alias WINAPI.ImmSetCompositionFontA ImmSetCompositionFontA;
3165 // alias WINAPI.ImmSetCompositionFontW ImmSetCompositionFontW;
3166 // alias WINAPI.ImmSetOpenStatus ImmSetOpenStatus;
3167 alias WINAPI.InitCommonControls InitCommonControls;
3168 alias DWTWINAPI.InitCommonControlsEx InitCommonControlsEx;
3169 alias WINAPI.InsertMenuA InsertMenuA;
3170 alias WINAPI.InsertMenuItemA InsertMenuItemA;
3171 alias WINAPI.InsertMenuItemW InsertMenuItemW;
3172 alias WINAPI.InsertMenuW InsertMenuW;
3173 alias WINAPI.InterlockedDecrement InterlockedDecrement;
3174 alias WINAPI.InterlockedIncrement InterlockedIncrement;
3175 alias WINAPI.IntersectClipRect IntersectClipRect;
3176 alias WINAPI.IntersectRect IntersectRect;
3177 alias WINAPI.InvalidateRect InvalidateRect;
3178 alias WINAPI.InvalidateRgn InvalidateRgn;
3179 alias WINAPI.IsDBCSLeadByte IsDBCSLeadByte;
3180 //alias DWTWINAPI.IsHungAppWindow IsHungAppWindow;
3181 alias WINAPI.IsIconic IsIconic;
3182 alias WINAPI.IsWindow IsWindow;
3183 alias WINAPI.IsWindowEnabled IsWindowEnabled;
3184 alias WINAPI.IsWindowVisible IsWindowVisible;
3185 alias WINAPI.IsZoomed IsZoomed;
3186 alias WINAPI.KillTimer KillTimer;
3187 alias WINAPI.LineTo LineTo;
3188 alias WINAPI.LoadBitmapA LoadBitmapA;
3189 alias WINAPI.LoadBitmapW LoadBitmapW;
3190 alias WINAPI.LoadCursorA LoadCursorA;
3191 alias WINAPI.LoadCursorW LoadCursorW;
3192 alias WINAPI.LoadIconA LoadIconA;
3193 alias WINAPI.LoadIconW LoadIconW;
3194 alias WINAPI.LoadImageA LoadImageA;
3195 alias WINAPI.LoadImageW LoadImageW;
3196 alias WINAPI.LoadLibraryA LoadLibraryA;
3197 alias WINAPI.LoadLibraryW LoadLibraryW;
3198 alias WINAPI.LoadResource LoadResource;
3199 alias WINAPI.LoadStringA LoadStringA;
3200 alias WINAPI.LoadStringW LoadStringW;
3201 alias WINAPI.LocalFree LocalFree;
3202 alias WINAPI.LockResource LockResource;
3203 alias WINAPI.MapVirtualKeyA MapVirtualKeyA;
3204 alias WINAPI.MapVirtualKeyW MapVirtualKeyW;
3205 alias WINAPI.MapWindowPoints MapWindowPoints;
3206 alias WINAPI.MessageBeep MessageBeep;
3207 alias WINAPI.MessageBoxA MessageBoxA;
3208 alias WINAPI.MessageBoxW MessageBoxW;
3209 alias DWTWINAPI.MonitorFromWindow MonitorFromWindow;
3210 alias WINAPI.MoveToEx MoveToEx;
3211 alias DWTWINAPI.MsgWaitForMultipleObjectsEx MsgWaitForMultipleObjectsEx;
3212 alias WINAPI.MultiByteToWideChar MultiByteToWideChar;
3213 alias DWTWINAPI.NotifyWinEvent NotifyWinEvent;
3214 alias WINAPI.OffsetRect OffsetRect;
3215 alias WINAPI.OffsetRgn OffsetRgn;
3216 //alias WINAPI.OleInitialize OleInitialize;
3217 //alias WINAPI.OleUninitialize OleUninitialize;
3218 alias WINAPI.OpenClipboard OpenClipboard;
3219 alias WINAPI.OutputDebugStringA OutputDebugStringA;
3220 alias WINAPI.OutputDebugStringW OutputDebugStringW;
3221 alias WINAPI.PatBlt PatBlt;
3222 alias WINAPI.PeekMessageA PeekMessageA;
3223 alias WINAPI.PeekMessageW PeekMessageW;
3224 alias WINAPI.Pie Pie;
3225 alias WINAPI.Polygon Polygon;
3226 alias WINAPI.Polyline Polyline;
3227 alias WINAPI.PostMessageA PostMessageA;
3228 alias WINAPI.PostMessageW PostMessageW;
3229 alias WINAPI.PostThreadMessageA PostThreadMessageA;
3230 alias WINAPI.PostThreadMessageW PostThreadMessageW;
3231 alias WINAPI.PrintDlgA PrintDlgA;
3232 alias WINAPI.PrintDlgW PrintDlgW;
3233 alias WINAPI.PtInRect PtInRect;
3234 alias WINAPI.PtInRegion PtInRegion;
3235 alias WINAPI.RealizePalette RealizePalette;
3236 alias WINAPI.Rectangle Rectangle;
3237 alias WINAPI.RectInRegion RectInRegion;
3238 // <Shawn> Renamed : may conflict with org.eclipse.swt.graphics.rectangle.Rectangle
3239 alias WINAPI.Rectangle _Rectangle;
3240 alias WINAPI.RedrawWindow RedrawWindow;
3241 alias WINAPI.RegCloseKey RegCloseKey;
3242 alias WINAPI.RegEnumKeyExA RegEnumKeyExA;
3243 alias WINAPI.RegEnumKeyExW RegEnumKeyExW;
3244 alias WINAPI.RegOpenKeyExA RegOpenKeyExA;
3245 alias WINAPI.RegOpenKeyExW RegOpenKeyExW;
3246 alias WINAPI.RegQueryInfoKeyA RegQueryInfoKeyA;
3247 alias WINAPI.RegQueryInfoKeyW RegQueryInfoKeyW;
3248 alias WINAPI.RegQueryValueExA RegQueryValueExA;
3249 alias WINAPI.RegQueryValueExW RegQueryValueExW;
3250 alias WINAPI.RegisterClassA RegisterClassA;
3251 alias WINAPI.RegisterClassW RegisterClassW;
3252 alias WINAPI.RegisterClipboardFormatA RegisterClipboardFormatA;
3253 alias WINAPI.RegisterClipboardFormatW RegisterClipboardFormatW;
3254 alias WINAPI.RegisterWindowMessageA RegisterWindowMessageA;
3255 alias WINAPI.RegisterWindowMessageW RegisterWindowMessageW;
3256 alias WINAPI.ReleaseCapture ReleaseCapture;
3257 alias WINAPI.ReleaseDC ReleaseDC;
3258 alias WINAPI.RemoveMenu RemoveMenu;
3259 alias WINAPI.RestoreDC RestoreDC;
3260 alias WINAPI.RoundRect RoundRect;
3261 alias DWTWINAPI.RtlMoveMemory MoveMemory;
3262 alias DWTWINAPI.SHBrowseForFolderA SHBrowseForFolderA;
3263 alias DWTWINAPI.SHBrowseForFolderW SHBrowseForFolderW;
3264 version(WinCE){
3265 alias WINAPI.SHCreateMenuBar SHCreateMenuBar;
3266 }
3267 alias DWTWINAPI.SHGetMalloc SHGetMalloc;
3268 alias DWTWINAPI.SHGetPathFromIDListA SHGetPathFromIDListA;
3269 alias DWTWINAPI.SHGetPathFromIDListW SHGetPathFromIDListW;
3270 version(WinCE)
3271 {
3272 alias WINAPI.SHHandleWMSettingChange SHHandleWMSettingChange;
3273 alias WINAPI.SHRecognizeGesture SHRecognizeGesture;
3274 alias WINAPI.SHSendBackToFocusWindow SHSendBackToFocusWindow;
3275 alias WINAPI.SHSetAppKeyWndAssoc SHSetAppKeyWndAssoc;
3276 alias WINAPI.SHSipPreference SHSipPreference;
3277 }
3278 alias WINAPI.SaveDC SaveDC;
3279 alias WINAPI.ScreenToClient ScreenToClient;
3280 alias DWTWINAPI.ScriptApplyDigitSubstitution ScriptApplyDigitSubstitution;
3281 alias DWTWINAPI.ScriptBreak ScriptBreak;
3282 alias DWTWINAPI.ScriptCPtoX ScriptCPtoX;
3283 alias DWTWINAPI.ScriptCacheGetHeight ScriptCacheGetHeight;
3284 alias DWTWINAPI.ScriptFreeCache ScriptFreeCache;
3285 alias DWTWINAPI.ScriptGetFontProperties ScriptGetFontProperties;
3286 alias DWTWINAPI.ScriptGetLogicalWidths ScriptGetLogicalWidths;
3287 alias DWTWINAPI.ScriptGetProperties ScriptGetProperties;
3288 alias DWTWINAPI.ScriptItemize ScriptItemize;
3289 alias DWTWINAPI.ScriptJustify ScriptJustify;
3290 alias DWTWINAPI.ScriptLayout ScriptLayout;
3291 alias DWTWINAPI.ScriptPlace ScriptPlace;
3292 alias DWTWINAPI.ScriptRecordDigitSubstitution ScriptRecordDigitSubstitution;
3293 alias DWTWINAPI.ScriptGetCMap ScriptGetCMap;
3294 alias DWTWINAPI.ScriptShape ScriptShape;
3295 alias DWTWINAPI.ScriptStringAnalyse ScriptStringAnalyse;
3296 alias DWTWINAPI.ScriptStringOut ScriptStringOut;
3297 alias DWTWINAPI.ScriptStringFree ScriptStringFree;
3298 alias DWTWINAPI.ScriptTextOut ScriptTextOut;
3299 alias DWTWINAPI.ScriptXtoCP ScriptXtoCP;
3300 alias WINAPI.ScrollWindowEx ScrollWindowEx;
3301 alias WINAPI.SelectClipRgn SelectClipRgn;
3302 alias WINAPI.SelectObject SelectObject;
3303 alias WINAPI.SelectPalette SelectPalette;
3304 alias DWTWINAPI.SendInput SendInput;
3305 alias WINAPI.SendMessageA SendMessageA;
3306 alias WINAPI.SendMessageW SendMessageW;
3307 alias WINAPI.SetActiveWindow SetActiveWindow;
3308 alias WINAPI.SetBkColor SetBkColor;
3309 alias WINAPI.SetBkMode SetBkMode;
3310 alias WINAPI.SetBrushOrgEx SetBrushOrgEx;
3311 alias WINAPI.SetCapture SetCapture;
3312 alias WINAPI.SetCaretPos SetCaretPos;
3313 alias WINAPI.SetClipboardData SetClipboardData;
3314 alias WINAPI.SetCursor SetCursor;
3315 alias WINAPI.SetCursorPos SetCursorPos;
3316 alias WINAPI.SetDIBColorTable SetDIBColorTable;
3317 alias WINAPI.SetErrorMode SetErrorMode;
3318 alias WINAPI.SetEvent SetEvent;
3319 alias WINAPI.SetFocus SetFocus;
3320 alias WINAPI.SetForegroundWindow SetForegroundWindow;
3321 alias WINAPI.SetGraphicsMode SetGraphicsMode;
3322 alias WINAPI.SetLastError SetLastError;
3323 alias DWTWINAPI.SetLayout SetLayout;
3324 alias WINAPI.SetMenu SetMenu;
3325 alias WINAPI.SetMenuDefaultItem SetMenuDefaultItem;
3326 alias DWTWINAPI.SetMenuInfo SetMenuInfo;
3327 alias WINAPI.SetMenuItemInfoA SetMenuItemInfoA;
3328 alias WINAPI.SetMenuItemInfoW SetMenuItemInfoW;
3329 alias WINAPI.SetMetaRgn SetMetaRgn;
3330 alias WINAPI.SetPaletteEntries SetPaletteEntries;
3331 alias WINAPI.SetParent SetParent;
3332 alias WINAPI.SetPixel SetPixel;
3333 alias WINAPI.SetPolyFillMode SetPolyFillMode;
3334 alias WINAPI.SetROP2 SetROP2;
3335 alias WINAPI.SetRect SetRect;
3336 alias WINAPI.SetRectRgn SetRectRgn;
3337 alias WINAPI.SetScrollInfo SetScrollInfo;
3338 alias WINAPI.SetStretchBltMode SetStretchBltMode;
3339 alias WINAPI.SetTextAlign SetTextAlign;
3340 alias WINAPI.SetTextColor SetTextColor;
3341 alias WINAPI.SetTimer SetTimer;
3342 alias WINAPI.SetWindowLongA SetWindowLongA;
3343 alias WINAPI.SetWindowLongW SetWindowLongW;
3344 alias WINAPI.SetWindowOrgEx SetWindowOrgEx;
3345 alias WINAPI.SetWindowPlacement SetWindowPlacement;
3346 alias WINAPI.SetWindowPos SetWindowPos;
3347 alias WINAPI.SetWindowRgn SetWindowRgn;
3348 alias WINAPI.SetWorldTransform SetWorldTransform;
3349 alias WINAPI.SetWindowTextA SetWindowTextA;
3350 alias WINAPI.SetWindowTextW SetWindowTextW;
3351 alias WINAPI.SetWindowsHookExA SetWindowsHookExA;
3352 alias WINAPI.SetWindowsHookExW SetWindowsHookExW;
3353 alias DWTWINAPI.ShellExecuteExA ShellExecuteExA;
3354 alias DWTWINAPI.ShellExecuteExW ShellExecuteExW;
3355 alias DWTWINAPI.Shell_NotifyIconA Shell_NotifyIconA;
3356 alias DWTWINAPI.Shell_NotifyIconW Shell_NotifyIconW;
3357 alias WINAPI.SHGetFileInfo SHGetFileInfo;
3358 alias WINAPI.ShowCaret ShowCaret;
3359 alias WINAPI.ShowOwnedPopups ShowOwnedPopups;
3360 alias WINAPI.ShowScrollBar ShowScrollBar;
3361 alias WINAPI.ShowWindow ShowWindow;
3362 version(WinCE){
3363 alias WINAPI.SipGetInfo SipGetInfo;
3364 }
3365 alias WINAPI.SizeofResource SizeofResource;
3366 alias WINAPI.Sleep Sleep;
3367 alias WINAPI.StartDocA StartDocA;
3368 alias WINAPI.StartDocW StartDocW;
3369 alias WINAPI.StartPage StartPage;
3370 alias WINAPI.StretchBlt StretchBlt;
3371 alias WINAPI.SystemParametersInfoA SystemParametersInfoA;
3372 alias WINAPI.SystemParametersInfoW SystemParametersInfoW;
3373 alias WINAPI.ToAscii ToAscii;
3374 alias WINAPI.ToUnicode ToUnicode;
3375 alias DWTWINAPI.TrackMouseEvent TrackMouseEvent;
3376 alias WINAPI.TrackPopupMenu TrackPopupMenu;
3377 alias WINAPI.TranslateAcceleratorA TranslateAcceleratorA;
3378 alias WINAPI.TranslateAcceleratorW TranslateAcceleratorW;
3379 alias WINAPI.TranslateCharsetInfo TranslateCharsetInfo;
3380 alias WINAPI.TranslateMDISysAccel TranslateMDISysAccel;
3381 alias WINAPI.TranslateMessage TranslateMessage;
3382 alias DWTWINAPI.TransparentBlt TransparentBlt;
3383 version(WinCE){
3384 alias WINAPI.TransparentImage TransparentImage;
3385 }
3386 alias WINAPI.UnhookWindowsHookEx UnhookWindowsHookEx;
3387 alias WINAPI.UnregisterClassA UnregisterClassA;
3388 alias WINAPI.UnregisterClassW UnregisterClassW;
3389 alias WINAPI.UpdateWindow UpdateWindow;
3390 alias WINAPI.ValidateRect ValidateRect;
3391 alias WINAPI.VkKeyScanA VkKeyScanA;
3392 alias WINAPI.VkKeyScanW VkKeyScanW;
3393 alias WINAPI.WaitForMultipleObjects WaitForMultipleObjects;
3394 alias WINAPI.WaitForSingleObject WaitForSingleObject;
3395 alias WINAPI.WaitMessage WaitMessage;
3396 alias WINAPI.WideCharToMultiByte WideCharToMultiByte;
3397 alias WINAPI.WindowFromDC WindowFromDC;
3398 alias WINAPI.WindowFromPoint WindowFromPoint;
3399 alias DWTWINAPI.wcslen wcslen;
3400
3401 public static int VERSION (int major, int minor) { return major << 16 | minor;}
3402
3403 //static int DrawText(int hDC, String lpString, RECT* lpRect, int uFormat){
3404 // return WINAPI.DrawText(hDC, Convert.StringToTCHARz(lpString), lpString.length, lpRect, uFormat);
3405 //}
3406 //
3407 //static int DrawText(int hDC, TCHAR* lpString, int length, RECT* lpRect, int uFormat){
3408 // return WINAPI.DrawText(hDC, lpString, length, lpRect, uFormat);
3409 //}
3410
3411 static int GetProfileString(char[] lpAppName, char[] lpKeyName, char[] lpDefault, out char[] lpReturnedString, int nSize ){
3412 TCHAR[] buffer = new TCHAR[nSize];
3413 int result = _GetProfileString(.StrToTCHARz(lpAppName), .StrToTCHARz(lpKeyName), .StrToTCHARz(lpDefault), buffer.ptr, nSize);
3414 lpReturnedString = .TCHARzToStr(buffer.ptr);
3415 return result;
3416 }
3417
3418 static char[] GetWindowText(HWND hwnd){
3419 assert(hwnd);
3420 int len = GetWindowTextLength(hwnd);
3421 if(len > 0){
3422 TCHAR[] buffer = new TCHAR[len + 1];
3423 len = _GetWindowText(hwnd, buffer.ptr, buffer.length);
3424 return .TCHARzToStr(buffer.ptr, len);
3425 }
3426 return "";
3427 }
3428
3429 // Note: nMaxCount including the NULL character
3430 static int GetWindowText(HWND hWnd, TCHAR* lpString, int nMaxCount)
3431 {
3432 return _GetWindowText(hWnd, lpString, nMaxCount);
3433 }
3434
3435 // <Shawn Liu> added this method, copied from ATL : atlwin.h
3436 static int CenterWindow(HWND m_hWnd, HWND hWndCenter = null)
3437 {
3438 assert(m_hWnd);
3439
3440 // determine owner window to center against
3441 uint dwStyle = OS.GetWindowLong(m_hWnd, OS.GWL_STYLE);
3442 if(hWndCenter is null)
3443 {
3444 if(dwStyle & OS.WS_CHILD)
3445 hWndCenter = OS.GetParent(m_hWnd);
3446 else
3447 hWndCenter = OS.GetWindow(m_hWnd, OS.GW_OWNER);
3448 }
3449
3450 // get coordinates of the window relative to its parent
3451 RECT rcDlg;
3452 OS.GetWindowRect(m_hWnd, &rcDlg);
3453 RECT rcArea;
3454 RECT rcCenter;
3455 HWND hWndParent;
3456 if(!(dwStyle & OS.WS_CHILD))
3457 {
3458 // don't center against invisible or minimized WINAPI
3459 if(hWndCenter !is null)
3460 {
3461 uint dwStyleCenter = OS.GetWindowLong(hWndCenter, OS.GWL_STYLE);
3462 if(!(dwStyleCenter & OS.WS_VISIBLE) || (dwStyleCenter & OS.WS_MINIMIZE))
3463 hWndCenter = null;
3464 }
3465
3466 // center within screen coordinates
3467 OS.SystemParametersInfo(OS.SPI_GETWORKAREA, 0, &rcArea, 0);
3468 if(hWndCenter is null)
3469 rcCenter = rcArea;
3470 else
3471 OS.GetWindowRect(hWndCenter, &rcCenter);
3472 }
3473 else
3474 {
3475 // center within parent client coordinates
3476 hWndParent = OS.GetParent(m_hWnd);
3477 assert(OS.IsWindow(hWndParent));
3478
3479 OS.GetClientRect(hWndParent, &rcArea);
3480 assert(OS.IsWindow(hWndCenter));
3481 OS.GetClientRect(hWndCenter, &rcCenter);
3482 OS.MapWindowPoints(hWndCenter, hWndParent, cast(POINT*)&rcCenter, 2);
3483 }
3484
3485 int DlgWidth = rcDlg.right - rcDlg.left;
3486 int DlgHeight = rcDlg.bottom - rcDlg.top;
3487
3488 // find dialog's upper left based on rcCenter
3489 int xLeft = (rcCenter.left + rcCenter.right) / 2 - DlgWidth / 2;
3490 int yTop = (rcCenter.top + rcCenter.bottom) / 2 - DlgHeight / 2;
3491
3492 // if the dialog is outside the screen, move it inside
3493 if(xLeft < rcArea.left)
3494 xLeft = rcArea.left;
3495 else if(xLeft + DlgWidth > rcArea.right)
3496 xLeft = rcArea.right - DlgWidth;
3497
3498 if(yTop < rcArea.top)
3499 yTop = rcArea.top;
3500 else if(yTop + DlgHeight > rcArea.bottom)
3501 yTop = rcArea.bottom - DlgHeight;
3502
3503 // map screen coordinates to child coordinates
3504 return OS.SetWindowPos(m_hWnd, null, xLeft, yTop, -1, -1,
3505 OS.SWP_NOSIZE | OS.SWP_NOZORDER | OS.SWP_NOACTIVATE);
3506 }
3507
3508
3509 alias DWTWINAPI.OleInitialize OleInitialize;
3510 alias DWTWINAPI.OleUninitialize OleUninitialize;
3511 alias DWTWINAPI.CoCreateInstance CoCreateInstance;
3512
3513 /**
3514 * <Shawn Liu>
3515 * VtbCall partially kept, use VtbCall instead of automation can promote performace
3516 * and VtbCall doesn't need prototype of interface declaration
3517 */
3518
3519 public static int VtblCall(int fnNumber, void* ppVtbl) {
3520 Function1 fn = cast(Function1)(*cast(int **)ppVtbl)[fnNumber];
3521 return fn(ppVtbl);
3522 }
3523
3524 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0){
3525 Function2 fn = cast(Function2)(*cast(int **)ppVtbl)[fnNumber];
3526 return fn(ppVtbl, arg0);
3527 }
3528
3529 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1){
3530 Function3 fn = cast(Function3)(*cast(int **)ppVtbl)[fnNumber];
3531 return fn(ppVtbl, arg0, arg1);
3532 }
3533
3534 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1, int arg2){
3535 Function4 fn = cast(Function4)(*cast(int **)ppVtbl)[fnNumber];
3536 return fn(ppVtbl, arg0, arg1, arg2);
3537 }
3538 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1, int arg2, int arg3){
3539 Function5 fn = cast(Function5)(*cast(int **)ppVtbl)[fnNumber];
3540 return fn(ppVtbl, arg0, arg1, arg2, arg3);
3541 }
3542
3543 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4){
3544 Function6 fn = cast(Function6)(*cast(int **)ppVtbl)[fnNumber];
3545 return fn(ppVtbl, arg0, arg1, arg2, arg3, arg4);
3546 }
3547
3548 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5){
3549 Function7 fn = cast(Function7)(*cast(int **)ppVtbl)[fnNumber];
3550 return fn(ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5);
3551 }
3552
3553 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6){
3554 Function8 fn = cast(Function8)(*cast(int **)ppVtbl)[fnNumber];
3555 return fn(ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
3556 }
3557
3558 public static int VtblCall(int fnNumber, void* ppVtbl, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7){
3559 Function9 fn = cast(Function9)(*cast(int **)ppVtbl)[fnNumber];
3560 return fn(ppVtbl, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
3561 }
3562
3563 public static int LOWORD (int /*long*/ l){
3564 return l & 0xFFFF;
3565 }
3566 public static int HIWORD (int /*long*/ h){
3567 return h >>> 16;
3568 }
3569 //public static bool LPtoDP (int /*long*/ hdc, POINT lpPoints, int nCount);
3570 public static int MAKEWORD(int l, int h){
3571 return ( h << 16 )|( l &0xFFFF );
3572 }
3573 public static int MAKELONG( int low, int high){
3574 return (low & 0xFFFF) | (high << 16);
3575 }
3576 public static int /*long*/ MAKEWPARAM(int l, int h){
3577 return MAKELONG( l, h );
3578 }
3579 public static int /*long*/ MAKELPARAM(int l, int h){
3580 return MAKELONG( l, h );
3581 }
3582 public static int /*long*/ MAKELRESULT(int l, int h){
3583 return MAKELONG( l, h );
3584 }
3585 public static int GET_WHEEL_DELTA_WPARAM(int /*long*/ wParam){
3586 return cast(short) HIWORD(wParam);
3587 }
3588
3589 public static int GET_X_LPARAM(int /*long*/ lp){
3590 return cast(short) (lp & 0xFFFF);
3591 }
3592
3593 public static int GET_Y_LPARAM(int /*long*/ lp){
3594 return cast(short) (lp >> 16);
3595 }
3596
3597 static bool TreeView_GetItemRect( HWND hwnd, HTREEITEM hitem, RECT* prc, bool code) {
3598 *cast(HTREEITEM *)prc = hitem;
3599 return cast(bool) SendMessage( hwnd, TVM_GETITEMRECT, code, cast(int)prc );
3600 }
3601 static int strlen( PCHAR ptr ){
3602 return tango.stdc.string.strlen( cast(char*)ptr );
3603 }
3604
3605 static void POINTSTOPOINT( inout POINT pt, int pts) {
3606 pt.x = cast(SHORT) LOWORD(pts);
3607 pt.y = cast(SHORT) HIWORD(pts);
3608 }
3609
3610 alias DWTWINAPI.GetScrollBarInfo GetScrollBarInfo;
3611 } // END of OS
3612 //-----------------------------------------------------------------------------
3613 import tango.sys.win32.CodePage : CodePage;
3614 private import tango.text.convert.Utf;
3615 private import tango.stdc.stringz;
3616
3617 // convert UTF-8 to MBCS
3618 alias StrToMBCS StrToMBCSs;
3619 public CHAR[] StrToMBCS(char[] sc, uint codepage = 0) {
3620 CHAR[] ret = cast(CHAR[]) sc;
3621 try{
3622 foreach (char c; sc){
3623 if (c >= 0x80)
3624 {
3625 CHAR[] result;
3626 int i;
3627 wchar[] ws = .toString16(sc);
3628 result.length = OS.WideCharToMultiByte(codepage, 0, ws.ptr, ws.length, null, 0, null, null);
3629 i = OS.WideCharToMultiByte(codepage, 0, ws.ptr, ws.length, result.ptr, result.length, null, null);
3630 assert(i == result.length);
3631 return result;
3632 }
3633 }
3634 }catch(Exception e){
3635 // do nothing
3636 ret = null;
3637 }
3638 return ret;
3639 }
3640
3641 // convert UTF-8 to MBCSz
3642 public char* StrToMBCSz(char[] sc) {
3643 char* ret = null;
3644 try{
3645 if( CodePage.isAscii( sc )){
3646 return .toStringz( sc );
3647 }
3648 char[] dst;
3649 dst.length = sc.length;
3650 return toStringz( tango.sys.win32.CodePage.CodePage.into( sc, dst ));
3651 }catch(Exception e){
3652 // do nothing
3653 ret = "";
3654 }
3655
3656 return ret;
3657 }
3658
3659 public wchar[] StrToWCHARs(uint codepage , char[] sc, bool terminated = false ) {
3660 return StrToWCHARs( sc, terminated );
3661 }
3662 public wchar[] StrToWCHARs(char[] sc, bool terminated = false ) {
3663 wchar[] ret;
3664 try{
3665 ret = toString16(sc);
3666 }catch(Exception e){
3667 // do nothing
3668 ret = "";
3669 }
3670 if( terminated ){
3671 ret ~= \0;
3672 }
3673 return ret;
3674 }
3675
3676 public wchar* StrToWCHARz( uint codepage, char[] sc, uint* length = null ) {
3677 return StrToWCHARz( sc, length );
3678 }
3679
3680 public wchar* StrToWCHARz(char[] sc, uint* length = null ) {
3681 return StrToWCHARs(sc, true ).ptr;
3682 }
3683
3684 public char[] MBCSsToStr(CHAR[] string, uint codepage = 0){
3685 return MBCSzToStr( string.ptr, string.length, codepage);
3686 }
3687
3688 public char[] MBCSzToStr(PCHAR pString, int _length = -1, uint codepage = 0) {
3689 // null terminated string pointer
3690 if(_length == -1){
3691 _length = 0;
3692 while(*(pString + _length))
3693 ++_length;
3694 }
3695 // convert MBCS to UTF-8
3696 if(_length == 0)
3697 return null;
3698
3699 wchar[] wcs = _mbcszToWs(pString, _length, codepage);
3700 char[] result;
3701 try{
3702 result = .toString(wcs);
3703 }catch(Exception e){
3704 }
3705 return result;
3706 }
3707
3708 public char[] WCHARsToStr(wchar[] string){
3709 return WCHARzToStr(string.ptr, string.length);
3710 }
3711
3712 public char[] WCHARzToStr(wchar* pString, int _length = -1)
3713 {
3714 if( pString is null ){
3715 return null;
3716 }
3717 // null terminated string pointer
3718 if(_length == -1){
3719 _length = 0;
3720 while(*(pString + _length))
3721 ++_length;
3722 }
3723 if(_length == 0)
3724 return null;
3725 // convert wchar* to UTF-8
3726 wchar[] wcs = pString[0.._length];
3727
3728 char[] result;
3729 try{
3730 result = .toString(wcs);
3731 }catch(Exception e){
3732 // do nothing
3733 }
3734 return result;
3735 }
3736
3737 /**
3738 * <Shawn> difference between WCHARzToStr(pwstr, -1) :
3739 * BSTRToStr() internally call WCHARzToStr(pwstr, length) with length set,
3740 * instead to determine the null ended, this mean BSTRToStr() can get string
3741 * which has embedded null characters.
3742 */
3743
3744 version(OLE_COM)
3745 {
3746 // BSTR is aliased to wchar*
3747 // Note : Free the "bstr" memory if freeTheString is true, default false
3748 static char[] BSTRToStr(/*BSTR*/ inout wchar* bstr, bool freeTheString = false){
3749 if(bstr is null) return null;
3750 int size = (SysStringByteLen(bstr) + 1)/wchar.sizeof;
3751 char[] result = WCHARzToStr(bstr, size);
3752 if(freeTheString) {
3753 // free the string and set ptr to null
3754 SysFreeString(bstr);
3755 bstr = null;
3756 }
3757 return result;
3758 }
3759 } // end of OLE_COM
3760
3761
3762 public static wchar[] _mbcszToWs(PCHAR pMBCS, int len, uint codepage = 0)
3763 {
3764 wchar[] wbuf;
3765 // Convert MBCS to unicode
3766 wbuf.length = OS.MultiByteToWideChar(codepage, 0, pMBCS, len, null, 0);
3767 int n = OS.MultiByteToWideChar(codepage, 0, pMBCS, len, wbuf.ptr, wbuf.length);
3768 assert(n == wbuf.length);
3769 return wbuf;
3770 }
3771
3772 // static methods
3773 public int _tcslen(TCHAR* pString){
3774 int _length = 0;
3775 while(*(pString + _length))
3776 ++_length;
3777
3778 return _length;
3779 }
3780
3781 /**
3782 * There is a bug in Phobos std.string.toupper() to lower() with
3783 std.string.toupper() and std.string.tolower() give a wrong result when deal with a mixture of upper/lower English and Chinese characters. e.g.
3784 char[] a = "AbCd中文eFgH";
3785 char[] b = std.string.toupper(a);
3786 char[] c = std.string.tolower(a);
3787 The length of a is 11, but the length of b,c is 18 now.
3788 *
3789 */
3790 public char[] tolower(char[] string) {
3791 TCHAR* ps = StrToTCHARz(string);
3792 TCHAR* ps2 = OS.CharLower(ps);
3793 return TCHARzToStr(ps2);
3794 }
3795 public char[] toupper(char[] string) {
3796 TCHAR* ps = StrToTCHARz(string);
3797 TCHAR* ps2 = OS.CharUpper(ps);
3798 return TCHARzToStr(ps2);
3799 }
3800
3801 version(ANSI){
3802 alias StrToMBCS StrToTCHARs;
3803 alias StrToMBCSz StrToTCHARz;
3804 alias MBCSzToStr TCHARzToStr;
3805 alias MBCSsToStr TCHARsToStr;
3806 }else{
3807 // Unicode
3808 alias StrToWCHARs StrToTCHARs;
3809 alias StrToWCHARz StrToTCHARz;
3810 alias WCHARzToStr TCHARzToStr;
3811 alias WCHARsToStr TCHARsToStr;
3812 alias _tcslen TCHARzLen;
3813 }
3814
3815
3816 //alias Converter.StrToTCHARs StrToTCHARs;
3817 //alias Converter.StrToTCHARz StrToTCHARz;
3818 //alias Converter.TCHARzToStr TCHARzToStr;
3819 //alias Converter.TCHARsToStr TCHARsToStr;
3820
3821
3822 TCHAR[] NewTCHARs( uint codepage, uint len ){
3823 auto res = new TCHAR[ len ];
3824 res[] = '\0';
3825 return res;
3826 }
3827
3828
3829
3830