Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hiding from process list in Windows 2000

Posted on 2001-09-14
12
Medium Priority
?
326 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 300 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

971 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