Shoutbox

[?] EditControls... but how can I control them? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [?] EditControls... but how can I control them? (/showthread.php?tid=69071)

[?] EditControls... but how can I control them? by Matti on 12-02-2006 at 03:39 PM

So far, I was able to do everything I needed with just the PlusWnd::GetControlText and PlusWnd::SetControlText functions. But now I'm quite stuck. I want to change the position of the cursor in an EditControl, and set a selection. According to MSDN, it has to be possible, but those messages don't seem to have effect on them:

code:
var EM_SETSEL = 0xB1;
var pos = 2;
PlusWnd.SendControlMessage(PlusWnd.GetControlHandle("EdtExp"), EM_SETSEL, pos, pos+1);
should do it, but it doesn't. :(

Any ideas? :)
RE: [?] EditControls... but how can I control them? by Eljay on 12-02-2006 at 04:07 PM

umm youre using SendControlMessage wrong :P

first parameter should be the control id (in this case "EdtExp") not a hwnd ;)


RE: [?] EditControls... but how can I control them? by Matti on 12-02-2006 at 05:14 PM

DOOH! :P

Stupid me looking at the MSDN page and thinking it needs a control handler while Plus! does that. 8-)

Many thanks!!! :D


Okay, new question: I have some buttons which change the text in my edit control and now I want to give the edit control focus after the button is clicked so the user can type in it. Any ideas how I can do that?
RE: [?] EditControls... but how can I control them? by Mnjul on 12-03-2006 at 02:24 PM

Use the SetFocus Windows API . This time you'll need GetControlHandle :p

code:
Interop.Call("user32.dll","SetFocus",PlusWnd.GetControlHandle("EdtExp"));


RE: [?] EditControls... but how can I control them? by Matti on 12-03-2006 at 02:47 PM

Okay, thanks! :D