• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

Remove app from task list

Hi all.

Is there anyway I can remove my app from the active task list (alt-tab)?  I would also like it to be removed from the shutdown list when you press Ctrl-Alt-Del.

Cheers,

Stu.
0
SJohnson
Asked:
SJohnson
  • 3
  • 2
1 Solution
 
rwilson032697Commented:
Here is example:  (though it works only for 95/98 - NT etc is a much harder task!)

       Cheers,

       Raymond.

           unit Unit1;

           interface

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

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

           var
             Form1: TForm1;

           implementation

           {$R *.DFM}
           const
             RSP_SIMPLE_SERVICE = 1;
             RSP_UNREGISTER_SERVICE = 0;

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

           procedure TForm1.FormDestroy(Sender: TObject);
           begin
             RegisterServiceProcess(GetCurrentProcessID,RSP_UNREGISTER_SERVICE);
           end;

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

           end.
0
 
SJohnsonAuthor Commented:
Hi Ray,

Although it has removed the entry from the shutdown list, it is still visible when I alt-tab.  Any suggestions?

Stu
0
 
rwilson032697Commented:
In the DPR do this... (this should hide the task bar icon and make it disappear from the ALT-TAB list...

begin
  IsLibrary := True;
  Application.Initialize;
  IsLibrary := False

  etc...
end.


Cheers,

Raymond.
0
 
rwilson032697Commented:
Another way is to do this:

ShowWindow(Application.Handle, SW_HIDE);

Cheers,

Raymond.

0
 
SJohnsonAuthor Commented:
Thanks, Ray.  The combination of all your suggestions worked a treat.  Thanks

Stu.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now