//以管理员身份运行,程序窗口就可以接收到拖放文件消息【WM_DROPFILES】了。
ChangeWndMessageFilterOk(WM_DROPFILES, MSGFLT_ADD);
ChangeWndMessageFilterOk(0x0049, MSGFLT_ADD); // 0x0049 == WM_COPYGLOBALDATA
BOOL CXXXFrameWnd::ChangeWndMessageFilterOk(UINT nMessage, BOOL bAllow)
{
typedef BOOL(WINAPI * ChangeWindowMessageFilterOkFn)(UINT, DWORD); HMODULE hModUser32 = NULL;
hModUser32 = LoadLibrary(_T("user32.dll"));
if (hModUser32 == NULL) {
return FALSE;
} ChangeWindowMessageFilterOkFn pfnChangeWindowMessageFilter = (ChangeWindowMessageFilterOkFn)GetProcAddress(hModUser32, "ChangeWindowMessageFilter");
if (pfnChangeWindowMessageFilter == NULL)
{
FreeLibrary(hModUser32);
return FALSE;
} FreeLibrary(hModUser32); return pfnChangeWindowMessageFilter(nMessage, bAllow ? MSGFLT_ADD : MSGFLT_REMOVE);
}
转载: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
还没有评论呢,快来抢沙发~