win32: fix command line arguments (fixes #840)

This commit is contained in:
OV2 2023-04-12 19:34:09 +02:00
parent e55b13315b
commit 3ab8f006cb
2 changed files with 4 additions and 1 deletions

View File

@ -40,7 +40,7 @@ extern TCHAR multiRomB[MAX_PATH];
void S9xParseArg (char **argv, int &i, int argc)
{
if (strcasecmp (argv [i], "-removeregistrykeys"))
if (strcasecmp (argv [i], "-removeregistrykeys") == 0)
{
S9xWinRemoveRegistryKeys();
}

View File

@ -7047,6 +7047,9 @@ void SetInfoDlgColor(unsigned char r, unsigned char g, unsigned char b)
void S9xWinRemoveRegistryKeys() {
TCHAR szRegKey[4096] = {};
if(!valid_ext)
LoadExts();
_stprintf_s(szRegKey, 4095, TEXT("Software\\Classes\\%s"), SNES9XWPROGID);
SHDeleteKey(HKEY_CURRENT_USER, szRegKey);
_stprintf_s(szRegKey, 4095, TEXT("Software\\RegisteredApplications\\%s"), SNES9XWPROGID);