D
decrypted
I am trying to get some information regarding a scrollbar on a
control...specifically on a system.windows.forms.form control (but
ultimately any old control). So I want to use SCROLLBARINFO struct from
win32API via GetScrollBarInfo...my definitions are as follows:
public struct RECT { public int left, top, right, bottom; }
public struct SCROLLBARINFO
{
public int cbSize;
public RECT rcScrollBar;
public int dxyLineButton;
public int xyThumbTop;
public int xyThumbBottom;
public int reserved;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,
SizeConst=6)]
public int[] rgstate;
}
[DLLImport("user32.dll", CharSet=CharSetAuto)]
static public extern int GetScrollBarInfo(IntPtr hWnd, long idObject, ref
SCROLLBARINFO sbi);
Now that I have my definitions...I call will the following code in a custom
input control:
SCROLLBARINFO sbi = new SCROLLBARINFO();
GetScrollBarInfo(hWndRef, 0xFFFFFFFA, ref sbi);
this call throws error code 986 out everytime (wether there is a scrollbar
present on the ref control or not) and sbi return as an emtpy struct. Any
thoughts?
thanks in advance,
dec.
control...specifically on a system.windows.forms.form control (but
ultimately any old control). So I want to use SCROLLBARINFO struct from
win32API via GetScrollBarInfo...my definitions are as follows:
public struct RECT { public int left, top, right, bottom; }
public struct SCROLLBARINFO
{
public int cbSize;
public RECT rcScrollBar;
public int dxyLineButton;
public int xyThumbTop;
public int xyThumbBottom;
public int reserved;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,
SizeConst=6)]
public int[] rgstate;
}
[DLLImport("user32.dll", CharSet=CharSetAuto)]
static public extern int GetScrollBarInfo(IntPtr hWnd, long idObject, ref
SCROLLBARINFO sbi);
Now that I have my definitions...I call will the following code in a custom
input control:
SCROLLBARINFO sbi = new SCROLLBARINFO();
GetScrollBarInfo(hWndRef, 0xFFFFFFFA, ref sbi);
this call throws error code 986 out everytime (wether there is a scrollbar
present on the ref control or not) and sbi return as an emtpy struct. Any
thoughts?
thanks in advance,
dec.