日期:2014-05-18 浏览次数:21133 次
SCROLLINFO si = new SCROLLINFO(); si.cbSize = (uint)Marshal.SizeOf(si); si.fMask = (uint)ScrollInfoMask.SIF_ALL; WIN32.GetScrollInfo(this.Handle, (int)SBOrientation.SB_VERT, ref si) [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool GetScrollInfo(IntPtr hwnd, int fnBar, ref SCROLLINFO lpsi); [Serializable, StructLayout(LayoutKind.Sequential)] public class SCROLLINFO { public uint cbSize; public uint fMask; public int nMin; public int nMax; public uint nPage; public int nPos; public int nTrackPos; } public enum ScrollInfoMask : uint { SIF_RANGE = 0x1, SIF_PAGE = 0x2, SIF_POS = 0x4, SIF_DISABLENOSCROLL = 0x8, SIF_TRACKPOS = 0x10, SIF_ALL = (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS), }