F
feitianbianfu16
Unregistered / Unconfirmed
GUEST, unregistred user!
我用下面的代码创建了一个scrollbar,如何找到它的handle呀?有没有什么api函数呀?
SIOld.cbSize := SizeOf( SIOld );
SIOld.fMask := SIF_ALL;
GetScrollInfo( Self.Handle, SB_VERT, SIOld );
SINew := SIOld;
SINew.nMin := 0;
SINew.nPage := Self.ClientHeight;
SINew.nMax := TotalHeight;
SINew.nPos := FScrollPosition;
if ( SINew.nMin <> SIOld.nMin ) or
( SINew.nMax <> SIOld.nMax ) or
( SINew.nPage <> SIOld.nPage ) or
( SINew.nPos <> SIOld.nPos ) then
begin
SetScrollInfo( Self.Handle, SB_VERT, SINew, True );
if Integer( SINew.nPage ) > SINew.nMax then
ScrollPosition := SINew.nMin;
Invalidate;
end;
SIOld.cbSize := SizeOf( SIOld );
SIOld.fMask := SIF_ALL;
GetScrollInfo( Self.Handle, SB_VERT, SIOld );
SINew := SIOld;
SINew.nMin := 0;
SINew.nPage := Self.ClientHeight;
SINew.nMax := TotalHeight;
SINew.nPos := FScrollPosition;
if ( SINew.nMin <> SIOld.nMin ) or
( SINew.nMax <> SIOld.nMax ) or
( SINew.nPage <> SIOld.nPage ) or
( SINew.nPos <> SIOld.nPos ) then
begin
SetScrollInfo( Self.Handle, SB_VERT, SINew, True );
if Integer( SINew.nPage ) > SINew.nMax then
ScrollPosition := SINew.nMin;
Invalidate;
end;