BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Missing Tray Icon

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Vladimir Stefanovic
Guest





PostPosted: Sun May 01, 2005 6:41 pm    Post subject: Missing Tray Icon Reply with quote



Hi,

I noticed that in some circumstances (do not know the moment)
a tray icon of my program is missing, although the task manager
says that the app is running. The funy thing is that also many other
tray icons are missing (not only mine) when that moment happens!

I suppose that the programs that "survived" know about that problem
and so has some additional code to add the icon again.

Does anyone know something about that?

The OS is XP SP2.




--
Best regards,
Vladimir Stefanovic


Back to top
Ed Mulroy [TeamB]
Guest





PostPosted: Sun May 01, 2005 7:57 pm    Post subject: Re: Missing Tray Icon Reply with quote



You probably already know this, but just in case:

Look to the tray icon area and find the button that appears as a
circle containing a '<' symbol. Click on that button and it will move
to the left and change to a '>', revealing more tray icons.

.. Ed

Quote:
Vladimir Stefanovic wrote in message
news:427522d4 (AT) newsgroups (DOT) borland.com...

I noticed that in some circumstances (do not know the moment)
a tray icon of my program is missing, although the task manager
says that the app is running. The funy thing is that also many other
tray icons are missing (not only mine) when that moment happens!

I suppose that the programs that "survived" know about that problem
and so has some additional code to add the icon again.

Does anyone know something about that?

The OS is XP SP2.



Back to top
Vladimir Stefanovic
Guest





PostPosted: Sun May 01, 2005 8:04 pm    Post subject: Re: Missing Tray Icon Reply with quote



Yes, I know that Smile This must be something different. I have
found similar problems at Win98 & obsolete comctl32 file,
but this is XP...

He he, maybe the problem is missing symbols '<' & '>' and not
my tray icon ;)


--
Best regards,
Vladimir Stefanovic
"Ed Mulroy [TeamB]" <dont_email_me (AT) invalid (DOT) com> wrote

Quote:
You probably already know this, but just in case:

Look to the tray icon area and find the button that appears as a circle
containing a '<' symbol. Click on that button and it will move to the
left and change to a '>', revealing more tray icons.

. Ed

Vladimir Stefanovic wrote in message
news:427522d4 (AT) newsgroups (DOT) borland.com...

I noticed that in some circumstances (do not know the moment)
a tray icon of my program is missing, although the task manager
says that the app is running. The funy thing is that also many other
tray icons are missing (not only mine) when that moment happens!

I suppose that the programs that "survived" know about that problem
and so has some additional code to add the icon again.

Does anyone know something about that?

The OS is XP SP2.





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon May 02, 2005 7:42 am    Post subject: Re: Missing Tray Icon Reply with quote


"Vladimir Stefanovic" <antivari (AT) po (DOT) sbb.co.yu> wrote


Quote:
I noticed that in some circumstances (do not know the moment)
a tray icon of my program is missing, although the task manager
says that the app is running. The funy thing is that also many other
tray icons are missing (not only mine) when that moment happens!

That happens when the OS's shell program (explorer.exe) crashes and was
re-started by the OS, thus every icon was lost when the System Tray was
recreated. Those icons that "survived" were because their respective
applications recognized the restart and re-added their icons accordingly.

Quote:
I suppose that the programs that "survived" know about that
problem and so has some additional code to add the icon again.

Yes. At program startup, use the RegisterWindowMessage() function to
register the "TaskbarCreated" message. Then override your form's WndProc()
method to catch that message. When your form receives the message, it means
that the entire Taskbar, including the System Tray, has been recreated, so
you can then re-add your icons at that time.


Gambit



Back to top
Vladimir Stefanovic
Guest





PostPosted: Mon May 02, 2005 5:23 pm    Post subject: Re: Missing Tray Icon Reply with quote

Thanks,

This was nice to know. I never used RegisterWindowMessage()
but I think I will succeed to implement that properly... and wait
for the crash of the "explorer.exe" to see if my app is in the
"survivors" boat.


--
Best regards,
Vladimir Stefanovic

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote

Quote:

"Vladimir Stefanovic" <antivari (AT) po (DOT) sbb.co.yu> wrote in message
news:427522d4 (AT) newsgroups (DOT) borland.com...

