Autor Beitrag
TheUnknown
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 334



BeitragVerfasst: So 25.03.07 09:48 
Hi!

Mein "Problem" ist:

Mein Programm zeigt sein MainForm zur Laufzeit und hat auch ein TrayIcon neben der Uhrzeit. Alles wunderbar. Auch den Eintrag aus der TrayLeiste habe ich entfernen können. Auch super.

Das Programm soll auch im TaskManager stehen ("XYZ.exe"), aber im ALT+TAB-Menü soll es NICHT stehen, während alles andere aber bleibt, wie es ist.

Wie krieg ich das hin? Form sichtbar, TrayIcon sichtbar, im TaskMgr sichtbar und der TaskBar-Eintrag unsichtbar - nur im ALT+TAB krieg ich das Programm nicht raus - was muss machen!? :)
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: So 25.03.07 12:36 
Du meinst so wie bei icq und winamp auch ?

schau mal hier www.wer-weiss-was.de...9/article830929.html

mfg
TheUnknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 334



BeitragVerfasst: So 25.03.07 12:49 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
Du meinst so wie bei icq und winamp auch ?

schau mal hier www.wer-weiss-was.de...9/article830929.html

mfg


Danke, aber das klappt nicht. Es kommt zwar keinerlei Fehler oder sowas - aber es passiert schlichtweg gar nichts!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 27.03.07 16:19 
Bau einfach diesen Code in der DPR-Datei ein, bevor deine MainForm erzeugt wird. Damit verschwindet dein Programm aus der Taskleiste und dem Alt-Tab-Dialog.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  // Der Taskbar-Eintrag von Delphi-Programmen stammt üblicherweise vom
  // TApplication-Fenster. Dieser Eintrag soll nicht angezeigt werden,
  // stattdessen bekommt jedes Fenster sofern notwendig seinen eigenen
  // Eintrag durch setzen des WS_EX_APPWINDOW Styles.
  SetWindowLong(Application.Handle, GWL_EXSTYLE,
     GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);

Gruß, Motzi

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Di 27.03.07 16:36 
user profile iconMotzi hat folgendes geschrieben:
Bau einfach diesen Code in der DPR-Datei ein, bevor deine MainForm erzeugt wird. Damit verschwindet dein Programm aus der Taskleiste und dem Alt-Tab-Dialog.


Stimmt leider nicht ganz (bei mir): Das prog verschwindet aus der Taskbar, aber nicht aus dem ALT+TAB-Dialog... (Delphi7, WinXP, Gestartet aus der IDE heraus (Debug-Modus))
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 27.03.07 20:36 
Stimmt.. man muss den WS_EX_TOOLBAR Style auch für die Forms setzen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
type
  TForm1 = class(TForm)
  private
    { Private declarations }
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public declarations }
  end;

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_TOOLWINDOW;
end;

So gehts - zu mindest bei mir (habs grad getestet).

Gruß, Motzi

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mi 28.03.07 14:16 
cool!

das wäre also die Lösung des Problems ganz oben (nur leider nicht ohne dem ToolWindow-Style):
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_TOOLWINDOW;

  SetWindowLong(Application.Handle, GWL_EXSTYLE,
    GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
end;

end.
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.