JasonC
asked on
Remove the icon from the taskbar?
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.
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.
ASKER
I don't think I worded it quite right, I don't want to see the Taskbar button created at all.
Do this:
ShowWindow(Application.Han dle, SW_HIDE);
Cheers,
Raymond.
ShowWindow(Application.Han
Cheers,
Raymond.
Oh...... Then do it rwilson's way. That should do it.
ASKER
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
Thanks anyway
How do you create your form? ..show us how you initiate the windowed controls and which parameters you are carrying with it.
regards,
Williams
regards,
Williams
ASKER
MyForm:
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Position = poScreenCenter
ShowHint = True
Application.CreateForm(TMy Form, MyForm);
MyForm.ShowModal;
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Position = poScreenCenter
ShowHint = True
Application.CreateForm(TMy
MyForm.ShowModal;
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(TFo rm1, Form1);
Application.CreateForm(TFo rm2, Form2);
{ add these next two lines}
Application.ShowMainForm:= false;
ShowWindow(Application.Han dle,SW_HID E);
{}
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.
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(TFo
Application.CreateForm(TFo
{ add these next two lines}
Application.ShowMainForm:=
ShowWindow(Application.Han
{}
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.
Actually you can write
ShowWindow(Application.Han dle,SW_HID E);
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
ShowWindow(Application.Han
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
JasonC,
Does this do the trick?
Cheers,
Raymond.
Does this do the trick?
Cheers,
Raymond.
ASKER
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.
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:=OutlookM ainWindowH andle;
Perhaps this helps. Please try it...
Regards, Madshi.
Params.Style:=Params.Style
Params.WndParent:=OutlookM
Perhaps this helps. Please try it...
Regards, Madshi.
ASKER
procedure TForm1.FormCreate(Sender: TObject);
var
MyParams : TCreateParams;
begin
Form1.CreateParams(MyParam s);
MyParams.Style := MyParams.Style + (not WS_CHILD) or WS_POPUP;
MyParams.WndParent := FindWindow('Outlook.Applic ation',nil );
Form1.CreateParams(MyParam s);
end;
What is wrong with this code? Have I got in the wrong place?
var
MyParams : TCreateParams;
begin
Form1.CreateParams(MyParam
MyParams.Style := MyParams.Style + (not WS_CHILD) or WS_POPUP;
MyParams.WndParent := FindWindow('Outlook.Applic
Form1.CreateParams(MyParam
end;
What is wrong with this code? Have I got in the wrong place?
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.
MyParams.Style := MyParams.Style + (not WS_CHILD) or WS_POPUP;
like this
MyParams.Style := MyParams.Style and (not WS_CHILD) or WS_POPUP;
Raymond.
ASKER
Sorry Guys, it still shows on the taskbar.
JasonC
I think what you need to do is use GetWindowLong, SetWindowLong etc like so...
ShowWindow(Application.Han dle, SW_HIDE);
SetWindowLong(Application. Handle, GWL_EXSTYLE,
GetWindowLong(Application. Handle, GWL_EXSTYLE) and not WS_EX_TOOLWINDOW);
Later
BoRiS
ShowWindow(Application.Han dle, SW_SHOW );
I think what you need to do is use GetWindowLong, SetWindowLong etc like so...
ShowWindow(Application.Han
SetWindowLong(Application.
GetWindowLong(Application.
Later
BoRiS
ShowWindow(Application.Han
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.Styl e 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:=Outlooks MainWindow sHandle;
inherited;
Params.Style:=(Params.Styl e and (not WS_CHILD)) or WS_POPUP;
Params.WndParent:=Outlooks MainWindow sHandle;
end;
Regards, Madshi.
type TForm1 = class(TForm)
...
public
{ Public-Deklarationen }
procedure CreateParams(var Params: TCreateParams); override;
end;
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
Params.Style:=(Params.Styl
Params.WndParent:=Outlooks
inherited;
Params.Style:=(Params.Styl
Params.WndParent:=Outlooks
end;
Regards, Madshi.
ASKER
No, Sorry it still shows in the taskbar, maybe this is a problem with Outlook.
Hmm. Perhaps. I don't think so, but perhaps. However, I've no more ideas... Sorry... :-(
Hey
Try either
SetWindowLong(Application. Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
or
SetWindowLong(Application. Handle, GWL_EXSTYLE, not WS_EX_TOOLWINDOW);
on the FormCreate
Try either
SetWindowLong(Application.
or
SetWindowLong(Application.
on the FormCreate
ASKER
Still doesn't work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
SetWindowLong(Application.
Sorry this didn't work either all though I had to remove the TOOLWINDOW part because delphi didn't know what this was.
Thanks
Jason: I think he meant WS_EX_TOOLWINDOW
Raymond.
Raymond.
ASKER
Yeah, sorry, I worked that out after I sent the comment, anyway, same problem, it shows on the taskbar still.
Thanks
Thanks
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.
Regards, Madshi.
Heath