Sign in to follow this  
Followers 0
fxg4758

ControlGetFocus error

2 posts in this topic

Hi. This can ben a very newbie question, but can someone tell what is wrong about this code? It always show me the message box whatever is the control? Thanks for information. :)

If _IsPressed("23") then

$accEnter = NET_ControlGetHandleByName($Test1, "", "Box")

Send("{F9}")

If ControlGetFocus($accEnter) <> 1 Then MsgBox(4096, "Test", "This box will time out in 10 seconds", 10)

$accEnter = 0

endif

Share this post


Link to post
Share on other sites



Returns the ControlRef# of the control that has keyboard focus within a specified window.

ControlGetFocus ( "title" [, "text"] )

Parameters

title Title of window to check.

text [optional] Text from window to check.

Return Value

Success: Returns the ClassNameNN of the control that has keyboard focus within a specified window.

Failure: Returns "" (blank string) and sets @error to 1 if window is not found.

If ControlGetFocus($accEnter) <> 1 Then MsgBox(4096, "Test", "This box will time out in 10 seconds", 10)

controlgetfocus will not retun 1.. this maybe ur problem..


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0