How to get WM_VSCROLL?
-
Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk
-
Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk
Overide WM_VSCROLL message in your Window if you are using the MFC the Function Declaration is like this
OnHScroll(UINT nSBCode,UINT nPos,CScrollBar *pScrollBar)
where
pScrollbar
contain pointer to that Scrollbar if it is not Window Default Scrollbar. In Win32 lParam contain the pointer to The Scrollbar you have to typecast that. ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk -
Overide WM_VSCROLL message in your Window if you are using the MFC the Function Declaration is like this
OnHScroll(UINT nSBCode,UINT nPos,CScrollBar *pScrollBar)
where
pScrollbar
contain pointer to that Scrollbar if it is not Window Default Scrollbar. In Win32 lParam contain the pointer to The Scrollbar you have to typecast that. ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk -
Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk
Are you using switch case like this
switch(LOWORD(pMsg->message))
or using some other method ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
-
Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk
Normally you write your code inside OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); Should you still want to intercept the WM_SCROLL message, then use the PreTranslateMessage() function of your app class (not the dlg one) SkyWalker