whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

34 Visitors Online


 
...hide a program from the taskbar?
Autor: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch
[ Print tip ]  

Tip Rating (7):  
     


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;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners