Focus / Not Focused
-
Hi all, I have a dialog with the followings: 1) it is a modal dialog 2) it is always on top 3) it has no frame (style = popup, border = none) my question is this, when the dialog has focus (which means i am clicking over it or moving my mouse over is) i want to do one thing, but when the focus leaves the dialog (click somewhere else, or move mouse somewhere else) i want to do something else..... i tried to catch these messages and it didn't work properly: 1) WM_SETFOCUS/ WM_KILLFOCUS 2) WM_ACTIVATE / WM_ACTIVATE_APP can any1 help me here? thanks in advanced Yaron
-
Hi all, I have a dialog with the followings: 1) it is a modal dialog 2) it is always on top 3) it has no frame (style = popup, border = none) my question is this, when the dialog has focus (which means i am clicking over it or moving my mouse over is) i want to do one thing, but when the focus leaves the dialog (click somewhere else, or move mouse somewhere else) i want to do something else..... i tried to catch these messages and it didn't work properly: 1) WM_SETFOCUS/ WM_KILLFOCUS 2) WM_ACTIVATE / WM_ACTIVATE_APP can any1 help me here? thanks in advanced Yaron
-
Try SetCapture to get mouse input even if it's outside of your dialog. To act only once when mouse cursor leaves dialog area try to catch WM_MOUSELEAVE, WM_NCMOUSELEAVE. Hope that's what you need. Mickey :)
-
hi, thanks for reply. I don't know how to catch these messages, can you show me? thanks Yaron Ask not what your application can do for you, Ask what you can do for your application
-
In your derived class MESSAGE_MAP section BEGIN_MESSAGE_MAP(CMyDialog, CDialog) ON_MESSAGE(WM_MOUSELEAVE,OnMouseLeave) END_MESSAGE_MAP() Mickey :)