tyfing
asked on
Win98 tasklist
How do i hide a Delphi 3 application from Windows 98's tasklist (Ctrl+Alt+Del), i'm a newbie so pls be specific. thanks
{A demo}
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Const RSP_SIMPLE_SERVICE = 1;
Const RSP_UNREGISTER_SERVICE = 0;
function RegisterServiceProcess(dwP rocessID,d wType:DWOR D):DWORD;s tdcall;
var
Form1: TForm1;
implementation
{$R *.DFM}
function RegisterServiceProcess(dwP rocessID,d wType:DWOR D):DWORD;e xternal 'kernel32.dll';
procedure MakeMeService;
var
pid,
reserv:DWORD;
begin
pid:=GetCurrentProcessId;
reserv := RegisterServiceProcess(pid ,RSP_SIMPL E_SERVICE) ;
end;
procedure UnMakeMeService;
var
pid,
reserv:DWORD;
begin
pid := GetCurrentProcessId;
reserv := RegisterServiceProcess(pid ,RSP_UNREG ISTER_SERV ICE);
end;
procedure TForm1.Button1Click(Sender : TObject);
begin
MakeMeService;
end;
procedure TForm1.Button2Click(Sender : TObject);
begin
UnMakeMeService;
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Const RSP_SIMPLE_SERVICE = 1;
Const RSP_UNREGISTER_SERVICE = 0;
function RegisterServiceProcess(dwP
var
Form1: TForm1;
implementation
{$R *.DFM}
function RegisterServiceProcess(dwP
procedure MakeMeService;
var
pid,
reserv:DWORD;
begin
pid:=GetCurrentProcessId;
reserv := RegisterServiceProcess(pid
end;
procedure UnMakeMeService;
var
pid,
reserv:DWORD;
begin
pid := GetCurrentProcessId;
reserv := RegisterServiceProcess(pid
end;
procedure TForm1.Button1Click(Sender
begin
MakeMeService;
end;
procedure TForm1.Button2Click(Sender
begin
UnMakeMeService;
end;
end.
Hi Shengw, nice answer :o)
but I was slightly first so would to mind to withdraw your answer...
but I was slightly first so would to mind to withdraw your answer...
ASKER
epsylon's one is short and much sweeter and it works 100% fine.
ASKER
epsylon, thanks for your help but i have lost the email informing me of your aid...why don't you post another solution, well....just change the button's name or something to make it different and i will gladly accept it and accept ur solution. :)
Tyfing, I see that you are new here so a little explanation how this site works.
Each comment has a button. Scroll up and look for the comment that you want to accept as answer and click on this button. The rest is easy...
Cheers.
Each comment has a button. Scroll up and look for the comment that you want to accept as answer and click on this button. The rest is easy...
Cheers.
Cheers:
I'm shenqw,not shengw.
Congratulations!!!
I'm shenqw,not shengw.
Congratulations!!!
Sorry shenqw, didn't see that. There's no difference between the 'g' and the 'q' when it is underlined :o)
very confusing......
very confusing......
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
listen
Very nice,
Is it really so easy - hmmm !!
Is it really so easy - hmmm !!
Please grade...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Hide: TButton;
Show: TButton;
procedure HideClick(Sender: TObject);
procedure ShowClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function RegisterServiceProcess(dwP
DWORD; stdcall; external 'KERNEL32.DLL';
implementation
{$R *.DFM}
procedure TForm1.HideClick(Sender: TObject);
begin
RegisterServiceProcess(Get
end;
procedure TForm1.ShowClick(Sender: TObject);
begin
RegisterServiceProcess(Get
end;
end.