I noticed that in some circumstances (do not know the moment)
a tray icon of my program is missing, although the task manager
says that the app is running. The funy thing is that also many other
tray icons are missing (not only mine) when that moment happens!

That happens when the OS's shell program (explorer.exe) crashes and was
re-started by the OS, thus every icon was lost when the System Tray was
recreated. Those icons that "survived" were because their respective
applications recognized the restart and re-added their icons accordingly.

I suppose that the programs that "survived" know about that
problem and so has some additional code to add the icon again.

Yes. At program startup, use the RegisterWindowMessage() function to
register the "TaskbarCreated" message. Then override your form's
WndProc()
method to catch that message. When your form receives the message, it
means
that the entire Taskbar, including the System Tray, has been recreated, so
you can then re-add your icons at that time.


Gambit





Back to top
Vladimir Stefanovic
Guest





PostPosted: Mon May 02, 2005 6:18 pm    Post subject: Re: Missing Tray Icon Reply with quote

Remy, will this be enough?

--- H ---
private: // User declarations
UINT WM_TASKBARRECREATED;


--- CPP ---
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// ...
WM_TASKBARRECREATED = RegisterWindowMessage( "TaskbarCreated" );
// ...
}

void __fastcall TForm1::WndProc( TMessage &Msg )
{
if ( ( Msg.Msg != 0 ) && ( Msg.Msg == WM_TASKBARRECREATED ) )
{
DoSomethingToRecreateTrayIcon();
}
// ...
}


--
Best regards,
Vladimir Stefanovic
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote

Quote:

"Vladimir Stefanovic" <antivari (AT) po (DOT) sbb.co.yu> wrote in message
news:427522d4 (AT) newsgroups (DOT) borland.com...

I noticed that in some circumstances (do not know the moment)
a tray icon of my program is missing, although the task manager
says that the app is running. The funy thing is that also many other
tray icons are missing (not only mine) when that moment happens!

That happens when the OS's shell program (explorer.exe) crashes and was
re-started by the OS, thus every icon was lost when the System Tray was
recreated. Those icons that "survived" were because their respective
applications recognized the restart and re-added their icons accordingly.

I suppose that the programs that "survived" know about that
problem and so has some additional code to add the icon again.

Yes. At program startup, use the RegisterWindowMessage() function to
register the "TaskbarCreated" message. Then override your form's
WndProc()
method to catch that message. When your form receives the message, it
means
that the entire Taskbar, including the System Tray, has been recreated, so
you can then re-add your icons at that time.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon May 02, 2005 7:05 pm    Post subject: Re: Missing Tray Icon Reply with quote


"Vladimir Stefanovic" <antivari (AT) po (DOT) sbb.co.yu> wrote


Quote:
UINT WM_TASKBARRECREATED;

You should not use capitals like that in variable names. Use something more
like this instead:

UINT uTaskbarCreatedMSg;

Quote:
WM_TASKBARRECREATED = RegisterWindowMessage( "TaskbarCreated" );

uTaskbarCreatedMsg = RegisterWindowMessage("TaskbarCreated");

Quote:
if ( ( Msg.Msg != 0 ) && ( Msg.Msg == WM_TASKBARRECREATED ) )

That should be the following instead. You are not checking the return value
of RegisterWindowMessage() for 0 properly:

if( (uTaskbarCreatedMsg != 0) && (Msg.Msg == uTaskbarCreatedMsg) )


Gambit



Back to top
Vladimir Stefanovic
Guest





PostPosted: Mon May 02, 2005 7:15 pm    Post subject: Re: Missing Tray Icon Reply with quote

Quote:
UINT WM_TASKBARRECREATED;

You should not use capitals like that in variable names. Use something
more
like this instead:

UINT uTaskbarCreatedMSg;

Ok! Now I changed that...

Quote:
WM_TASKBARRECREATED = RegisterWindowMessage( "TaskbarCreated" );

uTaskbarCreatedMsg = RegisterWindowMessage("TaskbarCreated");

if ( ( Msg.Msg != 0 ) && ( Msg.Msg == WM_TASKBARRECREATED ) )

That should be the following instead. You are not checking the return
value
of RegisterWindowMessage() for 0 properly:

if( (uTaskbarCreatedMsg != 0) && (Msg.Msg == uTaskbarCreatedMsg) )

Oh, I overlooked that. Thanks for looking sharp...



--
Best regards,
Vladimir Stefanovic



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.