Getting system properties and executing files

BlitzMax Forums/BlitzMax Programming/Getting system properties and executing files

Does anyone know how to get the system properties and executing files in max, from what I can see in the docs there is no SystemProperty or ExecFile commands.

Yep, it's WinAPI specific

Depends on what you want to do. As Indie suggested, most of the systemproperty stuff can be done with win API. For the window handle there's GetActiveWindow. ExecFile is now System_, but it halts program execution. Kernel32's WinExec might allow execution to continue, I haven't tried.

thanks will have a look, what I want to do is get the directory of where windows is installed to

You're welcome. Try this for the windows directory:
Extern "win32"
	Function GetWindowsDirectory(lpBuffer:Byte Ptr, nSize) = "GetWindowsDirectoryA@8"
End Extern

Local winDir:TBank = CreateBank(260)
GetWindowsDirectory BankBuf(winDir), 260

Print String.FromCString(BankBuf(winDir))


thanks eikon will have a looky :D

For launching apps see my Max tutorial called:

Launching a program

http://www.blitzmax.com/Community/posts.php?topic=53709

thanks will have a look, what I want to do is get the directory of where windows is installed to

You should really be using Environment Variables for this stuff.

Indiepath: do you have a source example?

http://msdn2.microsoft.com/77zkk0b6.aspx

http://www.wilsonmar.com/1envvars.htm

I think there is a function in the code archives that uses a .decls file to get the variable detailes.

Print "Windows is installed to "+GetEnv("SystemRoot")

Function GetEnv:String(env_var:String)
	Return String(getenv_(env_var))
End Function


For a complete set of varibles go to the command prompt and type set

thanks guys that will is a great help :D