GordonFreeman Posted September 23, 2011 Share Posted September 23, 2011 Hi. I am a layman in autoit. My problem is this, I created a script to change the name of the window with thePID of the respective process. In the first run work fine, but then he always uses the same PID as the process name is the same. I know the error but not the solution. Can anyonehelp me? ShellExecute("BLA.exe") Sleep(3000) $PID = ProcessExists("BLA.exe") WinSetTitle("Blaaa Bla Bla","",$PID) Exit I want to make each window with its PID real and not only the first Note: I can not change the name of the executable happens the following problem: BLA.EXE - REAL PID: 1234 - WINDOW NAME: 1234 the second time I open my program have: BLA.EXE - REAL PID: 1234 - WINDOW NAME: 1234 BLA.EXE - REAL PID: 3131 - WINDOW NAME: 1234 i need so: BLA.EXE - REAL PID: 1234 - WINDOW NAME: 1234 BLA.EXE - REAL PID: 3131 - WINDOW NAME: 3131 Frabjous Installation Link to comment Share on other sites More sharing options...
Beege Posted September 23, 2011 Share Posted September 23, 2011 If your lanching an exe i would use Run() instead of shellexecute. Shellexecute is more for opening a file with its default application. Using Run() will return the pid without the need for ProcessExists(). Is that the whole script your running? If so, are you just running it twice to get the second bla.exe to launch? Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
GordonFreeman Posted September 23, 2011 Author Share Posted September 23, 2011 If your lanching an exe i would use Run() instead of shellexecute. Shellexecute is more for opening a file with its default application. Using Run() will return the pid without the need for ProcessExists(). Is that the whole script your running? If so, are you just running it twice to get the second bla.exe to launch? Thank you for your help. I reached my goal. perfect ProcessExists and depedence of sleep removed, now is perfect, big ty man. See: $PID = Run("BLA.exe")WinWaitActive("Blaaa Bla Bla")WinSetTitle("Blaaa Bla Bla","",$PID)Exit Frabjous Installation Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now