Solved

Hiding from process list in Windows 2000

Posted on 2001-09-14
12
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 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