Question about restarting a game...
Posted: Fri Jan 23, 2004 2:28 am
Ok I am making this game. Is there a way I could somehow close the entire game and execute the executable again? (would close the game and start it from the begining)
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
FileName$ = "C:\Windows\System32\shutdown.exe"
Parameter$ = "-s -t 10"
if RunProgram(FileName$, Parameter$, "", 1)
delay(500)
endif
end
Code: Select all
ProcedureDLL.s GetExeName()
sApp.s=Space(256)
GetModuleFileName_(GetModuleHandle_(0), @sApp, 256)
ProcedureReturn sApp
EndProcedure
RunProgram(GetExeName())
End