Archive: Finding WA3 and closing prob.


Finding WA3 and closing prob.
OK I have found the function for closing WA 1.x and 2.x, and it works fine for closing those apps. But my problem is that when i was using NSIS 1.97 and the function above i was also closing WA3 which is what i wanted it to do, so thats fine, but when i recompiled all of my scripts with 1.98, and it gets to the install screen it freezes it WA3 is running. When i close WA3 it will continue the install just fine.

So what i was wondering is if the was code floating out there that could close WA3 also. Or is that all i have to do is create a new function with the WA3 window name, to close it.


please help me.


Re: Finding WA3 and closing prob.

Originally posted by bballer182
Or is that all i have to do is create a new function with the WA3 window name, to close it.
I guess that's it! Just in the same way to close any program: FindWindow, SendMessage routine.

Good luck,
-Hendri.

the problem is i don't know how to do it. I don't even know the WA3 window name is?


You should use some spy software to find out.

-Hendri.


OK i figured out the problem using Nocarr's(thanks dude) little utility to find the window name, and it works fine when WA3 isn't minimized in the systray.

Is there a way to close a proccess? Because WA3 is listed as a process in the task manager.

If you want it check it out in my sig.

-justin


HELP ME PLEASE!!!
HELP ME PLEASE


Is there a way to close a proccess? Because WA3 is listed as a process in the task manager.


Smile2Me do you know?


You can always use TerminateProcess, but something tells me there is a better way to do this...
How about searching for the main WindowProc and sending it WM_CLOSE, WM_CLOSE, or WM_COMMAND pretending to be a menu command of exit?

Doesn't WA3 SDK say anything about this?


Originally posted by kichik

How about searching for the main WindowProc and sending it WM_CLOSE, WM_CLOSE, or WM_COMMAND pretending to be a menu command of exit?

Doesn't WA3 SDK say anything about this?
Thats a good idea; sending a menu command of exit. I'll try. :winamp: ;) :) :D :cool:

One problem with that is that i don't know how to work the sdk, i don't even know c++ or basic or anything. The only language that i know is English, NSIS, and a tiny bit of HTML.


Sorry, I don't know how to kill a process in the SysTray. Check MSDN for this. Sorry, I do not have time for this. If you find something that might be useful, post it and maybe some of us can help you program it into a dll or exe.

Sorry for my late reply. I forgot to check this thread.

Good luck,
-Hendri.


OK i found the page your probably looking for but this is an app to shut it down. I hope this is what your looking for

http://msdn.microsoft.com/library/de...TProcesses.asp


Wow i can't belive how active this forum is. I can remember about 6 months ago when a person could post something and about a week later some one might have passed over the forum to answer the question. so i have to move this back to the top so it can get read again.

I think this is the place but i have no idea what to do with it.

http://msdn.microsoft.com/library/de...TProcesses.asp


If you insist... I thought someone will give you the correct answer by now, but if you insist I will give you my answer which I am not so sure about.

Option 1: Call TerminateProcess - Very brutal and unwanted. Only possible with an extension DLL or a change to NSIS code.
Option 2: Find the main window of Winamp 3 and destroy it - The more welcomed way, but harder. The main window of Winamp 3 could not be found with the utility above, you need Spy for it to show you all of the windows and their classes. Just open up spy and list all available windows and search for windows of Winamp 3 and try closing them one by one until one closes the Winamp 3 process as well. There must be a better way to find it but I don't know about one.


To Justin

This sounds like a good idea to add KillWinProcess or KillProcess because some apps (WA3) when in the minmized mode do not have windows.

I will also ask over at the Winamp 3 discussion Forum. to see if anyone there has any ideas.


I have no problems with the following code:


Name "Kill WA3"
AllowRootDirInstall false
OutFile "wa3kill.exe"
Caption "WA3 Killer"
ShowInstDetails show

Function KillWA3
FindWindow $0 "STUDIO"
IsWindow $0 Found
DetailPrint "WinAmp3 is not running."
goto Done
Found:
SendMessage $0 16 0 0
DetailPrint $0
Done:
FunctionEnd

Section "crap"
Call KillWA3
SectionEnd


It closes 1 instance of Winamp3, even if it's minimized.

Issues figured out while coding.
1. NSIS understands WM_CLOSES but has it equal to 0.
2. Winamp3 windows ignore WM_DESTROY and WM_QUIT.
3. Winamp3 does not destroy it's windows on minimize (so they are still here), but their order is changed, so FindWindow returns handle not to the main window (this window ignore WM_CLOSE, so if you make loop like in functions.html your installer will freeze). So you can search by title (but this will only work for some specific beta). Also, FindWindow with wildcards would be cool.

Thank you my friend!:D :) That worked like a champ!

I still think i maybe useful to have KillProcess in NSIS.


Originally posted by bballer182
I still think i maybe useful to have KillProcess in NSIS.
WinAPI function TerminateProcess() is very bad and suggested only as the last chance to close application (e.g. it doesn't respond to messages, or "softly" hanged). I will prefer EnumWindows and FindWindow with wildcards. Though it's pretty easy to add KillProcess and some GetProcess() functions to NSIS.