Solved

Hiding from process list in Windows 2000

Posted on 2001-09-14
12
315 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now