Notepad++ doesn't come to foreground
Notepad++ usually comes into the foreground when I open a file (I am using Windows). However, if at some point I switch to the Administrator mode of the already open Notepad++ because I need to edit a file that demands extended rights, after that Notepad++ does not come into the foreground when I open a file.
That’s a bug, isn’t it?
That’s a bug, isn’t it?
might be, but as I’m using npp in admin mode from time to time as well and haven’t discovered this behavior
might I ask you to explain in detail what you are doing in order to be able to see if it can be reproduced?
Okay, here we go:
- Open npp
- minimize it
- open file explorer, klick on a file in the Programs-Folder: “Edit with npp”
- npp opens the file in the foreground, perfect :-)
- edit the file and save it
- npp asks to restart in Admin-Mode, do it
- save the file
- minimize npp
- open another file from file explorer (“Edit with npp”), you can use the same
- npp opens the file but does not maximize / come to foreground
Ok - I see but it seems that the ordering of minimizing npp is important.
If I first minimize the admin mode npp and afterwards the normal npp then I see the same as you
but if I first minimize the normal npp and afterwards the admin mode npp then a new edit…
will open the normal npp.
welcome to the notepad++ community, @Daniel-Schielzeth
this is by uac design, to isolate elevation levels.
your explorer is running, using your current user environment.
while it is able to pass pipes to a running elevated process, it is not able to control the gui, as it is completely isolated, except to user input (mouse/keyboard).
one thing you can do is to disable uac as shown at the screenshot below:
note: another restriction of having uac enabled, is that you can’t drag and drop files from your user account to an elevated notepad++ or any other windowed elevated task, this is also by windows’ design
the behaviour you see is completely normal with uac enabled (eg: open notepad++ elevated, minimise it, open explorer and right click on a file and select open with notepad++)
I only get this behavior
“the behaviour you see is completely normal with uac enabled (eg: open notepad++ elevated, minimise it, open explorer and right click on a file and select open with notepad++)”
in Admin mode though, right? In the normal mode it works just fine. I don’t think I want to disable my uac for that ;-)
yes, in normal mode it works fine, as long as your explorer and notepad++ share the same user level.
if you can live with this situation (a minimised, elevated application will not pop up on explorer context menu or other commands, unless triggered by any h.i.d. like a mouse click, and you can’t drag and drop from an explorer window to eg. an elevated notepad++), you can leave uac enabled.