Jump to content

start up whit diffrent windows problem


 Share

Recommended Posts

Dear reader,

I´ve a program that i m creating, a scipt for changing passwords of multiple programs.

But now i m a little stuck whit 2 things :)

at first i can go 2 way´s....

1 the program that i want to change the password from is already running

2 the programm is not running.....

eather way is another path i must follow....

The thing is here i dont know how to check iff the program is running.

example: -->iff Notepad.exe is running send messagebox 1 ¨if not¨ send messagebox 2

the second thing is:

I don´t know how to change direction in a path I created:S

the user did before put in his old password in a GUI,

but what iff the password isn´t correct when he is actually changed in the program???

I hoped that the scripts can stop at that moment in time the user can put in the good password

and the script can go further when finaly the correct password is filled in.

I thaught a WinWaitActive of the window popped up when pass is correct but that isn´t possible ;)

I hope u can help me :) or push me in the good direction ;)

thnx in advanced,

GR FMS

Edited by FMS

as finishing touch god created the dutch

Link to comment
Share on other sites

The thing is here i dont know how to check iff the program is running.

While 1
Sleep(300)
If ProcessExists("notepad.exe") Then
    MsgBox(0, "Example", "Notepad is running.")
EndIf
WEnd

_____________________________________________________________________________

Link to comment
Share on other sites

The ultimate goal is to have 1 GUI to put in passwords from diffrent programs,

and whit this knowledge change all passwords from the programs into 1 for all.

there are more programs that could be running when the GUI starts,

so i need 2 ways to get the job done....

1 iff the program is already running and 1 if he doesn't :)

what u wrote is putting me in the good direction....

can u also write a message box iff there is no running notepad.exe?

and whit the other problem i need a kind off pauze button when in the GUI the password was filled in incorrect,

so iff the scipts detects a diffrent window that the password is incorrect the user can put in a correct password

and the scripts runs further at that point when it is filled in correct....

:)

Edited by FMS

as finishing touch god created the dutch

Link to comment
Share on other sites

While 1
Sleep(300)
If ProcessExists("notepad.exe") Then
    MsgBox(0, "Example", "Notepad is running.")
Else
    MsgBox(0, "Example", "Notepad is no running.")
EndIf
WEnd

You not asked my question. I can't help you because don't know how you get passwords and how the hell you doing it all.

_____________________________________________________________________________

Link to comment
Share on other sites

Whit this u helped me a great way in the next step :)

the only thing now is --> example.....

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "Do you want to save")
Send("!y")
WinWaitActive("Save As")
Send("test1.txt")
Send("{enter}")

Iff u run this script for the second time the name test1.txt already exist....:S

I need now 2 ways....

1 iff the popup apears that the file already exist

so the user can typ in a file name of his own and the scripts contineus....

and 1 iff the file doesn´t exist :)

u r right loads of text but in the end it is kind of simple ;)

Edited by FMS

as finishing touch god created the dutch

Link to comment
Share on other sites

$file = FileOpen("cnt.txt", 0)
$tmp = FileReadLine($file,1)
FileClose($file)
$file = FileOpen("cnt.txt", 10)
FileWriteLine($file, $tmp + 1)
FileClose($file)

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("This is some text.")
Send("^s")
WinWaitActive("Save As")
Send("test" & $tmp + 1 & ".txt")
Send("{enter}")
Sleep(200)
ProcessClose("notepad.exe")
Exit

_____________________________________________________________________________

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...