Ivan Z
Ivan Z

Reputation: 1592

Delphi: How to get the positions of scrollbars of TImgView32 control?

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

Answers (1)

Remy Lebeau
Remy Lebeau

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

Related Questions