Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Remove the icon from the taskbar?

Posted on 1999-01-10
26
Medium Priority
?
466 Views
Last Modified: 2010-04-04
How can I remove the taskbar Icon and title text from the taskbar.

The forms are opened as modal windows in an Exchange Extension DLL. I don't want to see the Icons though.

I don't want to turn the window into a toolbox dialog.
0
Comment
Question by:JasonC
  • 10
  • 5
  • 4
  • +5
26 Comments
 
LVL 5

Expert Comment

by:heathprovost
ID: 1355774
Go to "Project>Options>Application" on the Delphi menu.  Enter a space for the Application Title and create a blank icon (completely transparent) and assign it to the application icon.  This is admittedly a hack but it does produce a comletely blank taskbar icon.

Heath
0
 

Author Comment

by:JasonC
ID: 1355775
I don't think I worded it quite right, I don't want to see the Taskbar button created at all.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355776
Do this:

ShowWindow(Application.Handle, SW_HIDE);

Cheers,

Raymond.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:heathprovost
ID: 1355777
Oh...... Then do it rwilson's way.  That should do it.
0
 

Author Comment

by:JasonC
ID: 1355778
No, sorry didn't work, the Extension is a DLL loaded by Outlook, the form has to be shown as a modal form.

Thanks anyway
0
 
LVL 3

Expert Comment

by:williams2
ID: 1355779
How do you create your form? ..show us how you initiate the windowed controls and which parameters you are carrying with it.

regards,
Williams
0
 

Author Comment

by:JasonC
ID: 1355780
MyForm:
  BorderIcons = [biSystemMenu]
  BorderStyle = bsSingle
  Position = poScreenCenter
  ShowHint = True

Application.CreateForm(TMyForm, MyForm);
MyForm.ShowModal;


0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355781
Create a "dummy" main form. This form will NEVER be shown so make
it some small, empty box or whatever.
Do the following:

1) Create your application.
2) Add TWO forms, the first is your DUMMY main window, the second (and
more) will be the dialogs you want.
3) Change your DPR (application source), by adding the following lines
just before the "Application.Run" line:

program Project1;

uses
  Forms,
  Windows,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
{ add these next two lines}
  Application.ShowMainForm:=false;
  ShowWindow(Application.Handle,SW_HIDE);
{}
  Application.Run;
end.

- this will hide the mainform (actually, it will prevent it from ever
appearing - i.e. no flicker) and hides the app too.

Cheers,

Raymond.
0
 
LVL 3

Expert Comment

by:williams2
ID: 1355782
Actually you can write

  ShowWindow(Application.Handle,SW_HIDE);

Before you initialize the application object, else you will be able to track a glitch of a button on the taskbar, but else I support wilsons example.

Regards,
Williams
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355783
JasonC,

Does this do the trick?

Cheers,

Raymond.
0
 

Author Comment

by:JasonC
ID: 1355784
No, it must have something to do with the DLL being loaded by Microsoft Outlook. The only way I can work around the problem is to turn the border style to bsToolWindow. Which isn't the best as I liked to see the icon's in the title bar.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355785
Hmmm. You could try to override the TForm1.CreateParams function and in this function do this:

  Params.Style:=Params.Style (and (not WS_CHILD)) or WS_POPUP;
  Params.WndParent:=OutlookMainWindowHandle;

Perhaps this helps. Please try it...

Regards, Madshi.
0
 

Author Comment

by:JasonC
ID: 1355786
procedure TForm1.FormCreate(Sender: TObject);
var
 MyParams : TCreateParams;

begin
Form1.CreateParams(MyParams);
MyParams.Style := MyParams.Style + (not WS_CHILD) or WS_POPUP;
MyParams.WndParent := FindWindow('Outlook.Application',nil);
Form1.CreateParams(MyParams);
end;

What is wrong with this code? Have I got in the wrong place?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355787
Write this line

MyParams.Style := MyParams.Style + (not WS_CHILD) or WS_POPUP;

like this

MyParams.Style := MyParams.Style and (not WS_CHILD) or WS_POPUP;

Raymond.
0
 

Author Comment

by:JasonC
ID: 1355788
Sorry Guys, it still shows on the taskbar.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1355789
JasonC

I think what you need to do is use GetWindowLong, SetWindowLong etc like so...

        ShowWindow(Application.Handle, SW_HIDE);
        SetWindowLong(Application.Handle, GWL_EXSTYLE,
        GetWindowLong(Application.Handle, GWL_EXSTYLE) and not WS_EX_TOOLWINDOW);

Later
BoRiS

        ShowWindow(Application.Handle, SW_SHOW );
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355790
Hmmm. I meant it this way:

type TForm1 = class(TForm)
  ...
  public
    { Public-Deklarationen }
    procedure CreateParams(var Params: TCreateParams); override;
  end;

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  Params.Style:=(Params.Style and (not WS_CHILD)) or WS_POPUP;  // I'm not sure if these two lines have to be in fron of the inherited or behind of it...  :-)
  Params.WndParent:=OutlooksMainWindowsHandle;
  inherited;
  Params.Style:=(Params.Style and (not WS_CHILD)) or WS_POPUP;
  Params.WndParent:=OutlooksMainWindowsHandle;
end;

Regards, Madshi.
0
 

Author Comment

by:JasonC
ID: 1355791
No, Sorry it still shows in the taskbar, maybe this is a problem with Outlook.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355792
Hmm. Perhaps. I don't think so, but perhaps. However, I've no more ideas... Sorry...  :-(
0
 

Expert Comment

by:WarheaD
ID: 1355793
Hey

Try either

      SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
or
     SetWindowLong(Application.Handle, GWL_EXSTYLE, not WS_EX_TOOLWINDOW);

on the FormCreate

0
 

Author Comment

by:JasonC
ID: 1355794
Still doesn't work.
0
 

Accepted Solution

by:
hallih earned 400 total points
ID: 1355795
Put this in the main begin/end. of your project.dpr file (it will not work unless placed there) open the project.dpr file by going into the projecte menu and select "view source",  the main begin/end is at the bottom of the file,  If you place this anywhere else in your code delphi will overwrite it...

Best regards

ExtendedStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR TOOLWINDOW                                                  AND NOT WS_EX_APPWINDOW);
0
 

Author Comment

by:JasonC
ID: 1355796
ExtendedStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR TOOLWINDOW AND NOT WS_EX_APPWINDOW);

Sorry this didn't work either all though I had to remove the TOOLWINDOW part because delphi didn't know what this was.

Thanks

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1355797
Jason: I think he meant WS_EX_TOOLWINDOW

Raymond.
0
 

Author Comment

by:JasonC
ID: 1355798
Yeah, sorry, I worked that out after I sent the comment, anyway, same problem, it shows on the taskbar still.

Thanks
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355799
Hi Jason, if you want, you can send your whole project to "madshi@gmx.net". Then I'll look at it. But please tell me what I need to do to make Outlook load this dll.

Regards, Madshi.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

772 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