AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OS Version with integer type

 
Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
fmate14



Joined: 28 Oct 2007
Posts: 75
Location: Hungary, Érd

PostPosted: Sun Mar 08, 2009 10:01 am    Post subject: OS Version with integer type Reply with quote

The new Autohotkey has very good features, for example support WheelRight. It requires at least Windows Vista. But AutoHotkey doesn't support “at least” os version check, I must use
Code:
if ( A_OSVersion == "WIN_VISTA" )

and update it if a new windows released, or I can use
Code:
if A_OSVersion in WIN_NT4,WIN_95,WIN_98,WIN_ME,WIN_2000,WIN_XP,WIN_2003

and it is maybe a little slow.

So, it can be easier:
Code:
if ( A_OSVersionInteger >= 8 )

_________________
Portable Keyboard Layout
Happy Sunday
Back to top
View user's profile Send private message Visit poster's website
Lexikos



Joined: 17 Oct 2006
Posts: 7294
Location: Australia

PostPosted: Sun Mar 08, 2009 1:17 pm    Post subject: Reply with quote

An alternative:
Code:
A_OSMajorVersion := DllCall("GetVersion") & 0xff
A_OSMinorVersion := DllCall("GetVersion") >> 8 & 0xff
MsgBox % A_OSMajorVersion "." A_OSMinorVersion

For A_OSVersion >= WIN_VISTA:
Code:
if A_OSMajorVersion >= 6
See MSDN: Operating System Version

Note that if compatibility mode is in effect for AutoHotkey.exe, A_OSVersion and GetVersion() report the "fake" version number, but WheelLeft/WheelRight may still be supported if the script is really running on Vista+.
Back to top
View user's profile Send private message Visit poster's website
fmate14



Joined: 28 Oct 2007
Posts: 75
Location: Hungary, Érd

PostPosted: Sun Mar 08, 2009 8:56 pm    Post subject: Reply with quote

Thank you for the very fast reply, and this is an useful alternative!
_________________
Portable Keyboard Layout
Happy Sunday
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group