Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/ole/win32/OLE.d @ 38:2e09b0e6857a
work on phobosfication
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 25 Mar 2009 11:18:25 +0100 |
parents | 950d84783eac |
children |
comparison
equal
deleted
inserted
replaced
37:46c5f8f56b41 | 38:2e09b0e6857a |
---|---|
382 if (extension.length is 0) return ""; //$NON-NLS-1$ | 382 if (extension.length is 0) return ""; //$NON-NLS-1$ |
383 | 383 |
384 if (extension.charAt (0) !is '.') extension = "." ~ extension; //$NON-NLS-1$ | 384 if (extension.charAt (0) !is '.') extension = "." ~ extension; //$NON-NLS-1$ |
385 | 385 |
386 /* Use the character encoding for the default locale */ | 386 /* Use the character encoding for the default locale */ |
387 TCHAR[] extensionKey = StrToTCHARs(0, extension, true); | 387 StringT extensionKey = StrToTCHARs(0, extension, true); |
388 String result = getKeyValue(extensionKey); | 388 String result = getKeyValue(extensionKey); |
389 if (result !is null) { | 389 if (result !is null) { |
390 // look for "<programID>\NotInsertable" | 390 // look for "<programID>\NotInsertable" |
391 TCHAR[] notInsertableKey = StrToTCHARs(0, result~"\\NotInsertable", true); //$NON-NLS-1$ | 391 StringT notInsertableKey = StrToTCHARs(0, result~"\\NotInsertable", true); //$NON-NLS-1$ |
392 if (getKeyExists(notInsertableKey)) return ""; //$NON-NLS-1$ | 392 if (getKeyExists(notInsertableKey)) return ""; //$NON-NLS-1$ |
393 // look for "<programID>\Insertable" | 393 // look for "<programID>\Insertable" |
394 TCHAR[] insertableKey = StrToTCHARs(0, result~"\\Insertable", true); //$NON-NLS-1$ | 394 StringT insertableKey = StrToTCHARs(0, result~"\\Insertable", true); //$NON-NLS-1$ |
395 if (getKeyExists(insertableKey)) return result; | 395 if (getKeyExists(insertableKey)) return result; |
396 // look for "<programID>\protocol\StdFileEditing\server" | 396 // look for "<programID>\protocol\StdFileEditing\server" |
397 TCHAR[] serverKey = StrToTCHARs(0, result~"\\protocol\\StdFileEditing\\server", true); //$NON-NLS-1$ | 397 StringT serverKey = StrToTCHARs(0, result~"\\protocol\\StdFileEditing\\server", true); //$NON-NLS-1$ |
398 if (getKeyExists(serverKey)) return result; | 398 if (getKeyExists(serverKey)) return result; |
399 } | 399 } |
400 | 400 |
401 return ""; //$NON-NLS-1$ | 401 return ""; //$NON-NLS-1$ |
402 } | 402 } |
403 static String getKeyValue (TCHAR[] key) { | 403 static String getKeyValue (StringT key) { |
404 void* [1] phkResult; | 404 void* [1] phkResult; |
405 if (OS.RegOpenKeyEx (cast(void*)OS.HKEY_CLASSES_ROOT, key.ptr, 0, OS.KEY_READ, phkResult.ptr) !is 0) { | 405 if (OS.RegOpenKeyEx (cast(void*)OS.HKEY_CLASSES_ROOT, key.ptr, 0, OS.KEY_READ, phkResult.ptr) !is 0) { |
406 return null; | 406 return null; |
407 } | 407 } |
408 String result = null; | 408 String result = null; |
421 } | 421 } |
422 } | 422 } |
423 if (phkResult [0] !is null) OS.RegCloseKey (phkResult [0]); | 423 if (phkResult [0] !is null) OS.RegCloseKey (phkResult [0]); |
424 return result; | 424 return result; |
425 } | 425 } |
426 private static bool getKeyExists (TCHAR[] key) { | 426 private static bool getKeyExists (StringT key) { |
427 void* [1] phkResult; | 427 void* [1] phkResult; |
428 if (OS.RegOpenKeyEx (cast(void*)OS.HKEY_CLASSES_ROOT, key.ptr, 0, OS.KEY_READ, phkResult.ptr) !is 0) { | 428 if (OS.RegOpenKeyEx (cast(void*)OS.HKEY_CLASSES_ROOT, key.ptr, 0, OS.KEY_READ, phkResult.ptr) !is 0) { |
429 return false; | 429 return false; |
430 } | 430 } |
431 if (phkResult [0] !is null) OS.RegCloseKey (phkResult [0]); | 431 if (phkResult [0] !is null) OS.RegCloseKey (phkResult [0]); |