Archive: Problem with install forcing app shutdown - Tried multiple solutions - Please comment


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


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


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.


Are you sure you aren't meant to remove the icon yourself (i.e. from in the app closing event)?

-Stu


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.