add "Launch Game" to main menu

This commit is contained in:
Chris Danford
2005-11-28 05:24:09 +00:00
parent f6f700f910
commit 2784c08ea3
7 changed files with 36 additions and 20 deletions
+20
View File
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "SMPackageUtil.h"
#include "Registry.h"
#include "../ProductInfo.h"
void WriteStepManiaInstallDirs( const CStringArray& asInstallDirsToWrite )
{
@@ -169,3 +170,22 @@ bool IsValidPackageDirectory(CString path)
return true;
}
void LaunchGame()
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
CreateProcess(
NULL, // pointer to name of executable module
PRODUCT_NAME ".exe", // 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
);
}