Solved

Hiding from process list in Windows 2000

Posted on 2001-09-14
12
320 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
Independent Software Vendors: 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

736 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