As Cosmin said, it's not the mainform that causes the TaskBar Icon
to show up but another that Delphi creates. It has nothing to do with
whether the mainform is visible or not. However, when I use a trayIcon on
the mainform and add this to the OnCreate, no taskbar icon is created:
ShowWindow(Application.Handle, SW_HIDE);
SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
Trouble is that it must be the very first lines in the OnCreate, and
if I add any kind of check to it for an option even when read in the dpr it
no longer works! I'm going to try getting rid of it again directly from
within the dpr. I did before with no luck but perhaps I made a mistake.
from Robert Meek dba Tangentals Design CCopyright 2006
"When I examine myself and my methods of thought, I come to the conclusion
that the gift of Fantasy has meant more to me then my talent for absorbing
positive knowledge!"
Albert Einstein
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Rob Kennedy
Sent: Wednesday, March 22, 2006 2:49 AM
To: Borland's Delphi Discussion List
Subject: Re: Interface use question
Robert Meek wrote:
> When you have an application that runs from the tray, do you prefer
> NOT to have it also show up on the windows taskbar, or do you like it to
> appear in both?
I tried having Winamp keep its icon in the notification area and also
appear in the taskbar. The good side effect of that is that the window
appears in the Alt+Tab list, so I can get to the window by the keyboard.
The bad side effect of that is that the window is *always* the first
item in the Alt+Tab list, which means I can no longer toggle between two
windows as quickly as usual.
Being able to focus other windows quickly eventually trumped being able
to focus Winamp occasionally, so I now have it configured to display its
icon only in the notification area.
> I've tried to make this an optional setting however it
> doesn't seem possible as the mainform is created one way or the other
before
> option settings can be read...
So read the options before you create the form. Or read them while
you're creating it, but before CreateParams gets called. Or read them
afterward and change the form's attributes accordingly.
> unless someone knows of a way to handle this
> directly from the dpr?
A "way"? You mean besides cut and paste?
> And note, the mainform of my application is used
> only for basic setup code, global interface control components, the
trayicon
> component, and its custom popup menu code...it never actually becomes
> visible nor is it accessed directly in anyway by the user!
Um, then what, exactly, would you have appear on the taskbar anyway?
--
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi