Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th July 2006, 11:05   #1
Webree
Junior Member
 
Join Date: Jul 2006
Posts: 2
Problem with install forcing app shutdown - Tried multiple solutions - Please comment

Hi guys,

I'm trying to force a shutdown of a VB6 application with a system tray icon. The main form is docked above the Windows taskbar (Locked into position and decreases desktop workable area, APPBAR class for those of you who know).

I've tried multiple ways of shutting down the application on Install/Uninstall, I need this implemented effectively for the "Live Update" procedure within my APP.

I've tried the common SendMessage {WM_CLOSE} - and also Takhir's Find and Close or Terminate Plugin

The FCT plugin DOES shut down my toolbar, I get my window space back (It undocks) and every thing shuts down and then restarts once installed.

But... Two problems...

Once in a while I will see a windows error dialog popup (Windows recovered from an error, Send report, dont send report). That's something I really need to avoid...

Also: The System Tray icon remains in the tray. So upon restarting, there are 2 icons present until the ghost one is hovered over.

Perhaps this is something I need to program into my app, but all your comments or alternatives would be appreciated!

Regards,
Steve
Webree is offline   Reply With Quote
Old 27th July 2006, 12:48   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If the icon is still there after you're closing it with the FCT plugin then that means that FCT couldn't close it with WM_CLOSE and terminated it instead.

WM_CLOSE doesn't close the window?
What if you put End in the closing event in your VB app?

-Stu
Afrow UK is offline   Reply With Quote
Old 27th July 2006, 14:22   #3
Webree
Junior Member
 
Join Date: Jul 2006
Posts: 2
I tried End... The first time the icon disappeared, but subsequent tries -> Still the same problem.

It's not a consistent thing, which is the most annoying part.

It may show a windows error, it may not.
It may leave a locked dock space where the toolbar used to be, it may not.

Is it possible to send a call to my app which will trigger a function programmed into my app via NSIS? Then I can program a clean shutdown within the app itself invoked by the installer.
Webree is offline   Reply With Quote
Old 27th July 2006, 16:33   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Are you sure you aren't meant to remove the icon yourself (i.e. from in the app closing event)?

-Stu
Afrow UK is offline   Reply With Quote
Old 27th July 2006, 17:58   #5
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
We need to clarify the situation. So what I understood. Sometimes FCT closes your application with WM_CLOSE and everything is OK. But termination is still often situation and may cause application internal error (with 'error report' dialog) or may not, in both cases tray icon stays undeleted. The main question is why app's reactions on WM_CLOSE differ? Just tested with 2 old VP apps - works fine. Is your program busy with some tasks? Increase timeout this case. Latest FCT version also includes WM_SYSCOMMAND-SC_CLOSE option, may be this can help.
About interprocess communication - I not used VB for a long time and not sure what can be implemented, but simple ways are DDE, WM_COPY, Mailslots.
But I still guess that the best way is to understand why application behavior on WM_CLOSE is so strange.
Takhir is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump