drol
asked on
How To hide my application from tasklist? (win95/98)
Hi!
I tried to hide my application with following code:
var i:longint;
handle:longint;
begin
i:=GetCurrentProcessId;
handle:=OpenProcess(PROCES S_ALL_ACCE SS,true,i) ;
RegisterServiceProcess(han dle,1);
end;
It do not work. Any idea?
I tried to hide my application with following code:
var i:longint;
handle:longint;
begin
i:=GetCurrentProcessId;
handle:=OpenProcess(PROCES
RegisterServiceProcess(han
end;
It do not work. Any idea?
drol
I have done this to hide the button from the taskbar. Added this to the project source (you must also add Windows to uses)
example
program YourApplication;
uses
Windows,
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {AboutForm};
{$R *.RES}
begin
Application.Initialize;
Application.ShowMainForm := False;
Application.Title := 'Your Application';
Application.CreateForm(TFo rm1, Form1);
Application.CreateForm(TAb outForm, AboutForm);
ShowWindow(Application.Han dle, SW_HIDE);
Application.Run;
end.
I have done this to hide the button from the taskbar. Added this to the project source (you must also add Windows to uses)
example
program YourApplication;
uses
Windows,
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {AboutForm};
{$R *.RES}
begin
Application.Initialize;
Application.ShowMainForm := False;
Application.Title := 'Your Application';
Application.CreateForm(TFo
Application.CreateForm(TAb
ShowWindow(Application.Han
Application.Run;
end.
if you wanted to show it again you would use SW_RESTORE inplace of SW_HIDE
Regards
Chris
Regards
Chris
drol,
even though "RegisterServiceProcess" is supposed to register the application with the given handle, i have never seen/heard that it worked with third party programs.
if you are trying to remove YOUR program from the tasklist then you can call RSP with a parameter of 0 rather than the handle. The following works perfectly in Delphi.
ok := RegisterServiceProcess (0, RSP_SIMPLE_SERVICE);
if ok = 0 then ShowMessage ('Error Registering Service');
i guess this is the info you're looking for.
even though "RegisterServiceProcess" is supposed to register the application with the given handle, i have never seen/heard that it worked with third party programs.
if you are trying to remove YOUR program from the tasklist then you can call RSP with a parameter of 0 rather than the handle. The following works perfectly in Delphi.
ok := RegisterServiceProcess (0, RSP_SIMPLE_SERVICE);
if ok = 0 then ShowMessage ('Error Registering Service');
i guess this is the info you're looking for.
Hi all,
I could not undertand why you used OpenProcess, Simply try this
RegisterServiceProcess(Get CurrentPro cessID,1);
And as bdtikast do not forget to hide the mainform
That is all I think,
Regards,
I could not undertand why you used OpenProcess, Simply try this
RegisterServiceProcess(Get
And as bdtikast do not forget to hide the mainform
That is all I think,
Regards,
Sorry for mistyping the third to last line of my comment, it would be
"And as bdtikast SAID, do not forget to hide the mainform "
Regards.
"And as bdtikast SAID, do not forget to hide the mainform "
Regards.
ASKER
i want to hide my application from tasklist not from taskbar.
ASKER
registerserviceprocess(0,1 ) does not work.
i'm running win98.
I use delphi 3 and include the function from kernel32.dll as 'external'. is there a unit that includes the function?
where in the code you use the function?
i'm running win98.
I use delphi 3 and include the function from kernel32.dll as 'external'. is there a unit that includes the function?
where in the code you use the function?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
drol,
RegisterServiceProcess(0, 1) works in Win95.
i Register the my serivces in the FormCreate method.
RegisterServiceProcess(0, 1) works in Win95.
i Register the my serivces in the FormCreate method.
ASKER
Thank you all!
Now, it works.
I forgot the 'stdcall' statement. :-)
Now, it works.
I forgot the 'stdcall' statement. :-)
How do I hide the application from the taskbar and still have the main form unhidden?
ASKER
Hi Sageryd
try
Application.ShowMainForm:= false;
try
Application.ShowMainForm:=
WRONG! That hides the form AND the taskbar-button. I want something that only hides my application from the taskbar, not the MainForm!
begin
Application.Initialize;
Application.CreateForm(TFo
Application.ShowMainForm:=
Form1.Visible:= false;
Application.Run;
end.