Solved

Hiding application

Posted on 2000-03-11
13
166 Views
Last Modified: 2010-04-04
Hi,

how can i prevent my delphi application from be displayed anywhere (nor in the taskbar or in the current running tasks list - the box which shows up when in win95/98 you press CRT+ALT+DELETE).

Thanx
0
Comment
Question by:eruj
13 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 30 total points
ID: 2608506
this should do it:

const  RSP_SIMPLE_SERVICE = 1;
       RSP_UNREGISTER_SERVICE = 0;

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

procedure TForm1.FormActivate(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_HIDE);
SetWindowLong(Application.Handle, GWL_EXSTYLE,
  GetWindowLong(Application.Handle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);  
RegisterServiceProcess(GetCurrentProcessID,RSP_SIMPLE_SERVICE);
end;


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

Author Comment

by:eruj
ID: 2609162
Hi inthe,

your code works perfectly for hiding the app from the taskbar and current running tasks list, but the main form is still visible. Any suggestions on how to hide it?
0
 
LVL 25

Expert Comment

by:Mr_Peerapol
ID: 2609433
IMHO,

Put Timer in your main form, set its interval to 500, and in TimerEvent do Form.Hide ...

Does it work ? :)
0
 
LVL 1

Expert Comment

by:Vendi
ID: 2609917
Place this line right before the form is created.

frmMain.ShowMainForm = false;
0
 
LVL 1

Expert Comment

by:Vendi
ID: 2609929
Oops, now that I look again:

Application.ShowMainForm := false;

Application.CreateForm(...);
0
 
LVL 17

Expert Comment

by:inthe
ID: 2610170
in object inspector you can also set

visible := false for form1.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 2

Expert Comment

by:craig_capel
ID: 2612257
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

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

var
  Form1: TForm1;

implementation

{$R *.DFM}

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

procedure TForm1.FormActivate(Sender: TObject);
var
  w: hwnd;
begin
 showwindow(form1.handle,sw_hide);
 w:=findwindow('tapplication',nil);
 showwindow(w,sw_hide);
     {To Totally go Invisible}   //Your missing this
end;

end.


But yeah i agree with Barry, Set your main form to be invisible.... form1.visible:=False; on show or activate.... but this will do it....

Craig C.
0
 
LVL 1

Expert Comment

by:umulig
ID: 2612811
Or you could use a comp called Stealth that is on
www.torrys.com
0
 
LVL 3

Expert Comment

by:gandalf_the_white
ID: 2613051
to hide a form i would set
form1.height:=50
form1.top:=-100

or does that trigger other problems?
0
 

Expert Comment

by:Rusfist
ID: 2619474
Listening...
0
 
LVL 17

Expert Comment

by:inthe
ID: 2638143
hello...
a response would be good...
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2678657
listenning
0
 
LVL 2

Expert Comment

by:PeterLarsen
ID: 2679850
Listening
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

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…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

22 Experts available now in Live!

Get 1:1 Help Now