What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Cursor Position in Plus text boxes

Cursor Position in Plus text boxes
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Cursor Position in Plus text boxes
quote:
Originally posted by win_crook
Here is the code that defines start:
code:
var EM_GETSEL = 0xB0;
var EM_SETSEL = 0xB1;
var Start = Interop.Allocate(32);
Interop.Call("user32", "SendMessageW", Wnd.GetControlHandle("NameEdit"), EM_GETSEL, Start, 0);


When you are allocating memory to a variable you cannot simply reference the variable itself. In this case the value you are trying to read is a DWORD.

You need to replace:
code:
var text = Wnd.GetControlText("NameEdit");
var firstHalf = text.substring(0, Start);
var secondHalf = text.substring(Start, before.length);


With this
code:
var text = Wnd.GetControlText("NameEdit");
var firstHalf = text.substring(0, Start.ReadDWORD(0));
var secondHalf = text.substring(Start.ReadDWORD(0), before.length);


And where does before come into play?

Also why are you allocating 32 bytes of memory to Start? It should be 4.

This post was edited on 04-08-2007 at 02:44 PM by matty.
04-08-2007 02:44 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Cursor Position in Plus text boxes - by win_crook on 04-07-2007 at 05:47 PM
RE: Cursor Position in Plus text boxes - by Patchou on 04-07-2007 at 06:04 PM
RE: Cursor Position in Plus text boxes - by win_crook on 04-07-2007 at 06:21 PM
RE: RE: Cursor Position in Plus text boxes - by felipEx on 04-07-2007 at 08:48 PM
RE: Cursor Position in Plus text boxes - by win_crook on 04-08-2007 at 12:00 PM
RE: Cursor Position in Plus text boxes - by effection on 04-08-2007 at 12:32 PM
RE: Cursor Position in Plus text boxes - by win_crook on 04-08-2007 at 12:36 PM
RE: Cursor Position in Plus text boxes - by matty on 04-08-2007 at 02:44 PM
RE: Cursor Position in Plus text boxes - by win_crook on 04-08-2007 at 02:49 PM
RE: Cursor Position in Plus text boxes - by Felu on 04-08-2007 at 03:41 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On