I have a CStatic-derived class. When I get the WM_LBUTTONDOWN message, I change the current bitmap into another one, and restore them in the WM_LBUTTONUP message. It woks fine. Then I include it in my CDialog-derived class using DDX. However, when I add the ON_STN_CLICKED to the message map of my dialog, it does not receive any message. I assume that is because the control already managed te WM_LBUTTONDOWN message. What can I do about it? Prehaps I need to do some subclassing? Any thoughts will be really appreciated.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
I assume that is because the control already managed te WM_LBUTTONDOWN message. What can I do about it?
Maybe. Read some MSDN articles on MFC message routing.
Fernando A. Gómez F. wrote:
What can I do about it?
Lots of things. Since you have a custom control "CStatic-derived class" you can define a message that you post that the parent dialog can handle. Or you can do more of a Observer/Observable Design Pattern.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackayin the C# forum
That's a tray icon which has nothing to do with whether your application is minimized or not.
When you called Shell_NotifyIcon you had to specify a callback message in the NOTIFYICONDATA struct right? The lParam of that message would contain the mouse or keyboard message associated with the event.
Your app has to have the input focus in order to handle mouse messages. When your app is minimized it does not have the input focus. The only work around that I know of is to setup a global hook. See SetWindowsHookEx(WH_MOUSE, ...) in MSDN and do a search here on CP for "Global Hooks"
I have a quick question about serialization. I have a custom built classe (we'll call it MyClass) that contain standard C++ items (i.e. int, float, etc...), MFC objects (i.e. CString, etc...), a few vectors, and some of my custom classes as data memebers. If I derive it (MyClass) from CObject, can I use the standard MFC Serialize functions to save it (MyClass) to a file?