@asphodelus said in opened file does not get the focus at first launch of npp only:
I’ve tried pre-launching, it worked, and I’ll stick to this workaround at least for now, as I hope this issue will be resolved the next clean install of windows, which I have planned for after the summer :)
Good luck with that.
This morning I booted and rebooted a few times this morning trying to reproduce the issue but was not successful other than when doing a deliberate effort to start Notepad++ without giving it focus.
The first time I tried the machine was so early in the booting process that Window Focus Logger did not start logging until I was done with the test. Window Focus Logger uses Microsoft .NET Framework 4 meaning Window Focus Logger hung until .NET Framework was available and ready. While Window Focus Logger was hung, I found that right click on test.htm and selecting Edit with Notepad++ worked find. Notepad++ started and test.htm had focus in less than a second. It shows how lightweight Notepad++ is in terms of system resources needed.
I rebooted a few more times, each time giving the system a little more time so that .NET Framework 4 could be loaded by Window Focus Logger. With logging enabled I could see that Notepad++ was getting focus when I did the right click / edit test on test.htm.
The Windows desktop has a feature where if you are holding the shift key down as you start an application then it will launch an instance of that application but does not hand focus to it. This is mainly intended for use on the task bar to start extra instances of something but it also works on the desktop and start menu. So, I right click on the Test icon on the desktop, move the mouse down a little to Edit with Notepad++, hold the shift key down, and then left or normal click the mouse will start Notepad++ which opens displays test.htm while also not getting focus. That replicates what happens to you.