Einzelnen Beitrag anzeigen

digga

Registriert seit: 26. Jan 2005
11 Beiträge
 
#4

Re: Application im Task-Panel (ALT-TAB) verstecken

  Alt 25. Mai 2005, 16:11
Nach längerer Suche durch etliche Newsgroups,
bin ich immer wieder auf folgende Code gestoßen.

Delphi-Quellcode:
program Project1;

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

{$R *.RES}

//Declare a var to retrieve current window information
var
  ExtendedStyle : Integer;

begin
  Application.Initialize;

  //Get the Extended Styles of the Application, by passing its
  //handle to GetWindowLong
  ExtendedStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);

  //Now, set the Extended Style by doing a bit masking operation.
  //OR in the WS_EX_TOOLWINDOW bit, and AND out the WS_EXAPPWINDOW bit
  //This effectively converts the application from an App Windows to a
  //Tool Window.
  SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR WS_EX_TOOLWINDOW
                                                 AND NOT WS_EX_APPWINDOW);
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
Es wird zwar kein Eintrag in der Taskleiste erstellt, aber im Task-Panel (ALT-TAB) ist mein Programm auch weiterhin zu sehen.

Hat nicht jemand einen weiteren Vorschlag?
  Mit Zitat antworten Zitat