Solved

invisible application

Posted on 1998-12-26
7
138 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

11 Experts available now in Live!

Get 1:1 Help Now