Anyone using ChangeWindowMessageFilterEx in a Xojo app to allow drag and drop from user desktop?

Hi Windows gurus,

Is anyone using the Windows API “ChangeWindowMessageFilterEx()” to allow the drag and drop of items from a user’s desktop to a Xojo app being run as Administrator?

Here’s the MS doc for the API:

BOOL WINAPI ChangeWindowMessageFilterEx(
  _In_        HWND                hWnd,
  _In_        UINT                message,
  _In_        DWORD               action,
  _Inout_opt_ PCHANGEFILTERSTRUCT pChangeFilterStruct
);

I believe that it will solve a problem that I face when running back-end tasks with elevated permissions. Specifically, my tasks must run as Administrator / Local System to access raw devices. If I run the task elevated, it can no longer communicate with the GUI. However, if I run the GUI as Administrator, the user can no longer drag and drop from the desktop.

In this, should the hWnd be the handle for the app’s parent window, or the drop target (Listbox, TextArea, etc.)?

In Windows, everything is a window : window, controls, containercontrols. So you can try using the handle of the target control, and it it does not work, the handle of self.