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
}