Jump to content

Windows 2000 issue


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...