Quote:
Originally Posted by TonyGlover
I tried like this, but it doesn't work.
Cannot work exactly like windows I suppose, there is a variable m_supports_ddrop which is false, this disable drop actions.
Maybe must call swellSetExtendedStyle to set m_supports_ddrop=true
|
SetWindowLong calls swellSetExtendedStyle. (WS_EX_ACCEPTFILES can also be put in the resource file, mac_resgen.php supports it.)
This works here:
Code:
WDL_DLGRET DialogProc(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
case WM_INITDIALOG:
SetWindowLong(handle, GWL_EXSTYLE, WS_EX_ACCEPTFILES);
return 0;
case WM_DROPFILES: {
HDROP drop { reinterpret_cast<HDROP>(wParam) };
unsigned int count { DragQueryFile(drop, -1, nullptr, 0) };
printf("dropped %d files\n", count);
DragFinish(drop);
return 0;
}
// ...
}
}