Archive: How to close...


How to close...
How can i close a running program before i start copying the new files...
please put a example with the answer!:D :winamp:


1)

FindWindow$R0"ProcessName"

And after:

SendMessage$R0${WM_QUIT}

OR

SendMessage$R0${WM_CLOSE}

Replace "ProcessName" with the name of the process to close (with a window as "WM" means "Window Messages").

Note: Sometimes ${WM_CLOSE} has a different effect than ${WM_QUIT}, test both messages to see what happens with the program.

OR

2) To follow this way you need the plugin "KillProcDLL" which you can find on the Archive.

KillProcDLL::KillProc"ProgramToClose.exe"

Replace "ProgramToClose.exe" with the program you want to close.

Thanx
Thanks it work!:D :winamp:


When i use this code this error appere in the log

Code:

FindWindow $R0 "ProcessName"
SendMessage $R0 ${WM_QUIT}
Error:
SendMessage expects 4-6 parameters, got 2.

:rolleyes: :rolleyes:

Whoops:

SendMessage$R0${WM_QUIT}""""

OR

SendMessage$R0${WM_CLOSE}""""

(I thought these were working because you said so...)

SORRY...
i'm sorry i ment the KillProcDLL plugin...
Thanks again... :up: :up: :up: :D


???
I tried it but nothing happend ??#!$ :cry:


Process is not a program file, is a space in memory of an aplication running, in this case you need to know the name of the process that the main window of Winamp.exe is identified. In this case, the process name is "BaseWindow_RootWnd".


I'm soooooooo sorry but it also didn't work!!!
if you can please write the nsi file & attach it with the answer.... :( :( :(
Also please write how to get the process name for any program...


I forget the attachment !:D


I found this and it works with winamp 5 :up:
Close/exit a program


FindWindow user_var(hwnd output) windowclass [windowtitle]
Second parameter is a top level (if [windowparent] parameter was omitted) window class name, not a process name. Looking from my corner, process may have or may have not window. "BaseWindow_RootWnd" looks like class name, but I am not sure - you can get correct class name using Spy++ utility. If you can close running program using Ctrl-Alt-Del, this trick should work with WM_CLOSE from NSIS script.


Whoops, yeah you're right. I need to relax before answering a question, or I get it wrong...