close another window

haiiiiiiiiiii everyone

I am asking if there is a function or a manner that close the window of other program like I want to close the window firefox but with codes

thanks a lot for reading
Get a handle to firefox window with FindWindow, them post WM_CLOSE to it. A more aggresive approach will be to get associated process id and call TerminateProcess (not recommended).
Thanks a lot for reading my problem

I am sorry to bother you again,can you give me a piece of code for both findWindow and TerminateProcess

And thanks again
The functions are documented in MSDN. Do a google search and you should find code snippets.
will Thanks a lot
Topic archived. No new replies allowed.