Skip to content
⌘ NSIS Forum Archive

Find if my application is running and if so send WM_CLOSE to it

4 posts

grzech#

Find if my application is running and if so send WM_CLOSE to it

Hi all,

Before starting instalation or uninstalation I would like to check if my program is already running and if so close it. Normally I would do it by calling FindWindow and sending WM_CLOSE message to it.

How can I do it from NSIS Installer?

Thank you.
Swapan Das#
For your further reference, you can try this also:

Function .onInit
; ------ At the time of installation Check if already MyProg.exe running:
FindProcDLL::FindProc "MyProg.exe"
StrCmp $R0 1 0 +3
MessageBox MB_ICONINFORMATION|MB_OK "Please Exit from MyProg program and then re-run this Installer"
Quit
FunctionEnd