| View previous topic :: View next topic |
| Author |
Message |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Thu Feb 07, 2008 6:54 am Post subject: A_OSType and 64-Bit Vista |
|
|
Hi Chris,
shouldn't A_OSType show WIN64_NT for Vista x64? If not, what could be the best way to detect 64-Bit? I need this as ContolGet, List also don't work on XP 64-Bit. _________________ Tekl |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 456 Location: Heidelberg, Germany
|
Posted: Thu Feb 07, 2008 10:30 am Post subject: |
|
|
something like this (not fully tested, developed in win32 context under win2k)
| Code: | varsetCapacity(Bool,1)
res := DllCall("IsWow64Process","Uint",WinExist("A"),"UInt",&bool)
; ErrorLevel -4 = The specified function could not be found
MsgBox % ((ErrorLevel="-4")||(!bool)) ? "win32" : "win64" |
more informations can be found here:
MSDN on IsWow64Process
greets
derRaphael _________________
|
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Thu Feb 07, 2008 1:35 pm Post subject: |
|
|
Thanks, but bool is always empty. _________________ Tekl |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2558 Location: Australia, Qld
|
Posted: Mon Feb 11, 2008 7:38 am Post subject: |
|
|
Setting a var's contents indirectly via &address-of will not automatically update it's "length". Use "Int*" instead. (Actually, what you had could be dangerous since BOOLs are 32-bit, not 8-bit, and you only allocated 1 byte.) Also, IsWow64Process accepts a process handle, not a window ID.
| Code: | ThisProcess := DllCall("GetCurrentProcess")
; If IsWow64Process() fails or can not be found,
; assume this process is not running under wow64.
; Otherwise, use the value returned in IsWow64Process.
if !DllCall("IsWow64Process", "uint", ThisProcess, "int*", IsWow64Process)
IsWow64Process := false
MsgBox % IsWow64Process ? "win64" : "win32" |
|
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 456 Location: Heidelberg, Germany
|
Posted: Wed Feb 13, 2008 12:16 am Post subject: |
|
|
learn every day something new. thanks lexikos for correcting my poor creation  _________________
|
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Wed Feb 13, 2008 12:27 am Post subject: |
|
|
Yes, thanks also from my side. It works. _________________ Tekl |
|
| Back to top |
|
 |
|