CPU type & Windows version?

BlitzPlus Forums/BlitzPlus Programming/CPU type & Windows version?

DNielsen(Posted 2004) [#1]
@all
Is it somehow possible in BlitzPlus to display the CPU installed (brand and speed) and which Windows version?


VIP3R(Posted 2004) [#2]
Look at the 'GetEnv$' command in the docs.

I think you can get quite a lot of info with this command now, can't remember where I saw the full list though.


DNielsen(Posted 2004) [#3]
@VIP3R
Thanks for the tip, but the latest online docs only supply these:

Print "PROCESSOR_ARCHITECTURE: "+GetEnv$("PROCESSOR_ARCHITECTURE")
Print "ProgramFiles: "+GetEnv$("ProgramFiles")
Print "SystemDrive: "+GetEnv$("SystemDrive")
Print "TEMP: "+GetEnv$("TEMP")

WaitKey()  


There is bound to be more?


VIP3R(Posted 2004) [#4]
Yeah there are more, be careful though as not all versions of Windows support the whole list.

Maybe someone else can remember where they are, I've done a quick search but no luck finding anything other than networking stuff.

Do a forum search for 'getenv$', you're bound to find them somewhere around.


DNielsen(Posted 2004) [#5]
@VIP3R
You were correct. a forum search for the command returned tons of threads ... but unfortunately, none that had a complete list, only a ton of "might work", "works on XP, but maybe not XX" etc ...

I needed something more "firm" In fact, I would love to see some Blitz code access the computer BIOS. That must be possible somehow.


soja(Posted 2004) [#6]
Here's a sample that I wrote a while ago for getting the version of Windows. At the time, I just needed to know whether the user was running 9x/ME or NT/2K/XP. You can get more granular, though. Just look up GetVersionEx on MSDN.

;.lib "Kernel32.dll" 
;GetVersionEx%(lpOSVersionInfo*):"GetVersionExA"

Version = CreateBank(148)
PokeInt(Version, 0, BankSize(Version))
If GetVersionEx(Version) Then
	Select PeekInt(Version, 16)
		Case 0 : Notify "You are running Windows 3.1"
		Case 1 : Notify "You are running on the Windows 9x kernel"
		Case 2 : Notify "You are running on the Windows NT kernel"
		Default : Notify "Unexpected value for Platform ID.", True
	End Select
Else
	Notify "There was an error querying version info.", True
EndIf



soja(Posted 2004) [#7]
Also, you can get processor architecture, type, etc with GetSystemInfo (kernel32)


DNielsen(Posted 2004) [#8]
@Soja,
I rest my case. You always provide great solutions and ideas! Excellent support.