首页 › 月度存档 › 2月 2017

简单方法解决Vista/Win7/Win10无法接收WM_DROPFILES问题

今天真给这WM_DROPFILES郁闷了下,程序本来运行的好好的,后来改为以管理员身份运行后愣是没反应。没办法,程序必须要有一定的权限才能正常工作,偶菜鸟只能问人找资料了。

在MSDN上翻到了“Understanding and Working in Protected Mode Internet Explorer”,知道了Vista(当然包括Win7)introduced the UIPI which does not allow low right process to send message to the high right processes, 就不让你低权限的给高权限的发消息,~
里面有“Allowing Drag and Drop Operations in your Application”,可是,我按照去做了,往注册表加了那些东西,还是没反应,那个郁闷,囧~
再后来,Google到了CSDN,哈,还是那的答案给我解决了!简单~
加上
ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
其中#define WM_COPYGLOBALDATA 0x0049,说是DDK里面的头文件有~
继续阅读 »