opengl and mfc-dialog


I have a code that renders opengl inside a static control in the MFC Dialog box.

How can i handle mouse events, like mouse wheel and exact points of left/right button clicks etc. ??

please give me some pointers here… i have looked at the STN_CLICKED notifications (SS_NOTIFY) from the static control, but that doesnt seem to do much !!!

pls help!


Simple just put your events like OnMouseMove(…) in your CxxxxDlg class. For the mouse position translate/map to and from the OpenGL window coordinates to mouse (static control)coordinates. I wasn’t cleaver enough to query Windows for the control dimensions and location so I had to “calibrate” or eyeball the coefficients for the linear mapping.

Thank You for youe help. I will try it out