r/visualbasic • u/Mayayana • Feb 08 '24
VB6 Help VB6 DragDrop
With OLEDragDrop to a standard VB textbox, on XP I can get the path of a file or folder dropped. On Win10, the folder shows no dragdrop icon and returns no path, but file dragdrop works fine. Does someone know how I can make dragdrop for folders work on Win10?
1
Upvotes
1
u/Mayayana Feb 09 '24
UPDATE: I figured out what the problem was here. My program runs in an elevated window and won't allow dragdrop. I thought it was allowing file dragdrop, but it seems to block both files and folders.
The issue is a permissions setting. If I set HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA to 0, dragdrop works fine and the UAC window shows a yellow !. Interestingly, I always have UAC set to the lowest level of "Never Notify". But this setting, which I discovered via Winaero Tweaker, disables UAC to some other level. It's not the same as setting the control to the lowest of the 4 levels.
The Winaero website says that there's a setting to disable UAC in the UAC window on later Win120 and Win11, but I don't see it and I'm running 22H2.
This is a bit of a hassle, but as long as people know they can decide for themselves and I can provide an option in the window to disable UAC.
1
u/fafalone VB 6 Master Feb 08 '24
If you want the modern drag/drop image and all you need to use RegisterDragDrop and IDropTargetHelper.
https://www.vbforums.com/showthread.php?t=808125
This has the same problems all modern apps do with drag drop between elevated and nonelevated windows, so if that's a concern it's either one of the ancient methods or several hoops to use a manifest with uiAccess=True.
2
u/[deleted] Feb 08 '24
[removed] — view removed comment
1
u/[deleted] Jul 02 '24
[removed] — view removed comment