ExecFile

BlitzMax Forums/BlitzMax Beginners Area/ExecFile

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

not work :(
Import "-lshell32"

Extern
	Function ShellExecute:Int(hwnd:Int,operation:Byte Ptr,file:Byte Ptr,parameters:Byte Ptr,directory:Byte Ptr,showcmd:Int) = "ShellExecuteA@24"
End Extern

Function ExecFile:Int(file:String,params:String="",defaultdir:String="")
	Print  ShellExecute(0,"OPEN",file.ToCString(),params.ToCString(),defaultdir.ToCString(),0) > 32
	Return False
End Function

Print "Start exec"
ExecFile("test.url")
Print "End exec"

output:
Building test
Compiling:test.bmx
flat assembler  version 1.51
3 passes, 2741 bytes.
Linking:test.exe
Executing:test.exe
Start exec
0
Process complete