I am really curious how far the ThinBASIC embedding could be pushed. I consider this area very interesting.
For random forum visitors - this release contains updated TBGL module with support for Drag&Drop. If you ever tried to do this using Win32 API, you are probably gray haired man now. With TBGL, it gets more simple:
Step #1: Subscribe for receiving notification about files being dragged to your window
' -- The following enables programmer to handle dropping files to window
' -- The window is identified via hWnd handle
' -- Once the event occurs, the function Main_OnDropFiles will be launched
TBGL_BindWindowEvent(hWnd, %TBGL_OnDropFiles, Main_OnDropFiles)
Of course -the function does not need to be called Main_OnDropFiles, you are free to choose any other function name.
Step #2: Handle the event
' -- Function fired thanks to previous bind using TBGL_BindWindowEvent
Function Main_OnDropFiles()
' -- Retrieve number of files
Long nFiles = TBGL_OnDropFiles_GetFileCount()
Long i
' -- Iterate through all of them and list their names
For i = 1 To nFiles
MsgBox TBGL_CallingWindow, "File " + Format$(i) + " is " + TBGL_OnDropFiles_GetFileName(i)
Next
End Function
Petr
Bookmarks