Solved

invisible application

Posted on 1998-12-26
7
139 Views
Last Modified: 2010-04-04
How can I make my application absolutly .. invisible (for normal windows usage ofcourse: not in alt+ctrl+del list, not in taskbar, not in alt+tab... and so on)

0
Comment
Question by:skatan187
  • 4
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 1353236
to hide app from Ctrl Alt Del:

const
  RSP_SIMPLE_SERVICE = 1;
  RSP_UNREGISTER_SERVICE = 0;

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

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

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

To remove the window from the taskbar:

ShowWindow(Application.Handle, SW_HIDE);
SetWindowLong(Application.Handle, GWL_EXSTYLE,
  GetWindowLong(Application.Handle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);

to hide from crtl+tab add
Application.ShowMainForm:=False;
after application.initilize; in .dpr file


0
 
LVL 20

Expert Comment

by:Madshi
ID: 1353237
Perfect answer...   :-)
0
 
LVL 17

Expert Comment

by:inthe
ID: 1353238
im learning and have good teachers eh :-)

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:skatan187
ID: 1353239
Yep .. it worked !
and that mean.. perfect answer
but I also found a file stealth.pas myself

and eum:



procedure TStealth.HideApplication;
begin
  if not (csDesigning in ComponentState) then
    RegisterServiceProcess(GetCurrentProcessID, 1);
end;

procedure TStealth.ShowApplication;
begin
  if not (csDesigning in ComponentState) then
    RegisterServiceProcess(GetCurrentProcessID, 0);
end;

0
 
LVL 17

Expert Comment

by:inthe
ID: 1353240
csDesigning  eh i never hear that one before
anyway happy new year :-)
Regards Barry
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1353241
Barry,

csDesigning is a flag which you can ask only in components. It tells you in which mode your component is. If you add your component to a form without running your program, csDesigning is set. If the program is run (in Delphi or outside Delphi), it is cleared.

The Stealth code is implemented as a little component, and the csDesigning call makes sure that your application is only hidden when the program really runs, and not when you design the form in Delphi...

Regards and a happy new year... Madshi.
0
 
LVL 17

Expert Comment

by:inthe
ID: 1353242
ah thankyou that could be useful
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

864 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now