Single instance doesn't restore automatically
Single instance doesn't restore automatically
Sometimes when you open a folder (eg "explorer++.exe c:\tmp") with multiple instances disabled the existing instance taskbar entry just flashes orange - it does not restore the window. But it does correctly open the directory. Its a bit annoying it does not restore the window. You have to manually restore it. I've seen these kind of problems before when trying to bring a window in front of others across processes. Does this ever happen with windows 7?
Re: Single instance doesn't restore automatically
Not really sure what you are talking about but if it is what happens when doing a Alt Tab to switch between windows, open programs, and even though a program has focus it is not full displayed in front of other programs, IE covered up by non active programs/windows, then yes I see this from time to time on Win 7.
If you are talking strictly about E++ I rarely have 2 instances of it open and the few times I have I had no problem switching between them, IIRC.
If you are talking strictly about E++ I rarely have 2 instances of it open and the few times I have I had no problem switching between them, IIRC.
Re: Single instance doesn't restore automatically
How to reproduce (Windows XP):
* Run Explorer++ in single instance mode.
* Open notepad and fill the screen, with notepad the active task.
* Run "explorer++.exe c:\tmp" - it opens the directory, but does not bring the window forward.
This is not enough to make Explorer++ the foreground window (from WinMain.cpp in single instance mode):
It sounds like its not enough on Windows7 either.
I'll try and dig up the code that can bring a window to the front.
* Run Explorer++ in single instance mode.
* Open notepad and fill the screen, with notepad the active task.
* Run "explorer++.exe c:\tmp" - it opens the directory, but does not bring the window forward.
This is not enough to make Explorer++ the foreground window (from WinMain.cpp in single instance mode):
Code: Select all
hPrev = FindWindow(CLASS_NAME,NULL);
SetForegroundWindow(hPrev);
ShowWindow(hPrev,SW_SHOW);
I'll try and dig up the code that can bring a window to the front.
-
- Site Admin
- Posts: 938
- Joined: Sat Apr 18, 2009 1:46 am
Re: Single instance doesn't restore automatically
I can duplicate this by minimizing the current instance of Explorer++, then attempting to start a new instance. To fix it, I simply changed:
to
Code: Select all
ShowWindow(hPrev,SW_SHOW);
Code: Select all
ShowWindow(hPrev,SW_RESTORE);