Posts: 1,058
Threads: 367
Joined: Oct 2007
I wonder whether there exists a quick method to return a ShowText selected line number, as in the case of j=PopupMenu. Actually, I can do it by trigering accessible object on Showtext window, but I am not happy with it, I do not find it elegant.
Best regards in advance
Simos
Posts: 12,072
Threads: 140
Joined: Dec 2002
Function
ShowTextAndReturnLineIndex
;/
function# $caption $text [hwndowner] [flags]
;Everything is the same as with <tip "#ShowText">ShowText</tip>, except:
;;;returns selected line index.
;;;flag 1 (nonmodal) unavailable.
opt waitmsg 1
int i he=id(3 ShowText(caption text hwndowner flags|1))
rep
,0.01
,if(!IsWindow(he)) break
,i=SendMessage(he EM_LINEFROMCHAR -1 0)
ret i
Macro
int i=ShowTextAndReturnLineIndex("test" "one[]two[]three")
out i
Posts: 1,058
Threads: 367
Joined: Oct 2007
Dear Gintaras,
Superb,
Best Regards
Simos