Hi Chris,
unfortunately it does not work.I made all the changes to Longptr
I am using your code in two windows, in none of them the pbm_dropfiles event ( = ue_dropfiles) fires. In debugging mode I set a breakpoint at the beginning of the event, but it never stops there.
Here is the code:
LOCAL EXTERNAL FUNCTIONS
FUNCTION ulong DragQueryFile(Longptr al_hDrop, ulong ai_File, REF string as_FileName, ulong ai_cb) LIBRARY "shell32.dll" alias for "DragQueryFileW"
SUBROUTINE DragAcceptFiles(Longptr l_hWnd,boolean fAccept) LIBRARY "shell32.dll" // alias for "DragAcceptFiles"
SUBROUTINE DragFinish(ulong hDrop) LIBRARY "shell32.dll" Alias for "DragFinish"
IN OPEN EVENT of the Window:
Postevent("ue_enabledrag")
IN EVENT UE_ENABLE_DRAG:
DragAcceptFiles(handle(this), true)
IN EVENT UE_DROPFILES with Event_ID pbm_dropfiles:
String ls_path
String ls_temp
ulong lul_file, lul_max_files
Long ll_pos1,ll_pos2
Constant ULong lul_hex = 4294967295
ULong lul_pathSize = 1023
ulong lul_index
ls_path = Space(lul_pathSize)
lul_max_files = DragQueryFile(handle, lul_hex, ls_path, lul_pathSize)
IF lul_max_files > 0 THEN
DO WHILE lul_index >= 0 and lul_index < lul_max_files
ls_path = Space(lul_pathSize)
lul_file = DragQueryFile(handle, lul_index, ls_path, lul_pathSize)
IF lul_file > 0 THEN
fw_import(ls_path)
lul_index++
ELSE
lul_index = -1
END IF
LOOP
END IF
DragFinish(handle)
it's a typo mismatch in the post. I used Drag&Drop Code in different windows and it worked fine until migrating to 2022. By dragging a file, you can see the drag-icon at mouse-pointer. But event pbm_dropfiles does not fire any longer. I tried same code in a new and not inherited window. But same reaction. creating a new workspace and testing ist, or opening Chis file example all works fine.
There must something inhibit /or capture earlier?) pbm_dropfiles from fireing in my application.
Best regards
Stephan