Jump to content
Sign in to follow this  
youknowwho4eva

Windows 2000 issue

Recommended Posts

youknowwho4eva

controlfocus doesn't work properly in windows 2000???? (I'm not sure that it doesn't at all work, just in the application I'm using it, it works in XP but not in 2000), is there a comparable command that could replace it, so it works in 2000?


Giggity

Share this post


Link to post
Share on other sites
herewasplato

Please post some code that replicates your problem. Maybe using notepad.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
youknowwho4eva

While ProcessExists("KC.exe")
$foo = MouseGetCursor()

$sWinText = WinGetText("Kubotek KeyCreator", "")
MsgBox(0, "Text read was:", $sWinText)
 
    If WinExists("Kubotek KeyCreator","") Then
        Select
            Case ControlgetFocus("Kubotek KeyCreator", "") = "AfxFrameOrView70u1" and $foo = 0
            controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
            controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
            Case ControlgetFocus("Kubotek KeyCreator", "") = "AfxFrameOrView70u1" or $foo = 0
            Sleep(10)
            Case StringInStr($sWinText, "Print the active document") <> 0
            controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
            controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
            Case Else
            Sleep(1500)
            EndSelect
    ElseIf WinExists("Kubotek KeyCreator","") = 0 Then
        Exit
    Else
    Exit
    EndIf
    
    Sleep(20)
WEnd

I've doubled the command to see if maybe trying twice would get it to activate, havent tryed to see if that works yet. I'm also trying to get it to activate the same problem area when the mouse is over the print button. Everything except that works in XP (still learning so I'm sure I dont have that exactly right) but the line

Case ControlgetFocus("Kubotek KeyCreator", "") = "AfxFrameOrView70u1" and $foo = 0
            controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
            controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
works in xp but not in 2000

Giggity

Share this post


Link to post
Share on other sites
Richard Robertson

Did you check the program under 2000 to see that the control IDs are in fact, the same?

Share this post


Link to post
Share on other sites
youknowwho4eva

Yes, I checked that, I also made sure that the program was still KC.exe, and that the liner at the top was still Kubotek KeyCreator.


Giggity

Share this post


Link to post
Share on other sites
herewasplato

Simplify your testing. Just run this one line of code on the W2k system:

controlfocus("Kubotek KeyCreator", "", "Afx:00400000:2b1")
Also check the return from MouseGetCursor under W2k for that app.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
youknowwho4eva

Well I know the Cursor part is working, it takes focus away from the one field but does not give focus to the other. I believe that is the only part that is not working. Before I found the whole controlfocus thing I had it just clicking when the parameters were met. And it worked except that in KeyCreator you can have commands set to your clicks so when I found out how to do it without clicking I was very happy. The W2K computer is someone that I have beta testing for me. We've worked out all the bugs except this one (and of course this was the original intent of the program).


Giggity

Share this post


Link to post
Share on other sites
herewasplato

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

Well, you certainly have experimented. I don't know how to tell if a control is standard or not. I have two apps that do not repsond to all of the control commands - just a few of them. I don't readily see a problem with your ControlFocus line and without having the app in hand, I cannot suggest a work around. Maybe others in the forum can.

It is odd that it works for you in XP and not on W2k... but such is life. :-(


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
youknowwho4eva

Alright I think I figured it out. In the program, for somereason it doesn't give complete focus to the control. Guess I still have to play with it some more.


Giggity

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  

×