Solved

Silent MFC application

Posted on 1998-03-30
21
537 Views
Last Modified: 2012-08-14
How can I make my MFC application so that it does not show up in the task bar or the task manager. I'll give ALL my points (600) for a sample application that really works.
0
Comment
Question by:lucidity
[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
  • 7
  • 7
  • 3
  • +3
21 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1183946
You can not make an application hidden from the task manager of Windows NT 4.0. However, you can make it hidden from the taskbar by creating a hidden main frame window.
0
 
LVL 2

Author Comment

by:lucidity
ID: 1183947
I know it is possible to hide it from the task manager.

but how do I make a hidden main frame window?

0
 
LVL 3

Expert Comment

by:Jackie071497
ID: 1183948
Check the Mike Blaszczak's Sample Programs.
There is one sample called STEALTH.ZIP
It is written by VC++ 5.0

0
Technology Partners: 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 3

Expert Comment

by:Jackie071497
ID: 1183949
This was asked a few weeks ago (in the windows topic area) and Mike (the author of stealth) responded (he is an expert).  He said there are some problems with the stealth.  It was written prior to windows 95 and does not work as well as it should now.  He said he would probably rewrite it to use the WS_EX_TOOLBAR style instead of a hidden main window.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1183950
thanx for the code, It does hide the app from the task bar but still appears in the task manager. If anyone can help me hide it from the task bar I will give them the rest of my points, if not I will give the 200 to jackie.. thanx in advance
0
 
LVL 2

Author Comment

by:lucidity
ID: 1183951
You said that it hides it from the task bar, but then ask for help in hiding it from the task bar.  What's the deal?

You can't have an app that doesn't appear in the task manager list. (The security problem should be obvious.)

.B ekiM


0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183952
sorry, I meant to hide the app from task manager. I know it can be done.
0
 
LVL 2

Author Comment

by:lucidity
ID: 1183953
Can you name an app that does it?

Your only hope is writing a service, which is very different than an application.

.B ekiM

0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183954
One possible way is to create a thread in an other application with the 'createremotethread' call.
You can for example open the explorer process and create a remote thread that will load in you mfc dll.
This will hide it from the task manager. (of course, if someone closes the explorer, your application will go down too.)

To hide it from the task manager, look at the stealth.zip sample
0
 
LVL 1

Accepted Solution

by:
rcabanie earned 400 total points
ID: 1183955
CreateRemoteThread() is insane: you can't control the life of your thread.  When the app terminates, so goes your thread. You'll leak any shared resources you've acquired.

.B ekiM
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183956
then what do you suggest, nobody seems to have anything better
0
 
LVL 2

Author Comment

by:lucidity
ID: 1183957
Why is it insane if you use it in combination with the explorer process?
This process will be alive as long as the user is logged in.
Since your app will run entirely in a dll, the DLL_DETACH will be called when the host application quits. This will enable your DLL to clean up...
0
 
LVL 1

Expert Comment

by:rcabanie
ID: 1183958
It's too late to clean up, if the system is shutting down before you get your DLL_DETACH notification. Performing heavy shutdown in response to DLL_DETACH is a bad idea, anyway, and likely to cause the system to deadlock.

Invasively injecting a thread into a process that you didn't, yourself, write to expect such attached threads is nominally a path to disaster and foolish at best.

The simple answer is that you can't create a process that safely doesn't show up in the task list. It just makes sense: would you want to have such a process on your machine? Are you writing a virus or trojan horse?

.B ekiM


0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183959
You're right. The only reason for such a process is a virus.

I was wrong saying you should respond to the DETACH. I meant that any statics in your dll will be destroyed when the host process exists.
0
 
LVL 1

Expert Comment

by:rcabanie
ID: 1183960
There is another reason for such a program, I am working on a security VxD for files in Win32. I would need a program always active (never able to be forcably closed) to communicate with the VxD).

So.. got any other ideas? I was thinking that I could go in and remove the process name from the task list or something to that effect, is that something that can be done?
0
 
LVL 2

Author Comment

by:lucidity
ID: 1183961
There is another reason for such a program, I am working on a security VxD for files in Win32. I would need a program always active (never able to be forcably closed) to communicate with the VxD).

So.. got any other ideas? I was thinking that I could go in and remove the process name from the task list or something to that effect, is that something that can be done?
0
 
LVL 2

Author Comment

by:lucidity
ID: 1183962
The task list is the least of your worries.  Just because the program doesn't show up in the task list doesn't mean it can't be terminated.  A user could use PVIEW.EXE or TLIST.EXE to kill it.

If your security scheme is dependent on an application always running, your security scheme is hopelessly flawed.

.B ekiM
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183963
Tlist and Pview read the registry for a list of applications, I do plan to somehow maskout the Name in the list of tasks. and further to that, if the exe is stopped all access is also stopped, the exe is simply to user interface to the VxD services anyway.

while we're on this topic, I am trying to get some of the TList.exe code to compile in a dialog based app (generated by app wizard) I can't seem to get the right compiler settings to make it work. have you ever done this?

0
 
LVL 2

Author Comment

by:lucidity
ID: 1183964
Good luck with your project.

.B ekiM
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183965
Good luck with your project.

.B ekiM
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1183966
if you ever find anything let me know
0

Featured Post

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!

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

717 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