Detect OS name

Just starting out? Need help? Post your questions and find answers here.
abc123
Enthusiast
Enthusiast
Posts: 195
Joined: Wed Apr 18, 2007 9:27 pm

Detect OS name

Post by abc123 »

is there a way to detect the os name, some procedure like:

Code: Select all

if GetOSName() = "Windows XP"
   MessageRequester("", "Your are using XP")
else
   MessageRequester("", "Your are not using XP")
endif
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Code: Select all

Result = OSVersion()
abc123
Enthusiast
Enthusiast
Posts: 195
Joined: Wed Apr 18, 2007 9:27 pm

Post by abc123 »

OMG, how did i miss that :shock:

Thanks
Last edited by abc123 on Mon Oct 01, 2007 9:44 pm, edited 2 times in total.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

abc123 wrote:OMG, how did i miss that :shock:

Thanks
No disrespect, but are you aware there is a 'search' feature available for the forums?

cheers
abc123
Enthusiast
Enthusiast
Posts: 195
Joined: Wed Apr 18, 2007 9:27 pm

Post by abc123 »

One more question, is there a way to position the save/open requesters to the middle of the parent window?

Did search but no luck
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Take a look at http://www.purearea.net/pb/CodeArchiv/R ... Preview.pb
You can position the dialog in the hook...
Windows 7 & PureBasic 4.4
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> is there a way to position the save/open requesters to the middle of the
> parent window?
> Did search but no luck

Search for "openfilerequester position" and you'll get what you want.
Philippe-felixer76
User
User
Posts: 57
Joined: Mon Dec 18, 2006 2:02 pm
Location: Holland

Re: Detect OS name

Post by Philippe-felixer76 »

abc123 wrote:is there a way to detect the os name, some procedure like:

Code: Select all

if GetOSName() = "Windows XP"
   MessageRequester("", "Your are using XP")
else
   MessageRequester("", "Your are not using XP")
endif
Good question, OSVersion is handy and gives one of the following:

#PB_OS_Windows_NT3_51
#PB_OS_Windows_95
#PB_OS_Windows_NT_4
#PB_OS_Windows_98
#PB_OS_Windows_ME
#PB_OS_Windows_2000
#PB_OS_Windows_XP
#PB_OS_Windows_Server_2003
#PB_OS_Windows_Future

But is only for windows, a command like getOSName() would
be very handy, and the info should be available on the system.
(See configuration screen->system)
michaeled314
Enthusiast
Enthusiast
Posts: 340
Joined: Tue Apr 24, 2007 11:14 pm

Post by michaeled314 »

the PB compiler has the CompilerIf statement
Post Reply