Entwickler-Ecke

Sonstiges (Delphi) - Programm verstecken


tmkb - So 04.08.02 13:00
Titel: Programm verstecken
Hallo
Kann mir jemand sagen wie ich es mach, das mein Programm nicht unten in der Leiste angezeigt wird (wie die Leiste heißt hab ich grad vergessen, sorry), also das es nur ganz normal startet aber nicht unten in der Leiste den Platz einnimmt. thx


cbs - So 04.08.02 13:17

Tag auch

die "Leiste" nennt sich Taskleiste oder TaskBar.
folgender tipp aus swissdelphicenter.ch [http://www.swissdelphicenter.ch/de/showcode.php?id=54] könnte dir weiterhelfen:

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:
procedure TMainForm.FormShow(Sender: TObject); 
var 
  hwndOwner: HWnd; 
begin 
  hwndOwner := GetWindow(Handle, GW_OWNER); 
  ShowWindow(hwndOwner, SW_HIDE); 
  // For Windows 2000, additionally call the ShowWindowAsync function: 
  ShowWindowAsync(hwndOwner, SW_HIDE); 
  ShowWindowAsync(Self.Handle, SW_HIDE); 
end; 


  Prevent the form from reappearing on the Taskbar after minimizing it: 

  Verhindern, dass nach einem Minimize die Applikation wieder in der Taskbar 
  erscheint: 


private 
  procedure WMSysCommand(var msg: TWMSysCommand); message WM_SysCommand; 

{....} 

implementation 

procedure TMainForm.WMSysCommand(var msg: TWMSysCommand); 
begin 
  if msg.CmdType and $FFF0 = SC_MINIMIZE then 
    hide 
  else 
    inherited; 
end;

damit verschwindet der eintrag in der taskleiste deines programms

ich habs aber net getestet


GruppeCN - Di 05.11.02 16:37

So geht´s:

Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.FormCreate(Sender: TObject);
begin
  ShowWindow( Application.Handle, SW_HIDE );
  SetWindowLong( Application.Handle, GWL_EXSTYLE,
                 GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                  WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
   ShowWindow( Application.Handle, SW_SHOW );
end;


SteaLth - Mi 06.11.02 15:08

noch ne schöne Variante:

Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormShow(Sender: TObject);
var Owner : HWnd;
begin
  Owner:=GetWindow(Handle, GW_OWNER);
  ShowWindow(Owner, SW_HIDE);
end;


(07.11.02 09:22 Tino) Signatur entfernt. Siehe Richtlinien.