开发者

listen for events in c++

I got a CWnd like thie CWnd * pWnd = pDC->GetWindow(); Is开发者_JAVA技巧 there away I can be notified when the windows is closing?


Yes, you can use Windows Hooks.

http://msdn.microsoft.com/en-us/library/ms632589(VS.85).aspx


I've not done MFC for years so don't know if this will work but can you:

  1. call CWnd::Detach() to get the handle of the window
  2. Attach it to your own derived CWnd, with a CWnd::Attach() and have an override of afx_msg void OnClose( );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