Admin vs. non-Admin inconsistency?
-
Interesting?:
Have an instance of Notepad++ running as administrator:
Have a totally separate instance of N++ running as non-Administrator.
Have an Explorer (non-admin) window open.
Attempt to drag-and-drop a .txt file from Explorer to non-Admin N++.
It works (obviously) to open the file into a N++ tab.Attempt to drag-and-drop a .txt file from Explorer to Admin-level N++.
Nothing happens; file is not opened; no error message (ok, an error message would be nice, but I can deal with it the way it is).
The possible lesson from this part of the story is that a non-admin app can’t share data to an admin app this way.Attempt to drag-and-drop a tab (for a file on disk) from non-Admin N++ to Admin-level N++.
SUCCESS, it works to open the file in the Admin instance.
This seems, well, a bit inconsistent, when compared to the Explorer test? -
I just replicated the process, and agree with your results.
Personally, I’ve never understood why Admin-mode would prevent drag-and-drop; it would be nice if they figured out how to allow that to work into an Admin window. But I’d suggest pointing to this thread as a workaround when people want to drag-and-drop into admin mode. :-)
While running the experiment I noticed that it would close my non-admin window if it were the last (only) tab dragged out. I guess forcibly removing the last tab might be expected to close the app.
-
@PeterJones said in Admin vs. non-Admin inconsistency?:
noticed that it would close my non-admin window if it were the last (only) tab dragged out.
Well, one can always Ctrl+drag out a tab, to avoid that situation, if it is important to avoid it. But perhaps it is another inconsistency, as I’d think its (dragging tab out WITHOUT Ctrl) behavior would be governed by this setting:
But it doesn’t appear to be…
-
Try dragging a file from explorer into an admin command prompt and normal command prompt.
Same results.This is a Windows feature completely unrelated to Notepad++. Windows blocks the messages related to drag and drop since there are security risks involved.
-
@gstavi said in Admin vs. non-Admin inconsistency?:
Try dragging a file from explorer into an admin command prompt and normal command prompt.
Same results.
This is a Windows feature completely unrelated to Notepad++. Windows blocks the messages related to drag and drop since there are security risks involved.My complaint wasn’t with this, specifically.
My intent was to just point out perhaps an inconsistency, and one that has potential value as a workaround to the Windows behavior. -
@Alan-Kilborn
Please phrase the inconstancy that concerns you?I understood that the inconsistency was that drag-and-drop acts differently for normal user Notepad++ instance and admin Notepad++ instance?
Since I used to drag from explorer to command prompt a lot, I specifically remember that it stopped working for Windows Vista since Microsoft decided that it is unsafe and blocked it.
I guess that an Admin Notepad++ wouldn’t observe any Windows message when a file is dragged from explorer into it so it can not show any feedback to the user.
I admit I am a bit surprised that drag and drop from normal Notepad++ to Admin Notepad++ does work. Don’t know why, but some ideas are:
- Explorer.exe is critical part of Windows it is possible that stricter rules are applied for dragging from it.
- Drag-and-drop is complex with lots of implementation details that may make the difference.
-
This looks like a caution measure in Windows.
As a security measure Windows does not permit drag and drop from an unelevated source to an elevated recipient.
But probably it is worth to create an issue for this. Could you, please, do that, @Alan-Kilborn ?
-
@mere-human said in Admin vs. non-Admin inconsistency?:
But probably it is worth to create an issue for this. Could you, please, do that, @Alan-Kilborn ?
I’m not sure, what issue I would make?
-
@Alan-Kilborn I mean report a bug in Notepad++ repository.
-
I realize that. :-)
But, maybe I see it as just an inconsistency, not a bug.
As said above, it can be a workaround for something that Windows/Explorer just won’t do.
As such, I don’t really want to put an issue in – it might get acted upon! :-) -
@Alan-Kilborn said in Admin vs. non-Admin inconsistency?:
I don’t really want to put an issue in – it might get acted upon!
Indeed. :-)
You might want to put in a bug report to the effect that “exit on close the last tab” setting is ignored when you drag the last active tab to another instance.
-
Based on the link that @mere-human found, Admin Notepad++ may be able to get drag and drop messages by disabling filters with a call to ChangeWindowMessageFilterEx.
So there is point to file an issue.