![]() |
How to close firefox in nsis?
Here is what I did to close firefox,
FindWindow $0 'MozillaWindowClass' '' ${If} $0 <> 0 SendMessage $0 ${WM_CLOSE} 0 0 ${EndIf} But it doesn't work. How can I achieve that? Thanks. |
PHP Code:
|
Quote:
|
It worked when I tested it (Firefox 3.6) The class name is a internal thing and could change between releases. Use http://catch22.net/software/winspy to find the class name
|
Firefox 4 is just called MozillaWindowClass.
Stu |
Quote:
|
Quote:
|
well, the message is WM_SYSCOMMAND + SC_CLOSE so it should work, but you could try WM_CLOSE as well, and if both fail, bring out the big hammer and call DestroyWindow with the system plugin...
(But why not just ask the user to close firefox? They might want to save bookmarks etc) |
Quote:
Could you give me an example how to use DestroyWindow with the system plugin? Thanks a lot. |
PHP Code:
|
Quote:
|
I think you should change your strategy. Ask the user to close Firefox themselves. You can either do this with your own code (similar to what we use in this topic) or use a plug-in such as LockedList.
Stu |
Quote:
|
i think yes!
i would never install a program that will automatically taskkill my firefox.exe! Take a look at that LockedList plugin as Afrow UK suggested. What you have to use depends on your purpose/program. but never kill a task on the user system unasked !!! bye |
You don't just have to have a message box. Using FindWindow you can detect whether Firefox has been closed or not and keep asking them to close Firefox until FindWindow returns 0. Using LockedList has more features of course.
Stu |
Quote:
|
...
He means that you have not to show this messegebox always. You can use the "find firefox window" checkup to show the messagebox only if firefox is open.
PHP Code:
|
Quote:
and create a new profile for testing. |
Would it not achieve the same affect to do the following...
PHP Code:
http://nsis.sourceforge.net/NsProcess_plugin Squirre1 |
That will not work if and when they make an official 64-bit build of Firefox. FindWindow is safer (when you have a class name).
Stu |
|
| All times are GMT. The time now is 17:41. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.