Mega Code Archive

 
Categories / Delphi / API
 

Programmatically closing another application

Question: How do I programmatically close another application? Answer: You can send the application a WM_QUIT message; Example: PostMessage(FindWindow(Nil, 'window caption'), WM_QUIT, 0, 0); Where "window caption" is the caption of the window that you are sending the message to.