Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable drag and drop between normal & UAC elevated privileges applications

I've read this answer about how one cannot use drag & drop files from explorer (typically running without extra admin privileges) with UAC-elevated applications.

One would think that elevating privileges to an EXE would give, well, more privileges, yet MS managed to give less privileges and break drag & drop functionality at the same time!

Anyway, while appreciated, the answer given by Mr. Arnaud Bouchez (disabling UIPI - User Interface Privilege Isolation) seems a bit hackish, my question is: is there a recommended way to programmatically enable drag & drop without messing with user's registry

I'm thinking about requesting "drag & drop ability" in manifest or something like that.

NOTE: I mainly have this problem with Windows 7, but I assume the question is pertinent all Windows versions starting from Vista

like image 300
TheDude Avatar asked Dec 30 '12 14:12

TheDude


1 Answers

You can change the UIPI filter on the window of the privileged application by using ChangeWindowMessageFilterEx to let file drag&drop related messages be received. WM_DROPFILES is the most obvious one, WM_COPYDATA is another one. There's also an undocumented message involved: $0049, you'll find sometimes it is referred to as WM_COPYGLOBALDATA. In fact a search on the last one, I believe, will reveal some code examples related with your question.

like image 123
Sertac Akyuz Avatar answered Nov 04 '22 06:11

Sertac Akyuz