如题,求解~~~~~~~谢谢!
网上查查,都没看到解决的方法。对话框创建代码如下,BOOL ret = m_Dlg.Create(IDD_DIALOG_MESS ,CWnd::FromHandle(::GetDesktopWindow()));// CWnd::FromHandle(m_hParent)
if(ret==0)
{
return NULL;
}
::ShowWindow(m_Dlg.m_hWnd,SW_SHOW);
网上查查,都没看到解决的方法。对话框创建代码如下,BOOL ret = m_Dlg.Create(IDD_DIALOG_MESS ,CWnd::FromHandle(::GetDesktopWindow()));// CWnd::FromHandle(m_hParent)
if(ret==0)
{
return NULL;
}
::ShowWindow(m_Dlg.m_hWnd,SW_SHOW);
解决方案 »
- 开发工具
- dll中运行到 atlcom中,程序出错,错误原因可能是_pAtlModule没有被初始化
- 如何结束死循环,正常退出程序
- 移动控间简单问题!
- 请问扩展环境变量是什么意思啊?有什么用
- 请教网络高手,如何获得自动分配IP地址主机的IP?
- 如何决定CFormView类程序的窗口大小?
- 菜鸟问题:如何在MFC App中调用Windows SDK写的dll工程?
- ······求帮忙········
- ***公司值班人,老是看在线电视,搞的我下载很慢,我想自己编写一个程序,检测并杀掉他的RealPlay进程,但我不知道Realplay的窗口标题,该怎么办?
- vs2010中MFC动态编译转静态出错
- CInternetSession:同样的代码vc6正确,vc2008却得到乱码?为什么?
与父窗口共享消息,可在父窗口处理
是在你后面的那个窗口句柄
楼主的是:CWnd::FromHandle(::GetDesktopWindow())
怎么让非模态对话框自己响应PreTranslateMessage()呢???
怎么让非模态对话框自己响应PreTranslateMessage()呢???
{
// TODO: Add your specialized code here and/or call the base class
afxDump << "ChildDlg2::PreTranslateMessage\n" ; return CDialog::PreTranslateMessage(pMsg);
}
//
ChildDlg2child风格。
m_pDlg2=new CChildDlg2;
m_pDlg2->Create(IDD_DIALOG2,this);
m_pDlg2->ShowWindow(SW_SHOW);
rc1.left=rc.Width()/2;
rc1.right=rc.right;
rc1.top=0;
rc1.bottom=rc.bottom;
m_pDlg2->MoveWindow(&rc1);
看到有人是使用Hook方法来做的,真是难找啊,分享给大家LRESULT CALLBACK CMessMangerApp::GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
LPMSG lpMsg = (LPMSG) lParam; if(AfxGetApp()->PreTranslateMessage(lpMsg))
{
lpMsg->message = WM_NULL;
lpMsg->lParam = 0L;
lpMsg->wParam = 0;
} // Passes the hook information to the next hook procedure in
// the current hook chain.
return ::CallNextHookEx(hHook, nCode, wParam, lParam);
}BOOL CMessMangerApp::InitInstance()
{
hHook = ::SetWindowsHookEx(
WH_GETMESSAGE,
GetMessageProc,
AfxGetInstanceHandle(),
GetCurrentThreadId()); ASSERT (hHook);
return CWinApp::InitInstance();
}int CMyApp::ExitInstance()
{
UnhookWindowsHookEx((HHOOK)hHook);
return CWinApp::ExitInstance();
}