I want to run soem code by rolling a mouse wheel.
MFC, doc/view
In Mainframe header:
afx_msg BOOL OnMouseWheel (UINT nFlags, short zDelta, CPoint pt);
In Mainframe source message map:
ON_WM_MOUSEWHEEL()
Event handler:
BOOL CMainFrame::OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
{
if (zDelta>0)
{
OnDemokey();
}
else
{
OnMinuskey();
};
return TRUE;
};
If i roll forward my code cyling in "OnDemokey();" if i roll back - in "OnMinuskey();"
What have I do to make act of rolling the wheel to work like an ordinary key pressing?