Add Window procedure to picture control
-
Hello, In a dialog, i have added picture control from resource. in this i am displaying an image accordingly at the runtime which is working fine. I need to zoom in / zoom out the displayed image according to mouse wheel move. I thought of adding window procedure to that picture control, so that i can handle mouse command over there. in MFC, i can see options and examples, but in win32 api, i dont know how to do that. Can anyone suggest me how to do. Regards, Gopi.
-
Hello, In a dialog, i have added picture control from resource. in this i am displaying an image accordingly at the runtime which is working fine. I need to zoom in / zoom out the displayed image according to mouse wheel move. I thought of adding window procedure to that picture control, so that i can handle mouse command over there. in MFC, i can see options and examples, but in win32 api, i dont know how to do that. Can anyone suggest me how to do. Regards, Gopi.
-
Hello, In a dialog, i have added picture control from resource. in this i am displaying an image accordingly at the runtime which is working fine. I need to zoom in / zoom out the displayed image according to mouse wheel move. I thought of adding window procedure to that picture control, so that i can handle mouse command over there. in MFC, i can see options and examples, but in win32 api, i dont know how to do that. Can anyone suggest me how to do. Regards, Gopi.
Just derive your own class from the CStatic (picture control is a static control), create the control member variable in the dialog for this picture control, and handle any Windows message you need in this derived class.
-
This article series could possibly help: Custom Controls in Win32 API: The Basics[^].
"In testa che avete, Signor di Ceprano?" -- Rigoletto
-
Just derive your own class from the CStatic (picture control is a static control), create the control member variable in the dialog for this picture control, and handle any Windows message you need in this derived class.
-
Thanks. my application is in win32 and picture control created through toolbox. how to subclass this control to CStatic (MFC) derived class?
1. Use MFC class Wizard to derive new MFC class from CStatic (say CMyPicture); 2. Change the control ID of your picture control from IDC_STATIC to something more sensible (like IDC_MYPICTURE); 3. Use MFC class Wizard to create the control member variable (of the new created type CMyPicture) for your picture control. Also see MSDH (docs.microsoft.com) for details.
-
1. Use MFC class Wizard to derive new MFC class from CStatic (say CMyPicture); 2. Change the control ID of your picture control from IDC_STATIC to something more sensible (like IDC_MYPICTURE); 3. Use MFC class Wizard to create the control member variable (of the new created type CMyPicture) for your picture control. Also see MSDH (docs.microsoft.com) for details.