home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Today (BR) Volume 4 #14
/
CDRTODAY.iso
/
SCROLL.BAS
< prev
next >
Wrap
BASIC Source File
|
1997-05-23
|
2KB
|
51 lines
Global valorAntigo As Integer
Global Const WM_USER = &H400
Global Const EM_GETFIRSTVISIBLELINE = (WM_USER + 30)
Declare Function GetFocus% Lib "user" () ' For Visual Basic 1.0 only.
Declare Function PutFocus% Lib "user" Alias "SetFocus" (ByVal hWd%)
Declare Function SendMessage& Lib "user" (ByVal hWd%, ByVal wMsg%, ByVal wParam%, ByVal lParam&)
Function numLinhas (textBox As Control)
Const EM_GETLINECOUNT = &H40A ' Defined within Windows SDK
' file, WINDOWS.H.
' Print the amount of lines to the immediate window.
numLinhas = SendMessage(textBox.hWnd, EM_GETLINECOUNT, 0, 0)
End Function
Function numPrimLinha (textBox As Control)
Const WM_USER = &H400
Const EM_GETFIRSTVISIBLELINE = (WM_USER + 30)
numPrimLinha = SendMessage(textBox.hWnd, EM_GETFIRSTVISIBLELINE, 0, 0)
End Function
Function scrollText& (textBox As Control, vLines As Integer, hLines As Integer)
' The following two lines must appear on a single line:
Const EM_LINESCROLL = &H406
' Place the number of horizontal columns to scroll in the high-
' order 2 bytes of Lines&. The vertical lines to scroll is
' placed in the low-order 2 bytes.
Lines& = CLng(&H10000 * hLines) + vLines
' Pega o handle do textbox passado como parΓmetro
'Camom SavedWnd% = textBox.hWnd
' Scroll the lines.
'Camom Success& = SendMessage(textBox.hWnd, EM_LINESCROLL, 0, Lines&)
' Restore the focus to the original control, Command1 or
' Command2.
r% = PutFocus%(SavedWnd%)
' Return the number of lines actually scrolled.
scrollText& = Success&
End Function