开发者

listen for events in c++

开发者 https://www.devze.com 2023-01-01 09:15 出处:网络
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.

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

精彩评论

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

关注公众号