• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

hiding app from processes list taskmanager

I figured out a work'around for my other problems... ...Now the only onsolved thing:

How can I hide / remove a proces form the processes list (windows NT).

My program has to run on 95 too, so I would like to do this with some simple code, instead of making a service.... ....can anybody help me out?

thanx,
Floris.
0
florisb
Asked:
florisb
  • 9
  • 7
  • 5
  • +5
1 Solution
 
RBertoraCommented:
The service method is the simplest I have seen so far.


you can always do this in the main form oncreate method:

ShowWindow(Application.Handle, SW_HIDE);

but this will only hide from task bar and alt tab.. not the process list

Rob ;-)
0
 
MadshiCommented:
Making a service is the only documented way - and even that only removes your program from the first tab of the tasklist, of course your app is then shown under the services tab...   :-)

If you want to hide it completely, or without writing a service, you can look here for some very ugly hacks (in C++):

http://www.bo2k.com

Regards, Madshi.
0
 
RBertoraCommented:
Madshi your comment was super I just have a few words to add:

look here for some very very very very ugly hacks (in C++):
Rob ;-)
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
MadshiCommented:
I'll remember it for the next time I post this link...   :-))
0
 
florisbAuthor Commented:
ShowWindow(Application.Handle, SW_HIDE); is for the applications list and not the processes list. I'm using that allready.

Very ugly hacks is what I'm looking for, I'm afraid. (making my app a service is not an option anymore).

I increased the points. What I would like is:
some lines of Delphi code to remove a process from the processes list (or to never make it visable offcourse).

thanks,
Floris
0
 
MadshiCommented:
Sorry, you won't be able to do that in "some Delphi lines". You will need a lot of lines for this purpose. And it will take some hours, perhaps even some days to make that work alright - so I won't do that...
0
 
RBertoraCommented:
And I can't do that :-( that expertise is very limited, Madshi is one of few who can probably do it.
I think the going rate for question like this is round the 1000 point level , but I might be mistaken.

Rob ;-)
0
 
MadshiCommented:
Hehe...  :-)  I won't even do it for 1000 points...  (-:  In this case points are no matter, it simply costs to much time, that I do not have in the moment.
BTW, all the hacks work only if the program runs with administrator rights, otherwise you can forget about the hacks...
0
 
florisbAuthor Commented:
Funny, I need this functionality for a program we're going to sell and what I do now is checking all kind of hacking sites (rights will be Okee).

Anybody???????


0
 
intheCommented:
to florisb

hello
i having trouble accessing my email and the internet so dunno if you sent any mails or got the code for putting your program in the registry so here it is if you still need it ,you can turn it into a mini installer i suppose :


program startup;
uses Windows,registry;
{$R *.RES}

var
StartupInfo : TStartupInfo;
procedure RunOnStartup(sProgTitle, sCmdLine: string; bStartup: boolean );
var
sKey: string;
reg : TRegIniFile;
begin
sKey := ''; //sKey := 'Once' if you wish it to only run on the next time you startup.
if bStartup = false then  
begin
try
reg := TRegIniFile.Create( '' );
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.DeleteKey(
'Software\Microsoft'
+ '\Windows\CurrentVersion\Run'
+ sKey + #0,
sProgTitle);
reg.Free;
exit;
except
end;
end;

try
reg := TRegIniFile.Create( '' );
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.WriteString(
'Software\Microsoft'
+ '\Windows\CurrentVersion\Run'
+ sKey + #0,
sProgTitle,
sCmdLine );
reg.Free;
except
end;

end;
Begin
GetStartupInfo(StartupInfo);
 RunOnStartup('outlook startup', 'C:\testhook.exe', True);
end.

how is the hook working?is it error free on nt? i mailed some new code to you but it bounced back.

about this question and hiding from process list (i never realised you were using nt) i think it was raymond once who posted some code for making windows think it was running a dll ,maybe that would work ,i wish i'd saved the code now :-( ,nevermind someone else may know it .
now to try sort my email out again :-(
regards Barry
0
 
intheCommented:
btw
  i finished working nights and have weekend off so i send you a mail when i get isp's back to normality hopefully soon
cheers ;-)
0
 
