What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Check whether control is focused

Check whether control is focused
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Check whether control is focused
GetFocus() returns the handle of the currently focused control, so you need to compare that return value to the handle of the control you want to react upon.
js code:
// Get the handle of the focused control
var hFocused = Interop.Call('user32', 'GetFocus');
// Check if it's our edit control
if( hFocused === PlusWnd.GetControlHandle('MyEditControl') ) {
    // Do stuff
}
Or the short version:
js code:
// Check whether our edit control has focus
if( Interop.Call('user32', 'GetFocus') === PlusWnd.GetControlHandle('MyEditControl') ) {
    // Do stuff
}
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
04-11-2010 12:42 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Check whether control is focused - by ryxdp on 04-11-2010 at 09:12 AM
RE: Check whether control is focused - by Matti on 04-11-2010 at 12:42 PM
RE: Check whether control is focused - by ryxdp on 04-11-2010 at 11:59 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