c# - ListView onScroll event -
I am programming a simple C # application, and I need a Scallow event on the list view. So I inherited the original ListView class created in ListviewEx witch. I found out how to locate the scroll message from WinAPI and I modified the WndProc method. Now I have this WndProc:
protected override zero WndProc (Ref message message) {base.WndProc (Ref I); If (m.msg == WM_VSCROLL) {onScroll (This, New EventArgs ()); }}
But the problem is, I do not know how to know about scrolling information. This data should be in wParam, but there is a LOWORD macro ++ like in C in C # and I switch to find the criteria like SB_ below, SB_ENDSCROLL, SB_PAGEUP etc.
there any way Need to change the LOWORD macro from C #?
Or any other way to find the necessary parameters about scrolling?
You can define the WParam constants as the following:
Private const int WM_HSCROLL = 0x114; Private Constant WM_VSCROLL = 0x115; Private contact int SBHOZZ = 0; Private Consultant SB_VERT = 1; Private Constt SB_LinailFT = 0; Private constant int SB_Learait = 1; PRIVATE CONST INT SB_ PAGELEFT = 2; Personal Consultant SB_PAGERIGHT = 3; Private constant int SB_thumbopticon = 4; Private constant int SB_thumb bitrate = 5; Private contact int SBLET = 6; Private contact int SB_RIGHT = 7; Private Contact In SBDRRCRRR = 8; Private contact int SIF_TRACKPOS = 0x10; Private Consultant SIF_RANGE = 0x1; Private Consultant SIF_POS = 0x4; Private Consultant SIF_PAGE = 0x2; Personal Consultant SIF_ALL = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS;
WPAM will do something like this to real code:
if (m.msg == WM_VSCROLL) {ScrollInfoStruct si = new ScrollInfoStruct () ; Si.fMask = SIF_ALL; Si.cbSize = Marshall (UIT). Sizef (C); GetScrollInfo (msg.HWnd, SB_VERT, referee); If (msg.WParam.ToInt32 () == SB_ENDSCROLL) {ScrollEventArgs sargs = New ScrollEventArgs (ScrollEventType.EndScroll, si.nPos); Onskall (this, Serge); }}
pinvoke.net is a great site, which is to achieve constant values in the Windows32 API without inspecting the headache files.
Comments
Post a Comment