Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Task bar button in Delphi 2007

136 views
Skip to first unread message

Trond Grøntoft

unread,
Mar 23, 2007, 2:56:44 PM3/23/07
to
I compiled one of my applications with Delphi 2007, and discovered that the
taskbar button does not appear. The same thing happens with the
VirtualListView Demo project. Is there anything I need to do to get my
taskbar button back?

- Trond


Rick Carter

unread,
Mar 23, 2007, 3:57:51 PM3/23/07
to
Did you read the messages in the "D2007 affecting D2006?" thread?
It sounds like it may be related.

Rick Carter
cart...@despammed.com
Chair, Delphi/Paradox SIG, Cincinnati PC Users Group

--- posted by geoForum on http://delphi.newswhat.com

Trond Grøntoft

unread,
Mar 23, 2007, 3:21:41 PM3/23/07
to
This message was apparently cancelled by a mistake.
Reposting....
- - -

Trond Grøntoft

unread,
Mar 23, 2007, 3:29:27 PM3/23/07
to
"Rick Carter" wrote

> Did you read the messages in the "D2007 affecting D2006?" thread?
> It sounds like it may be related.

Yes I saw that one, but I was hoping there was something I could do to fix
this. I have made a few other test programs and they work as expected.

- Trond


Jeff Hamblin

unread,
Mar 23, 2007, 4:38:43 PM3/23/07
to

"Trond Grøntoft":


There is a new property of TApplication "MainFormOnTaskBar".
This defaults to False for existing applications opened in D 2007,
but defaults to True for new applications. This may be why your
test apps behaved differently.

Try inserting in the application DPR:
(just after: Application.Initialize;)
Application.MainFormOnTaskBar := True;

This has other consequences, but give it a try.

-Jeff Hamblin


Atle Smelvær

unread,
Mar 23, 2007, 5:02:25 PM3/23/07
to
It's related to Vista changes, there are one QC report on some of the
problems:
http://qc.codegear.com/wc/qcmain.aspx?d=43007

-Atle


Freddy

unread,
Mar 23, 2007, 6:14:02 PM3/23/07
to
If you dont want the trouble you run into when using
Application.MainFormOnTaskBar you can do the following:

I have a splash screen so I have..

Application.ShowMainForm := False;

<show splash>
<do stuff>
<hide splash>

frmMain.Show;
ShowWindow(frmMain.Handle,SW_SHOW);

This way the taskbar button appears and never leaves you again.
I did not see any of the mentioned problems yet.

To CodeGear:
I must say I'm getting a bit dissappointed by seeing every "fix" (in this
case the vista minimize thumbnail/screenshot thingy issue) having severe
side effects or other bugs.
I just found out this "vista ready" product doesnt support PNG compressed
vista icons as well... *sigh*

Regards,
Freddy


"Trond Grøntoft" <tr...@tiger-removethis.no> wrote in message
news:460428d1$1...@newsgroups.borland.com...

Dave Nottage [TeamB]

unread,
Mar 23, 2007, 7:37:55 PM3/23/07
to
Freddy wrote:

> If you dont want the trouble you run into when using
> Application.MainFormOnTaskBar you can do the following:
>
> I have a splash screen so I have..
>
> Application.ShowMainForm := False;
>
> <show splash>
> <do stuff>
> <hide splash>
>
> frmMain.Show;
> ShowWindow(frmMain.Handle,SW_SHOW);
>
> This way the taskbar button appears and never leaves you again.

So does this way:

Splash := TSplash.Create(nil);
Splash.Show;
// Do stuff
Application.CreateForm(TfrmMain, frmMain);
Splash.Close;

No need to call ShowWindow, or to have ShowMainForm as False.

--
Dave Nottage [TeamB]

Trond Grontoft

unread,
Mar 23, 2007, 6:41:14 PM3/23/07
to
> There is a new property of TApplication "MainFormOnTaskBar".
> This defaults to False for existing applications opened in D 2007,
> but defaults to True for new applications. This may be why your
> test apps behaved differently.
>
> Try inserting in the application DPR:
> (just after: Application.Initialize;)
> Application.MainFormOnTaskBar := True;
>
> This has other consequences, but give it a try.

Thanks.
I tested this on the VirtualListView demo, but the problem remains the same.

- Trond


Freddy

unread,
Mar 23, 2007, 8:59:33 PM3/23/07
to
Forgot to mention i'm talking about a D2006 app loaded in D2007 (so
MainFormOnTaskBar = False).

"Dave Nottage [TeamB]" <dav...@radsoft.com.au> wrote in message
news:4604...@newsgroups.borland.com...


> So does this way:
>
> Splash := TSplash.Create(nil);
> Splash.Show;
> // Do stuff
> Application.CreateForm(TfrmMain, frmMain);
> Splash.Close;

> Dave Nottage [TeamB]


Freddy

unread,
Mar 23, 2007, 8:57:33 PM3/23/07
to
Eh.. will that show the taskbar button using D2007 without using
MainFormOnTaskBar ?
(I admit I didnt try)


"Dave Nottage [TeamB]" <dav...@radsoft.com.au> wrote in message
news:4604...@newsgroups.borland.com...

Trond Grontoft

unread,
Mar 24, 2007, 11:42:01 AM3/24/07
to
"Jeff Hamblin" wrote

> Try inserting in the application DPR:
> (just after: Application.Initialize;)
> Application.MainFormOnTaskBar := True;
>
> This has other consequences, but give it a try.

I had a look at the TApplicationHelper source code and found if I put the...

Application.MainFormOnTaskBar := True;

...AFTER the Application.CreateForm statment, the button is displayed on the
statusbar. I'm not sure if there are any side effects to this, so I ended up
overrididing the CreateParams method and added WS_EX_APPWINDOW to
Params.ExStyle.

- Trond


Dave Nottage [TeamB]

unread,
Mar 25, 2007, 8:50:03 AM3/25/07
to
Freddy wrote:

> Eh.. will that show the taskbar button using D2007 without using
> MainFormOnTaskBar ? (I admit I didnt try)

If by "using" you mean setting it to True, yes you need to do that, but
it is a trivial thing to do.

--
Dave Nottage [TeamB]

hei...@gmail.com

unread,
Apr 13, 2007, 4:23:00 AM4/13/07
to

I noticed that if I set the Visible property to True on the main form,
the taskbar button is not shown. Make sure Visible=False on the main
form.

Regards,
Hein

0 new messages