[HELP] Get cursor position (X, Y) & set window position (X, Y) - 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: [HELP] Get cursor position (X, Y) & set window position (X, Y) (/showthread.php?tid=83733) [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-15-2008 at 04:11 PM
Hi, RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by Matti on 05-15-2008 at 04:21 PM
Where do you mean? In the chat window, you have the history area (where the sent and received messages are) and the typing area (where you type your messages). RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-15-2008 at 04:29 PM
What mean is: Plus! opens a window with the commands at the cursor's position in the typing area, as soon as "/" is typed (as long as its character index ix 0). I'd like to do the same (using OnEvent_ChatWndEditKeyDown). Here for, I need the cursor's X and Y position. Is there a way to get it? I think it'd be something like this: code: RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by Volv on 05-15-2008 at 04:31 PM GetCursorPos refers to the position of the mouse pointer, not the writing cursor thingy. RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-15-2008 at 04:33 PM Okay... Now I need the writing cursot's position. Is there a way to get it? RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by Matti on 05-15-2008 at 04:38 PM
Actually, it's very tough to do this. You'd have to know the font face and font size and the size of the typing area itself to calculate the size of the text and find the position of the typing cursor. Plus! does this pretty good with the Quick Emoticons menu, but there are no script features available to achieve this with a simple Plus! script. RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-15-2008 at 04:42 PM
Okay RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by Matti on 05-15-2008 at 05:53 PM
quote:I highly doubt it. I think the way Plus does it, is by calculating the bounding box of the text before the cursor using the font face and size and then use that to find out where to draw the pop-up. Only problem is that a script can't get Messenger's font face and size, or the size of the typing box (for word wrapping). RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-15-2008 at 07:25 PM
Hmm.. So you think I should figure out how big the rectangle of the typing area is (this data is RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by matty on 05-15-2008 at 07:59 PM
To get the Caret position you can use the GetCaretPos. Now this is in relation to the Caret position in the text box you are typing in now the screen. code: RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-15-2008 at 08:07 PM
Right... Your piece of code looks quite.. advanced and difficult to me... I have learnt, though, that Plus! places the command helper at one specific position (not next to the cursor), so in fact I only have to get the width and height of the inpt area.. RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by matty on 05-15-2008 at 09:16 PM What you are trying to do is going to be imperfect at best because it is impossible to get the exact position of the controls unless you use the MSNCore.dll file to read the DirectUIHWND control to find the exact positions. RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-16-2008 at 02:55 PM Okay.. I am going to try and use you code anyway.. But I need some function to set a window's position. I know it's in some system DLL, because I have once read about it, but I just don't know where to find it. Is there anyone who does? RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by mynetx on 05-16-2008 at 03:10 PM
You are talking about MoveWindow RE: [HELP] Get cursor position (X, Y) & set window position (X, Y) by SmokingCookie on 05-16-2008 at 03:13 PM
Yes Thanks lads |