Prev Next
The EM_EXSETSEL message selects a range of characters and/or OLE objects in a
rich edit control.
EM_EXSETSEL
wParam = 0;
lParam = (LPARAM) (CHARRANGE FAR *) ichCharRange;
Parameters
-
ichCharRange
-
Zero-based index of the character.
Return Values
Returns the zero-based index of the line.
Comments:
-
-
sendmessage Byref or Byval error
hi all,
in vb, sometimes you use sendmessage to read and sometimes to write info.
if you want to use for reading you must use Byref, but if you want to write you must use byval
It was making me mad, somethig working and something not...
so:
'to read
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByRef wParam As Long, ByRef lParam As Any) As Long
'to write
Private Declare Function SendMessageA Lib "user32" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
Private Const WM_SETTEXT = &HC
Private Const EM_SETSEL = &HB1
Private Const EM_GETSEL = &HB0
Private Const EM_REPLACESEL = &HC2
Private Const EM_EXLIMITTEXT = &HD5
Private Const EM_GETSELTEXT = &H43E
Private Const EM_GETTEXT = &HD
and for example you can now see that both of those codes work:
SendMessageA txtBox.hwnd, EM_SETSEL, (start_sel), (end_sel)
and
SendMessage txtBox.hwnd, EM_GETSEL, l_startsel, l_endsel