|
-
Mar 18th, 2001, 10:17 AM
#1
Thread Starter
Lively Member
I am trying to find the scroll Position in a Rechtextbox control. but I am always getting 0,0 as the coordinate. The function SendMessage is always returning 0 which mean something is wrong. This function should return 1 which means successful execution. But somehow I am not getting the answer right. Can somebody help me what am I doing wrong here.
'Declaration in Form Module
Private Sub Command1_Click()
Dim udtScrollPos As tagPOINT
Dim lngWin32apiResultCode As Long
With RichTextBox1
lngWin32apiResultCode = _
SendMessage(.hwnd, _
EM_GETSCROLLPOS, _
0, _
udtScrollPos)
End With
With udtScrollPos
Label3.Caption = "(" & .x & "-" & .y & ")"
End With
End Sub
'Declaration in General Module
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_USER As Long = &H400
Public Const EM_GETSCROLLPOS = WM_USER + 221
Type tagPOINT
x As Long
y As Long
End Type
-
Mar 20th, 2001, 04:01 AM
#2
The MSDN states that this only works on rich edit controls version 3.0 and above.
Last edited by Lord Orwell; Mar 20th, 2001 at 04:04 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|