Page 1 of 1
Issues Pertaining to Single Instance Enforcement
Posted: 19 Jul 2025 13:01
by twosixfoursix
Hi there,
I haven't had the chance to update to newest version yet, but the following problems exist in upto version 27.00.0500.
- It seems that the application is not creating a mutex to enforce single instance - so process launch commands of XYplorer in extremely rapid succession will result in launch of multiple instances even with "Allow multiple instances" disabled.
- If I use something like an external hotkey program to launch XYplorer and it is already visible and in focus, it will open a new location passed in the program arguments in a new tab. But it will do this twice for some reason, resulting in 2 identical tab windows created on a single command.
Thank you kindly,
Re: Issues Pertaining to Single Instance Enforcement
Posted: 24 Jul 2025 14:27
by admin
Please try that with the latest 64-bit beta and report back:
viewtopic.php?f=1&t=28739&sd=d
Re: Issues Pertaining to Single Instance Enforcement
Posted: 25 Jul 2025 00:50
by twosixfoursix
Hmm... issue still persists on [
27.90.0010 (64-bit)]. My OS: [
Windows 10: Version 10.0.19045.6093].
Perhaps the following in main before anything else could help solve the issue.
Code: Select all
static HANDLE appmut = NULL;
int WINAPI wWinMain(_In_ HINSTANCE hinstance, _In_opt_ HINSTANCE prevhinstance, _In_ LPWSTR wargv, _In_ int cmdshow)
{
appmut = CreateMutexW(NULL, TRUE, L"MyApplication");
if(!appmut)
{
MessageBoxW(NULL, L"Was unable to initialize with mutex...", L"MyApplication", MB_OK);
ExitProcess(0);
}
else if(GetLastError() == ERROR_ALREADY_EXISTS)
{
HWND myappinstance = FindWindowW(appName, appName);
if(myappinstance)
{
SetForegroundWindow(myappinstance);
}
return FALSE;
}
// ...
}
And program arguments can be intercepted and passed to tab creation thread. And a `ReleaseMutex(appmut)` on `WM_CLOSE` of main XYPlorer window WndProc.
I think currently the single instance enforcement is just a window existence check of the harcoded name containing "XYplorer" and not a true mutex. So if the name of the binary changes, the enforcement becomes void. Obviously I am not changing the name of the exe all the time, I was just actively testing for issues as I recently started frequently using XYplorer again. It's a joy to use!
The dual tab creation also seems to persist, but something I have noticed is that it will only do that if the shortcut has VK_SHIFT combined with VK_MENU, which I am passing from AutoHotkey v2. Cannot understand why it happens. I think it might be because I configured AutoHotkey to actually create a new true process instead of just using the Run command (using the ahk author provided 'shell run' script), but I'm not sure.
Of course, the application is much more complex than this and I am unable to consider nor comprehend all other factors in the functioning - I'm just throwing out some ideas which I hope could aid in improving stability...
Thank you kindly,
Re: Issues Pertaining to Single Instance Enforcement
Posted: 25 Jul 2025 09:10
by admin
Okay, this looks like a very specific problem that will be dealt with later, once the 64-bit transformation has been completed.
Re: Issues Pertaining to Single Instance Enforcement
Posted: 13 Jul 2026 23:48
by twosixfoursix
Hi again,
This issue has been fixed as of XYplorer Version: 28.30.1400 (x64).
I apologize - the issue actually still persists in that single app enforcement is still a hard string check of the name "XYPlorer". I just forgot the behavior since I hadn't used the application in a while. However, as long as the binary name remains XYPlorer.exe, this is a non-issue.
Many thanks,