//处理低权限向高权限进程发消息的失败的问题
	if(windows::version::instance()->IsVistaOrLater())
	{
		typedef BOOL (WINAPI *PChangeWindowMessageFilter)(UINT, DWORD);
		if(HINSTANCE h = LoadLibrary(L"User32.dll"))
		{
			PChangeWindowMessageFilter ChangeWindowMessageFilter = (PChangeWindowMessageFilter)GetProcAddress(h, "ChangeWindowMessageFilter");
			if( ChangeWindowMessageFilter)
			{
				ChangeWindowMessageFilter(WM_COPYDATA, /*MSGFLT_ADD*/1);
				ChangeWindowMessageFilter(WM_DROPFILES, /*MSGFLT_ADD*/1);
				ChangeWindowMessageFilter(0x0049/*WM_COPYGLOBALDATA*/, /*MSGFLT_ADD*/1);
			}
		}
	}
posted on 2015-04-15 14:15  爬坡  阅读(527)  评论(0编辑  收藏  举报