Drag drop does not work on windows 7 and later

一旦把应用程序的UIAccess 属性设置为TRUE
<requestedExecutionLevel
          level="asInvoker"
          uiAccess="true"
        />
就收不到WM_DROPFILES消息了。。。。。。。

这是什么鬼?

首先我们想到了 这个应该是权限问题引发的血案,于是想到~

  if (!ChangeWindowMessageFilterEx(hWnd, WM_DROPFILES, MSGFLT_ALLOW, NULL))
   {
	   MessageBox(NULL, _T("ChangeWindowMessageFilterEx Fail"), _T("ChangeWindowMessageFilterEx Fail"), MB_O
这回应该解决了吧?

并没有!!!!!!!!!!。。。。。。。。。。

WHY!!!


原来拖动过程 需要靠剪切板来传递数据,,
需要这样处理
   if (!ChangeWindowMessageFilterEx(hWnd, WM_DROPFILES, MSGFLT_ALLOW, NULL))
   {
	   MessageBox(NULL, _T("ChangeWindowMessageFilterEx Fail"), _T("ChangeWindowMessageFilterEx Fail"), MB_OK);
   }
   if (!ChangeWindowMessageFilterEx(hWnd, WM_COPYDATA, MSGFLT_ALLOW, NULL))
   {
	   MessageBox(NULL, _T("ChangeWindowMessageFilterEx Fail"), _T("ChangeWindowMessageFilterEx Fail"), MB_OK);
   }
   if (!ChangeWindowMessageFilterEx(hWnd, 0x0049, MSGFLT_ALLOW, NULL))
   {
	   MessageBox(NULL, _T("ChangeWindowMessageFilterEx Fail"), _T("ChangeWindowMessageFilterEx Fail"), MB_OK);
   }



你可能感兴趣的:(Drag drop does not work on windows 7 and later)