lavezzi Posted October 4, 2009 Share Posted October 4, 2009 Hello, knowing the title of a window is there a command to kill the correspondant process? I've got an app tha somethime stops working and I need to be killed with out any confirmation, I wanna kill it if I was killing the process. ty Link to comment Share on other sites More sharing options...
celestialspring Posted October 4, 2009 Share Posted October 4, 2009 Hello, knowing the title of a window is there a command to kill the correspondant process?I've got an app tha somethime stops working and I need to be killed with out any confirmation, I wanna kill it if I was killing the process.tyLook at the Winclose command and process close command in conjunction.for example$windowtitle = "MyWindow"$processname = "Myprocess"if WinExists ( $windowtitle) Thenprocessclose($processname)endif Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 4, 2009 Share Posted October 4, 2009 (edited) Also, you should look at WinKill()From the help file: Function WinKill: The difference between this function and WinClose is that WinKill will forcibly terminate the window if it doesn't close quickly enough. Consequently, a user might not have time to respond to dialogs prompting the user to save data. Although WinKill can work on both minimized and hidden windows, some windows (notably explorer windows) can only be terminated using WinClose. Edited October 4, 2009 by mistersquirrle We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
DW1 Posted October 4, 2009 Share Posted October 4, 2009 I think you are looking for the WinGetProcess() command to be used with ProcessClose(). For example, this would close the process of any window with the title "Untitled - Notepad" $WinTitle = 'Untitled - Notepad' While 1 If WinExists( $WinTitle ) Then ProcessClose(WinGetProcess( $WinTitle )) EndIf Sleep(10) WEnd AutoIt3 Online Help Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 4, 2009 Share Posted October 4, 2009 I didn't know you could do that >_> Interesting... That should work the best I guess We ought not to misbehave, but we should look as though we could. 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