Reputation: 1592
I use Graphics32 library and put TImgView32 control on a form. In a code I want to get the position of a vertical scroll bar, but cannot find any properties for that.
How to get the position of a vertical scrollbar of TImgView32 control?
Upvotes: 1
Views: 550
Reputation: 595981
TImgView32
is a TCustomControl
descendant, which means it has its own HWND
. So, assuming that window is using a standard Win32-provided scrollbar, try the Win32 API GetScrollInfo()
function.
uses
Windows;
var
si: TScrollInfo;
begin
si.cbSize := sizeof(si);
si.fMask := SIF_POS;
if GetScrollInfo(ImgView1.Handle, SB_VERT, si) then
begin
// use si.nPos as needed...
end;
end;
Upvotes: 4