Click here to Skip to main content
15,903,175 members

Comments by Member 12192742 (Top 4 by date)

Member 12192742 18-Dec-15 23:42pm View    
Please provide solution for the issue,I didn't found any function anywhere which can scroll the ATL Dialog with the help of mousewheel.
Member 12192742 17-Dec-15 23:10pm View    
OnVerticalScrollBar function is working fine for clicking and drag drop on scroll bar in scrollbar region to scroll the dialog. But I want something like:
LRESULT CUIWindowPage::OnMouseWheel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
??
}

So that I can scroll the same dialog using my mousewheel.
Member 12192742 17-Dec-15 23:06pm View    
LRESULT CRichBiasWindowPage::OnVerticalScrollBar( UINT uMsg, WPARAM wParam , LPARAM lParam, BOOL& bHandled )
{
int iScrollCode = (int)LOWORD(wParam);
SCROLLINFO si = {sizeof(SCROLLINFO), SIF_ALL, 0, 0, 0, 0,0};

GetScrollInfo (SB_VERT, &si);
int iVertPos = si.nPos;
switch (iScrollCode)
{
case SB_LINEUP:
si.nPos = iVertPos;
if(si.nPos < SCROLL_LINEMINRANGE)
{

si.nPos = 0;
}
else
{
si.nPos -= SCROLL_LINEMINRANGE;
}
break;
case SB_PAGEUP: //user clicks middle of scroll bar
si.nPos = iVertPos;
if(si.nPos < SCROLL_PAGEMINRANGE)
{

si.nPos = 0;
}
else
{
si.nPos -= SCROLL_PAGEMINRANGE;
}
break;
case SB_LINEDOWN:
si.nPos = iVertPos;
if(si.nPos > (SCROLL_MAX - SCROLL_LINEMINRANGE))
{

si.nPos = SCROLL_MAX;
}
else
{
si.nPos += SCROLL_LINEMINRANGE;
}
break;
case SB_PAGEDOWN: //user clicks middle of scroll bar
si.nPos = iVertPos;
if(si.nPos > (SCROLL_MAX - SCROLL_PAGEMINRANGE))
{

si.nPos = SCROLL_MAX;
}
else
{
si.nPos += SCROLL_PAGEMINRANGE;
}
break;
case SB_THUMBTRACK:
si.nPos = (int)HIWORD(wParam);
break;

case WM_MOUSEWHEEL:
if ((short )GET_WHEEL_DELTA_WPARAM(wParam) > 0)
{

}
break;
if ((short)GET_WHEEL_DELTA_WPARAM(wParam) < 0)
{

}
break;


}
SetScrollPos(SB_VERT, si.nPos, FALSE);
ScrollWindow(0, (iVertPos - si.nPos)*SCROLL_VARIANCE, NULL, NULL);
return 1;
}
Member 12192742 17-Dec-15 22:58pm View    
I have ATL Dialog where there is a vertical Scrollbar which is working fine with mouse clicking on scrollbar and then drag and drop on scroll area region , but I am not able to scroll the same dialog with mouse wheel. Please help me providing how to implement mouse wheel functionality so that the dialog can be scrolled.