to drag from Explorer to a Control need 3 Steps
1.) DragAcceptFiles function
https://docs.microsoft.com/en-us/window ... ceptfiles
2.) DragQueryFileA function
https://docs.microsoft.com/en-us/window ... queryfilea
3.) DragFinish function
https://docs.microsoft.com/en-us/window ... dragfinish
and when moving
4.) DragQueryPoint function
https://docs.microsoft.com/en-us/window ... querypoint
---
in Harbour MiniGUI 1.4 Extended (Build 47) added by Grigory Filatov
you will find Source in c:\MiniGUI\SOURCE\c_winapimisc.c
the Source i saw was c:\MiniGUI\SAMPLES\Applications\RunCmd\RunCmd.prg
---
how it work :
1.) you need a Handle for DragAcceptFiles
this Sample is for Form
Code: Select all
DragAcceptFiles( GetFormHandle('Form_1'), .T. )
to get Handle of Control is
Code: Select all
hWnd := GetControlHandle( cObj, cForm )
2.) you need to get into Windows Message loop
this normal is handle by HMG in c:\hmg.3.4.4\SOURCE\h_windows.prg.
i have used modify Code from USB_Detect Sample
Code: Select all
CREATE EVENT PROCNAME Drop_Detect() HWND DropDemo.HANDLE STOREINDEX nIndex
MiniGUI Sample use
3.) get WM_DROPFILES Message
Code: Select all
FUNCTION Drop_Detect()
LOCAL nHWnd := EventHWND()
LOCAL nMsg := EventMSG()
LOCAL nWParam := EventWPARAM()
LOCAL nLParam := EventLPARAM()
CASE nMsg == WM_DROPFILES
aFiles := DragQueryFileS( nWParam )
MiniGUI have
Code: Select all
Function MyEvents ( hWnd, nMsg, wParam, lParam )
case nMsg == WM_DROPFILES
cCmd := DragQueryFile( wParam )
---
"My Problem"
when using CREATE EVENT PROCNAME Drop_Detect() Syntax it only work with Form.Handle NOT with Control.Handle
so i have to try MiniGUI Style with HMG ... this need some more time to figure out how it work.
---
when search for "Drop" i found these HMG Files
Code: Select all
C:\hmg.3.4.4\SOURCE\c_browse.c
C:\hmg.3.4.4\SOURCE\c_dialogs.c
C:\hmg.3.4.4\SOURCE\c_InitCom.c
C:\hmg.3.4.4\SOURCE\c_listbox.c
C:\hmg.3.4.4\SOURCE\c_windows.c
C:\hmg.3.4.4\SOURCE\h_dialogs.prg
C:\hmg.3.4.4\SOURCE\h_init.prg
C:\hmg.3.4.4\SOURCE\h_listbox.prg
C:\hmg.3.4.4\SOURCE\h_windows.prg
there seems to be a DragDrop Sample for ListBox but it seems me "internal" not from "outside"
btw. it is NOT Ole-DragDrop
DragQueryFile() will only give you a File-list with Name
Demo Code work but i have to find out how Demo Code work in hole HMG App or if Problem ...
so let me some Time to make it "safe" before i release Source Code
---
i have try MiniGUI Syntax with HMG and got
C:\hmg.3.4.4\0\DragAccept\dropfile.PRG(84) Error E0030 Syntax error "syntax error at 'EVENTS'"
in c:\MiniGUI\Include\i_controlmisc.ch
Code: Select all
#command SET EVENTS FUNCTION TO <fname> [ RESULT TO <lSuccess> ] ;
=> ;
[ <lSuccess> := ] SetGlobalListener( <"fname"> )
so it is not "easy" to implement it to HMG ...