Solved

Hiding from process list in Windows 2000

Posted on 2001-09-14
12
319 Views
Last Modified: 2010-04-06
I need to make my application "unclosable", ie. I don't want users to be able to close it.  This is fairly easy to to in Windows9x, just disable ctrl-alt-del and you're set.

However, I need this to work under Windows 2000.  I think it's impossible to disable ctrl-alt-del in Win2k right? Please correct me if I'm wrong, and maybe give a solution to it :=)

But is there a way to hide my program from the process list, so even if the user presses ctrl-alt-delete, he will not be able to select my program and kill it?

Another thing I've seen, it seems to be impossible to kill some processes like LSASS.EXE for example, all you get is an "access denied error".  Is it possible to protect my program with something like that?

All input appreciated!

Regards,
hagur

P.S I'd prefer code, not components, using components is the last resort in this case.
0
Comment
Question by:hagur
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 2

Expert Comment

by:bugroger
ID: 6484410
Hi,

Try this to hide your program from the task manager

RegisterServiceProcess(GetCurrentProcessId(), 1);

and this, if you want to hide it from Alt + Tab

Var
 CurrentStyle: Integer;
begin
 ExtendedStyle := GetWindowLong (Application.Handle, GWL_EXSTYLE);
 SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW);
end;

I'm not sure if it works with Win2K


0
 
LVL 2

Accepted Solution

by:
bugroger earned 100 total points
ID: 6484461
here is the right one:

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

VAR
 CurrentStyle: Integer;

begin
 RegisterServiceProcess(GetCurrentProcessId(), 1);

 CurrentStyle := GetWindowLong (Application.Handle, GWL_EXSTYLE);
 SetWindowLong(Application.Handle, GWL_EXSTYLE, CurrentStyle OR WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW);
end;

GL
 Bug
0
 
LVL 2

Expert Comment

by:alexstewart@beta
ID: 6484777
You can write a w2k service app (which normally run under the system account). A user can the see the process in task manager, but cannot kill it, (depending on privileges).

as
0
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.

 
LVL 2

Expert Comment

by:alexstewart@beta
ID: 6484789
The user interface for a service should normally be a separate program. The service program will happily run with no one logged in. If you use pipe or tcp to talk to your service you can run the interface on a separate computer from the critical program itself.

The best known service is probably the web server, IIS. This brings us to another option, you can run your program as a service with a web user interface, either using IIS or a sepatate HTTPd component.

as
0
 
LVL 3

Expert Comment

by:cubud
ID: 6484991
RegisterServiceProcess is only available in Win9x

For NT and 2000 you need to write a proper service.

Pete
====
http://www.HowToDoThings.com (Articles)
http://www.StuckIndoors.com/delphi (open source)
0
 
LVL 3

Expert Comment

by:cubud
ID: 6484993
RegisterServiceProcess is only available in Win9x

For NT and 2000 you need to write a proper service.

Pete
====
http://www.HowToDoThings.com (Articles)
http://www.StuckIndoors.com/delphi (open source)
0
 
LVL 3

Expert Comment

by:f15iaf
ID: 6487401
listenning
0
 
LVL 3

Expert Comment

by:cubud
ID: 6493076
File->New
Look down and you will see
"Service application"

Pete
====
http://www.HowToDoThings.com (Delphi Articles)
http://www.Stuckindoors.com/delphi (Open source)
0
 
LVL 3

Author Comment

by:hagur
ID: 6493670
I'm afraid that a service application is no good in this case .... any other ideas?
0
 
LVL 3

Expert Comment

by:cubud
ID: 6493809
Why is it no good ?
Make 2 projects which share the same source.

A standard project for Win9X and a Service for NT/2000.

Pete
0
 
LVL 3

Author Comment

by:hagur
ID: 6494382
The program has a user interface, you know forms and everything .... won't that be a problem if it's a service?

I'm not prepared to create a separate interface program which connects the service through TCP/IP or pipe or anything.
0
 
LVL 3

Author Comment

by:hagur
ID: 6515279
Your comment works in Win9x, and the requirements for my program changed - it doesn't have to work under Windows2k anymore.

Thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question