keashdoc Posted December 29, 2023 Share Posted December 29, 2023 Hi, I am trying to write an Autoit Code that will find a window with a specific caption and delete the process associated with that window. However, I am unable to find any code that does this. I tried this but it doesn't do the job. Any other ideas how I can accomplish this? Thanks. Global Const $partialCaption = "PartialCaption" ; Change this to the partial caption of the window you want to find While 1 If WinExists($partialCaption) Then Local $hWnd = WinGetHandle($partialCaption) If $hWnd <> 0 Then ProcessClose(WinGetProcess($hWnd)) ; Add a Sleep to avoid rapidly closing processes Sleep(1000) EndIf EndIf Sleep(1000) WEnd Link to comment Share on other sites More sharing options...
Danp2 Posted December 29, 2023 Share Posted December 29, 2023 By default, the match will only be performed from the beginning of the title. You can change the behavior by using AutoItSetOption to change the WinTitleMatchMode setting. P.S. When you post code, please use the described method in the link. Latest Webdriver UDF Release Webdriver Wiki FAQs 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