add RestartProgram
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user