fix: reload arguments after changing own settings files

This commit is contained in:
METANEOCORTEX\Kotti 2025-02-02 20:56:31 +01:00
parent 523ef08619
commit 81649bbd77
2 changed files with 11 additions and 7 deletions

View File

@ -4864,9 +4864,9 @@ void DialogNewWindow(HWND hwnd, bool bSaveBeforeOpen, const HPATHL hFilePath, WI
HPATHL hmod_pth = Path_Allocate(NULL);
Path_GetModuleFilePath(hmod_pth);
StringCchPrintf(wch, COUNTOF(wch), L"\"-appid=%s\"", Settings2.AppUserModelID);
StringCchPrintf(wch, COUNTOF(wch), L"-appid=\"%s\"", Settings2.AppUserModelID);
HSTRINGW hparam_str = StrgCreate(wch);
StringCchPrintf(wch, COUNTOF(wch), L"\" -sysmru=%i\"", (Flags.ShellUseSystemMRU ? 1 : 0));
StringCchPrintf(wch, COUNTOF(wch), L" -sysmru=\"%i\"", (Flags.ShellUseSystemMRU ? 1 : 0));
StrgCat(hparam_str, wch);
if (Path_IsNotEmpty(Paths.IniFile)) {
HPATHL hini_path = Path_Copy(Paths.IniFile);

View File

@ -670,6 +670,7 @@ static inline void ResetFileObservationData(const bool bResetEvt) {
ZeroMemory(&(s_FileChgObsvrData.fdCurFile), sizeof(WIN32_FIND_DATA));
}
}
}
// ----------------------------------------------------------------------------
@ -4787,9 +4788,9 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
break;
case IDM_FILE_SAVE:
FileSave(FSF_None);
break;
case IDM_FILE_SAVE: {
FileSave((FileWatching.FileWatchingMode <= FWM_DONT_CARE) ? FileSave(FSF_SaveAlways) : FSF_None);
} break;
case IDM_FILE_SAVEAS:
@ -9435,6 +9436,8 @@ void ParseCommandLine()
LPWSTR const lp2 = AllocMem(sizeof(WCHAR)*len,HEAP_ZERO_MEMORY);
LPWSTR const lp3 = AllocMem(sizeof(WCHAR)*len,HEAP_ZERO_MEMORY);
//assert(!"ParseCommandLine() - ATTACH DEBUGGER NOW");
if (lp1 && lp2 && lp3) {
// Start with 2nd argument
@ -9470,6 +9473,7 @@ void ParseCommandLine()
bIsFileArg = true;
}
// pathname
if (bIsFileArg) {
LPWSTR const lpFileBuf = AllocMem(sizeof(WCHAR) * len, HEAP_ZERO_MEMORY);
@ -13031,7 +13035,7 @@ void InstallFileWatching(const bool bInstall) {
bool const bPrevReadOnlyAttrib = IsFileReadOnly();
if (bPrevReadOnlyAttrib) {
SendWMCommand(Globals.hwndMain, IDM_FILE_READONLY); // try to gain access
PostWMCommand(Globals.hwndMain, IDM_FILE_READONLY); // try to gain access
}
if (!IsFileReadOnly()) {
@ -13062,7 +13066,7 @@ void InstallFileWatching(const bool bInstall) {
}
if (bPrevReadOnlyAttrib && !IsFileReadOnly()) {
SendWMCommand(Globals.hwndMain, IDM_FILE_READONLY); // try to reset
PostWMCommand(Globals.hwndMain, IDM_FILE_READONLY); // try to reset
}
}
}