Shoutbox

[?] how to find character.. - 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: [?] how to find character.. (/showthread.php?tid=69353)

[?] how to find character.. by roflmao456 on 12-10-2006 at 11:48 PM

how do i find the character like in the script editor at the corner it shows what character you are at how do i put that ?


RE: [?] how to find character.. by matty on 12-10-2006 at 11:51 PM

Wha?!?

You want to know the position of a specific character?


RE: RE: [?] how to find character.. by roflmao456 on 12-10-2006 at 11:52 PM

quote:
Originally posted by Matty
Wha?!?

You want to know the position of a specific character?


precisesly :D

i want to find the "L" in "Hello" and show up what place it is at
RE: [?] how to find character.. by matty on 12-10-2006 at 11:56 PM

EM_POSFROMCHAR
EM_CHARFROMPOS


RE: [?] how to find character.. by roflmao456 on 12-10-2006 at 11:59 PM

quote:
Originally posted by Matty
EM_POSFROMCHAR

man i dont like links :D i want an example :(
RE: [?] how to find character.. by matty on 12-11-2006 at 12:16 AM

If we give you the code how will you learn... atleast attempt to do it.

You barely attempt anything and just ask for it. How about you you try and post what you try and we will correct it.

I will get you started

Wrong Function.

code:
var EM_POSFROMCHAR = 0xF0D6;
var POINTL = Interop.Allocate(8);
Interop.Call('user32',
             'SendMessageW',
             pPlusWnd.GetControlHandle('txtMyEditControl'),
             EM_POSFROMCHAR,
             POINTL.DataPtr,
             0);
// Specifies the horizontal (x) coordinate of the point.
Debug.Trace('POINTL.ReadDWORD(0) : '+POINTL.ReadDWORD(0));
//Specifies the vertical (y) coordinate of the point.
Debug.Trace('POINTL.ReadDWORD(4) : '+POINTL.ReadDWORD(4));


You can use String('Hello').indexOf('l');
RE: [?] how to find character.. by Spunky on 12-11-2006 at 12:23 AM

To be fair, anything with Interop.Allocate usually stumps me. The only time I managed to do it on my own was getting the mouse position (around 5 months after my first script). Some people learn better from examples than from MSDN (I have to admit MSDN is usually pretty complicated in it's explinations and often doesn't give the relevant HEX codes you need meaning you have to trawl google for them).


RE: [?] how to find character.. by CookieRevised on 12-11-2006 at 01:51 AM

quote:
Originally posted by SpunkyLoveMuff
and often doesn't give the relevant HEX codes you need meaning you have to trawl google for them.
Actually all constant values are listed in the msdn library too... Granted, you need to search for them seperatly as they are not given in the API descriptions themselfs, but just looking for the constant's name and you'll find the proper values in the msdn library too.

PS: the values given in random pages on the net aren't always the correct ones. And in other cases you need to be very carefully in just copying the values from such random pages as many times they depend on the numerical system used in the language they are used in (signed/unsigned/range of the type, etc). Eg: in VB &HFFFF can actually be -1 in another language or 0xFFFFFFFF in yet another or even indeed be 0xFFFF....