Jump to content

easy question to window conditions


Recommended Posts

Guest Luzifer2004
Posted

just tested some conditions myself but need some help anyway.

my aim is something like that:

run notepad

check weather notepad have focus

write a sentence 10000 times ^^ (for loop)

check in every loop weather notepad have focus or something else just opened

if notepad have focus -> simply go on

if not -> activate notepad again

heres my code that activates the window after each word.

so i avoided the conditions but the program is slower.

AutoItSetOption("SendKeyDelay", 100)
msgbox (64, "tut", "es geht los")
Run("notepad.exe")
WinWaitActive("Unbenannt - Editor")
for $i=1 to 100000
    Send("ich ")
    WinActivate("Unbenannt - Editor")
    Send("bin ")
    WinActivate("Unbenannt - Editor")
    Send("der ")
    WinActivate("Unbenannt - Editor")
    Send("beste ")
    WinActivate("Unbenannt - Editor")
    Send("hier ")
    WinActivate("Unbenannt - Editor")
Next
msgbox (0, "tut", "ende")

can someone write what code i have to build in?

thx for help, sorry for grammar and short, incomplete sentences (german and lack of time^^)

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
×
×
  • Create New...