Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get selected text from multiline inputfield
#1
In a dialog with a multi-line inputfield with a button get selected text,When I try to get the selected text by pressing a button within that same dialog, the text get's de-selected as soon the focus is lost on the mult-line inputfield.

Is there a way to get the selected text?

EDIT: I tried to grab the selected text (getsel and setclip) on "case EN_KILLFOCUS<<16|5" , but it doesn't work either.

Below the dialog example:

Function ErrMsgFull2
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 404 178 "Dialog"
;6 Button 0x54032000 0x0 4 160 158 14 "Open/Run selected"
;7 Static 0x54000000 0x0 50 6 308 44 ""
;5 Edit 0x54231044 0x200 4 56 398 98 ""
;1 Button 0x54030001 0x4 352 160 48 14 "Close"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

str controls = "5"
str e5
e5="d:\____TEMP\[]www.google.com"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 6        
,,str getsel_txt.getsel
,,getsel_txt.trim
,,out getsel_txt
,case IDOK
,case IDCANCEL
ret 1
#2
Function ErrMsgFull2
Code:
Copy      Help
,,str getsel_txt.getsel(0 0 id(5 hDlg))
#3
That simple...beautiful!!!!
THANK YOU!!!


Forum Jump:


Users browsing this thread: 2 Guest(s)