首页 > 代码库 > 解决Win7下UAC开启时无法响应WM_DROPFILES消息
解决Win7下UAC开启时无法响应WM_DROPFILES消息
1 //以管理员身份运行,程序窗口就可以接收到拖放文件消息【WM_DROPFILES】了。2 ChangeWndMessageFilterOk(WM_DROPFILES, MSGFLT_ADD);3 ChangeWndMessageFilterOk(0x0049, MSGFLT_ADD); // 0x0049 == WM_COPYGLOBALDATA
1 BOOL CXXXFrameWnd::ChangeWndMessageFilterOk(UINT nMessage, BOOL bAllow) 2 { 3 typedef BOOL(WINAPI * ChangeWindowMessageFilterOkFn)(UINT, DWORD); 4 5 HMODULE hModUser32 = NULL; 6 hModUser32 = LoadLibrary(_T("user32.dll")); 7 if (hModUser32 == NULL) { 8 return FALSE; 9 }10 11 ChangeWindowMessageFilterOkFn pfnChangeWindowMessageFilter = (ChangeWindowMessageFilterOkFn)GetProcAddress(hModUser32, "ChangeWindowMessageFilter");12 if (pfnChangeWindowMessageFilter == NULL)13 {14 FreeLibrary(hModUser32);15 return FALSE;16 }17 18 FreeLibrary(hModUser32);19 20 return pfnChangeWindowMessageFilter(nMessage, bAllow ? MSGFLT_ADD : MSGFLT_REMOVE);21 }
转载:http://bbs.csdn.net/topics/390291295
转载:http://blog.csdn.net/lgxing/article/details/13171167
转载:http://blog.csdn.net/whatday/article/details/44278605
转载:http://www.cnblogs.com/findumars/p/5931332.html
转载:http://blog.csdn.net/ningbinzhang/article/details/39956801
解决Win7下UAC开启时无法响应WM_DROPFILES消息
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。