Jump to content

Recommended Posts

Posted

ProcessClose works for ending a program. But now and then the program I try to close hangs (it does NOT show Not responding title,it  just hangs). In that case ProcessClose is not able to close it. But manually I could click the X. 

 

So any suggestions how to close it anyway.... (except for clicking the x).

Posted

JohnNash,

7 hours ago, JohnNash said:

But manually I could click the X. 

When you close the window does the process terminate?

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted (edited)

Thanks for the tips. Both winclose and the WINAPI terminateprocess can not do it. 

 

Indeed if I press the cross manually it will terminate. 

So weird. Should be easily fixable I would think.

I am able to get the process handle, which I thought maybe did not work, but it does...

WinKill also does not work...

Edited by JohnNash
Posted

Well i've tried

WinKill("title of app")

Winclose ("tile of app"), also by class

_WinAPI_TerminateProcess ( $hProcess)  by handle

the code of the app that hangs I cannot provide since it is a closed source thing (not mine).

 

 

btw I just noticed the class of the process is changed into Ghost when it hangs. 

 

Posted

Ah my bad. I never actually ran processclose. That one works. I mixed up with winclose. So ProcessClose ("nameofexe.exe")  seems to work. Sorry for the misunderstanding. 

  • 2 years later...
Posted
6 hours ago, barresoft said:

         $command="taskkill /im yourExecutable.exe /f"
         run($command)

or

RunWait (@comspec & " /c TaskKill /PID " & $PID & " /F")

That will work all the times.  Tested for life !

  • Moderators
Posted

@barresoft please don't resurrect old threads, especially when the OP stated he had an accepted solution. After more than two years it is doubtful he is still looking for responses.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Guest
This topic is now closed to further replies.
×
×
  • Create New...