Support SDL_EVENT_DROP_FILE in Windows with IDropTarget instead of WM_DROPFILES (thanks @Dragon-Baroque!) #10447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a tweaked version of #10415, adapted to CoInitialize and OleInitialize() during SDL_VideoInit(), so we know whether OLE functionality is available in advance. This also prevents surprising the application by enabling OLE functionality after video initialization depending on what events are enabled.
From the original PR:
Remove WM_DROPFILES ( supports only SDL_EVENT_DROP_FILE ), use IDropTarget instead ( provides SDL_EVENT_DROP_POSITION, SDL_EVENT_DROP_FILE and SDL_EVENT_DROP_TEXT ).
Description
In src/video/windows/SDL_windowswindow.c + .h,
Create IDropTarget and issue SDL_SendDropPosition,
Handle text/uri-list for SDL_SendDropFile, text/plain;charset=utf-8 and CF_UNICODE_TEXT and CF_TEXT for SDL_SendDropText, CF_HDROP for SDL_SendDropFile.