|
-
Aug 14th, 2009, 01:53 PM
#1
[RESOLVED] SendMessage EM_EXSETSEL problem
Hai folks,
the EM_EXSETSEL expects a CHARRANGE Structure in the lparam.
now i dont no how to use this EM_EXSETSEL with CHARRANGE in sendmessage.
this does not work, type mistmatch since the sendmessage() last para i have is long.
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Code:
Dim cr As CharRange
cr.cpMin = 0
cr.cpMax = -1
SendMessage wnd, EM_EXSETSEL, 0&, cr ' here cr is marked as type misedmatch.
pls kindly give the correct format.
pls help.
-
Aug 14th, 2009, 02:24 PM
#2
Re: SendMessage EM_EXSETSEL problem
UDT/Structures must be passed ByRef and the argument either declared As Any or as the specific UDT name.
Code:
Private 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 Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As CharRange) As Long
If you need the SendMessage function declared in a specific way for other messages, you can add another declaration with a different function name
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendCharRangeMsg Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
SendCharRangeMsg wnd, EM_EXSETSEL, 0&, cr
Last edited by brucevde; Aug 14th, 2009 at 02:30 PM.
-
Aug 14th, 2009, 11:12 PM
#3
Re: SendMessage EM_EXSETSEL problem
UDT/Structures must be passed ByRef and the argument either declared As Any or as the specific UDT name.
very valuable piece of information this is for me 
tx brucevde
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
|