[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Cannot hide App button on Taskbar with Delphi 2007

Posted on 2007-11-14
7
Medium Priority
?
2,149 Views
Last Modified: 2008-03-26
I cannot hide the app button on the windows taskbar in Delphi 2007.  This is the method that has worked for up till now.

procedure TMainForm.FormCreate(Sender: TObject) ;
begin
  ShowWindow(Application.Handle, SW_HIDE) ;
  SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW ) ;
  ShowWindow(Application.Handle, SW_SHOW) ;
end;


0
Comment
Question by:Jebtrix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Author Comment

by:Jebtrix
ID: 20284347
Let me elaborate on that a little. I can get it to 'work' in FormActivate, but as soon as this line is executed the button reappears:

ShowWindow(Application.Handle, SW_SHOW) ;

This worked fine in Delphi 7.  Just need to know what changed in D2007 that messes this up.

0
 
LVL 25

Expert Comment

by:imitchie
ID: 20284737
how about

ShowWindow(Self.Handle, SW_SHOW) ;
0
 
LVL 2

Author Comment

by:Jebtrix
ID: 20350263
I found a working solution:

Application.MainFormOnTaskbar := False;
//This must be set in the application file before any form is created

ShowWindow(Application.Handle, SW_HIDE) ;
//Must use in either OnActivate or OnShow event as OnCreate is a no go now.

Problem is that it still appears momentarily but I think I just have to move some I/O operations out of OnCreate that induce slight delays.

The reason the tried and true way doesn't work anymore is CodeGear had to radically change the handling of forms for Vista. My academic question for now is how to hide the app in taskbar with Application.MainFormOnTaskbar := True; (which is default)

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 25

Expert Comment

by:imitchie
ID: 20354194
I haven't actually got my Delphi2007 machine with me, but I'm still curious:
why is it

ShowWindow(Application.Handle, SW_SHOW) ; << the special "Application" window

instead of

ShowWindow(Self.Handle, SW_SHOW) ; << the main form
0
 

Expert Comment

by:Dream-
ID: 20677506
I have been looking for a solution as well. The only thing I have managed to do is just as Jebtrix said, to hide the application window taskbar button at OnShow or OnActivate. The problem is that is does show the button for a second.

There has to be a way to get this working.

One thing I found is that the problem appears at Application.Run. It seems this method unhides the application window. The method code did change in D2007.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21216651
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question