Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API SendMessage Point to small

Status
Not open for further replies.

tommyvb

Programmer
Dec 27, 2004
1
NL
I want to use the sendmessage EM_GETSCROLLPOS to get the scrollposition of a richtextbox and send it to an other richtextbox.

It al works fine but when i load a lot of data in the richtextbox the value of the point in the api is bigger then the integer of the point type can handle (>65386)

The help say's that a point can handle values up to 2,147,483,647

what am i doing wrong??

Code:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Point) As Integer
  
Private Sub myTextRTB_VScroll(ByVal sender As Object, ByVal e As System.EventArgs) Handles myTextRTB.VScroll
    Dim myPoint As Point = New Point
   
    SendMessage(myTextRTB.Handle.ToInt32,
               sendMessageEnum.EM_GETSCROLLPOS, 0, myPoint)
    SendMessage(myLineRTB.Handle.ToInt32,
              sendMessageEnum.EM_SETSCROLLPOS, 0, myPoint)
end sub
[end code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top