Make 1000% sure that any regedit is started by launching regedit from the search path if the GetWindowsDirectory call failed. (suggested by Alex on ros-dev)

svn path=/trunk/; revision=33573
This commit is contained in:
Colin Finck 2008-05-18 11:24:56 +00:00
parent 5bc725550f
commit 5508c5cbb2

View file

@ -3,6 +3,8 @@
#include <shellapi.h>
#include <shlwapi.h>
#define REGEDIT _T("regedit.exe")
int WINAPI _tWinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,
LPTSTR lpsCmdLine, int nCmdShow)
{
@ -10,9 +12,13 @@ int WINAPI _tWinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,
if(GetWindowsDirectory(szPath, MAX_PATH))
{
PathAppend(szPath, _T("regedit.exe"));
PathAppend(szPath, REGEDIT);
ShellExecute(NULL, NULL, szPath, lpsCmdLine, NULL, nCmdShow);
}
else
{
ShellExecute(NULL, NULL, REGEDIT, lpsCmdLine, NULL, nCmdShow);
}
return 0;
}