add RestartProgram

This commit is contained in:
Glenn Maynard
2003-10-16 08:56:58 +00:00
parent 6e5a5efe73
commit c3bc5440d5
3 changed files with 41 additions and 0 deletions
+6
View File
@@ -998,6 +998,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
<File
RelativePath="archutils\Win32\GotoURL.h">
</File>
<File
RelativePath="archutils\Win32\RestartProgram.cpp">
</File>
<File
RelativePath="archutils\Win32\RestartProgram.h">
</File>
<File
RelativePath=".\StepMania.ICO">
</File>
@@ -0,0 +1,29 @@
#include "global.h"
#include "RestartProgram.h"
void Win32RestartProgram()
{
TCHAR szFullAppPath[MAX_PATH];
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
// Launch StepMania
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
CreateProcess(
NULL, // pointer to name of executable module
szFullAppPath, // pointer to command line string
NULL, // process security attributes
NULL, // thread security attributes
false, // handle inheritance flag
0, // creation flags
NULL, // pointer to new environment block
NULL, // pointer to current directory name
&si, // pointer to STARTUPINFO
&pi // pointer to PROCESS_INFORMATION
);
ExitProcess( 0 );
/* not reached */
}
@@ -0,0 +1,6 @@
#ifndef RESTART_PROGRAM_H
#define RESTART_PROGRAM_H
void Win32RestartProgram();
#endif