Asked by:
Drag n Drop not working on elevated mode with COleDropTarget

Question
-
Hi,
I am working on an application which doesn't support drag 'n' drop in admin mode. Earlier I was using COleDropTarget but now I have ported the code to use window messages. But another requirement to determine if drop should be allowed which was handled with OnDragEnter before is not possible now because no message is generated before WM_DROPFILES (as far as I know).
I have followed this Code project example as a reference for COleDropTarget.
Please help.
Thanks in advance.
Friday, March 31, 2017 9:05 AM
All replies
-
As a security measure Windows does not permit drag and drop from an unelevated source to an elevated recipient.
You can modify UIPI message blocking with ChangeWindowMessageFilterEx
See https://blogs.msdn.microsoft.com/patricka/2010/01/28/q-why-doesnt-drag-and-drop-work-when-my-application-is-running-elevated-a-mandatory-integrity-control-and-uipi/- Edited by RLWA32 Friday, March 31, 2017 10:34 AM added link
Friday, March 31, 2017 9:30 AM -
Hi,
On using ChangeWindowMessageFilterEx allowed me to post drop event but for non Ole handling i.e. using WM_DROPFILES message. But I require to use COleDropTarget and using ChangeWindowMessageFilterEx has no effect. WM_DROPFILES doen't allow to determine criteria to allow drop before landing into OnDropFiles.
My problem is like(not the exact but similar): If the file type is image the cursor will turn into accept mode but not for other types.
Thanks.
Friday, March 31, 2017 10:49 AM -
Hi,
On using ChangeWindowMessageFilterEx allowed me to post drop event but for non Ole handling i.e. using WM_DROPFILES message. But I require to use COleDropTarget and using ChangeWindowMessageFilterEx has no effect. WM_DROPFILES doen't allow to determine criteria to allow drop before landing into OnDropFiles.
My problem is like(not the exact but similar): If the file type is image the cursor will turn into accept mode but not for other types.
Thanks.
- Edited by RLWA32 Friday, March 31, 2017 1:08 PM
Friday, March 31, 2017 11:34 AM -
Friday, March 31, 2017 1:08 PM
-
Didn't work for COleDropTarget but thanks for your help.Tuesday, April 4, 2017 4:03 AM
-
Didn't work for COleDropTarget but thanks for your help.
Changing the UIPI message filter is only effective for using the WM_DROPFILES message. I'm not aware of any workaround for OLE drag and drop.- Proposed as answer by Hart Wang Monday, April 10, 2017 2:35 AM
Tuesday, April 4, 2017 4:20 AM -
Can I know the answer? I have same problem..
I got different way to use UIAccess = TRUE. but it's not working.
Please let me know your solution.
Friday, December 29, 2017 6:29 AM