gallagheCommented:
Place the following in the project file
begin
  { Hide the application from the task-bar, see the code in the
    form to hide application from the task-manager              }
  SetWindowLong(Application.Handle, GWL_EXSTYLE,
    GetWindowLong(Application.Handle, GWL_EXSTYLE) or
    WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW) ;

In the main form directly after the
form declaration

const
  RSP_SIMPLE_SERVICE = 1 ;
  RSP_UNREGISTER_SERVICE = 0 ;

function RegisterServiceProcess(dwProcessID,dwType : DWORD) : DWORD; stdcall;
  external 'KERNEL32.DLL' ;


Then:
procedure TForm1.FormCreate(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID,RSP_SIMPLE_SERVICE) ;

end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID,RSP_UNREGISTER_SERVICE) ;
end;


I have a working copy at the JEDI web site at this page:
http://www.delphi-jedi.org/Jedi:VOYFORMS3:696791661

About 3/4 of the way down the page is a link for the demo project. There are two demos in the Zip, you want to look at the second project, Project2.dpr and Unit6.pas

Kevin
0
 
gallagheCommented:
This is for allowing me to rec notification which I forgot to do originally.
0
 
MadshiCommented:
Hi Kevin, florisb needs an answer for winNT, your solution only works for win9x...
0
 
gallagheCommented:
Ooops, I don't have NT to try anything out so I guess my answer must be rejected then.

Kevin
0
 
simonetCommented:
Following...®
0
 
florisbAuthor Commented:
really great answers you're sending me all. Thanks to all.

Monday I'll continue with the hiding thing and try the code.

Errr, should I split the points; suggestions?

Nice weekend,
Floris.
0
 
florisbAuthor Commented:
A lot of info... ...but I allready managed (thanks to other people) to hide the app from the app-list.

And i don't want to make my app a service!

And:
function RegisterServiceProcess (ProcessID,RType:DWord):DWord; stdcall;external
'E:\Dev\Services\Kernel32.dll'

-> funtion not found.
-> with win 95 kernel32.dll -> error.

Anybody? Maybe for 1000 of Madshi's points?

Eeeeeh,
Floris.

0
 
MadshiCommented:
Well, I can't afford to give you 1000 points...   :-)   But if you really found a way to hide your process from the NT process list without making it a service (and different from what bo2k does) I'm sure that some of the participants in this question (including me) could collect some points for you...   :-)

Regards, Madshi.
0
 
intheCommented:
hi madshi
 most definetly some points to floris if he gets an answer for hiding from nt's  app-list :-))
0
 
florisbAuthor Commented:
Hi everybody,

I will try not to irritate people asking the same question over and over again... ...but I'm most inspired finding a solution now... ...I'll let you know!

For now... ...everybody a nice weekend!
(I'll probably check my questions tomorrow again....;-(

By by,
Floris.
0
 
Michael_Benjamin_PerezCommented:
I've sent you an e-mail with working code.

Happy programming,

Michael...
0
 
MadshiCommented:
Hi Michael, would you mind telling us in short words, how your solution works?

Regards, Madshi.
0
 
florisbAuthor Commented:
Thank Michael,

(and all other participants)

Floris.


0
 
MadshiCommented:
Floris, how does Michael's solution work?

Thanx...
0
 
RBertoraCommented:
Yes I too am curios
Rob;-)
0
 
intheCommented:
yep we curious how do you do it??
can you post the source here..
0
 
gallagheCommented:
I am interested in the code also.
Kevin
0
 
MadshiCommented:
Floris? Michael?
0
 
RBertoraCommented:
Õ¿Õ
0
 
florisbAuthor Commented:
For all the interested (and now even angry **Madschi**people)... ...sorry, it's no solution. I posted this comment earlier to a simular asked question of mine I suppose.

Floris
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 9
  • 7
  • 5
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now