Link to home
Start Free TrialLog in
Avatar of mem100
mem100

asked on

remove app from taskbar

I don't want my application to show up on the taskbar. The app is written in delphi 4. Is there a way of removing the app from task manager( for NT& 98)?  
Avatar of rwilson032697
rwilson032697

For Win98 you can do this:


ShowWindow(Application.Handle, SW_HIDE);

for tht ctrl-del-alt thingy here is the code...

Const RSP_SIMPLE_SERVICE = 1;
Const RSP_UNREGISTER_SERVICE = 0;

//hide
RegisterServiceProcess(GetCurrentProcessId, RSP_SIMPLE_SERVICE);
//show
RegisterServiceProcess(GetCurrentProcessId, RSP_UNREGISTER_SERVICE);

this should be able to hide your application completely.... try it out...

For NT its a bit more difficult, you can still do this:

ShowWindow(Application.Handle, SW_HIDE);

to remove the button from the task bar, but to remove from the task manager is very difficult on NT...

Cheers,

Raymond.
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you are REALLY keen, you might want to read this thread:

https://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10186120 

Cheers,

Raymond.
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  function  RegisterServiceProcess(dwProcessID,dwType : DWORD) :
                      DWORD; stdcall; external 'KERNEL32.DLL';

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID,1);
end;

procedure TForm1.FormActivate(Sender: TObject);
var
  w: hwnd;
begin
 // showwindow(form1.handle,sw_hide);
 // w:=findwindow('tapplication',nil);
 // showwindow(w,sw_hide);

 {To Totally go Invisible}
end;

end.


Ok i think you were waiting for code you could lazely post code straight into your app no?....

Well that will do it under win 9x..

Craig C.
Avatar of mem100

ASKER

to craig

Post your comment as an answer. the register serviceprocess doesn't work on NT but the rest of code does hide the form and the application from the taskbar