Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I drag icons from Windows Explorer and display in the control?

0
Posted

How can I drag icons from Windows Explorer and display in the control?

0

The OLEDropMode property of the control must be set on exOLEDropManual (1). If this property is set, the control fires the OLEDragDrop event which notifies that the user drags data to the control. The Files collection holds a collection of files being dragged. The following VB sample copies the original icon being displayed in Windows Explorer and displays it on the control: Private Declare Function SHGetFileInfo Lib “shell32.dll” Alias “SHGetFileInfoA” (ByVal pszPath As String, ByVal dwFileAttributes As Long, psfi As SHFILEINFO, ByVal cbFileInfo As Long, ByVal uFlags As Long) As Long Private Const SHGFI_OPENICON = &H2 ‘ get open icon Private Const SHGFI_SMALLICON = &H1 ‘ get small icon Private Const SHGFI_SYSICONINDEX = &H4000 Private Const SHGFI_ICON = &H100 ‘ get icon Private Const MAX_PATH = 260 Private Type SHFILEINFO hIcon As Long ‘ out: icon iIcon As Long ‘ out: icon index dwAttributes As Long ‘ out: SFGAO_ flags szDisplayName As String * MAX_PATH ‘ out: display name (or path) s

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.