I cannot detect if the scrollbars of a form are visible. Googleing the Internet shows that the code below should work. Everybody uses it:
function VertScrollBarVisible(WindowHandle: THandle): Boolean;
begin
Result:= (GetWindowlong(WindowHandle, GWL_STYLE) AND WS_VSCROLL) <> 0
end;
I call it like this:
procedure TFrmBaser.Button1Click(Sender: TObject);
begin
if VertScrollBarVisible(MainForm.Handle)
then Caption:= 'visible';
end;
It returns False all the time, even is the scrollbars are visible. They are made visible by some MDI child forms that I drag a bit out of screen.
Delphi 7, Win XP SP3, Themes on