Solved

How to Make app invisible?

Posted on 1997-05-31
10
326 Views
Last Modified: 2010-04-06
I need my application to be invisible.

I can make my app invisible to the taskbar by placing the line of code below in the Project Source.

ShowWindow(application.handle, SW_HIDE);

However, setting the main forms Visible property to false has no effect.  

I can set if to false after the form has been initially shown, but the form is "Flashed" on screen.  This is not acceptable for my needs.  

How can I make my application invisible on startup, without any flashing on screen?
I am using Delphi 2.0
0
Comment
Question by:sleach
  • 5
  • 4
10 Comments
 
LVL 1

Author Comment

by:sleach
ID: 1336702
Edited text of question
0
 

Expert Comment

by:richweed
ID: 1336703
Sleach

Try making the form borderless and setting the height to 0 in the application source.

By the way, do you put the showwindow between the initialize and the createform?

Cheers
Richard
0
 

Expert Comment

by:richweed
ID: 1336705
Sleach

Try making the form borderless and setting the height to 0 in the application source.

By the way, do you put the showwindow between the initialize and the createform?

Cheers
Richard
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:sleach
ID: 1336706
Real good idea, but it isn't consistant.

Your method works perfectly in a small test application.  However when I implement it in my larger app with many forms, It works most of the time, but ocassionally the main form will stay on screen for about a second or so before it dissapears.

I cannot explain this behavior, or trace it in the debugger.
Any other ideas?
0
 
LVL 1

Author Comment

by:sleach
ID: 1336707
richwee, I found a workaround, so repost with answer, and i'll you award points.

thanks.
0
 

Accepted Solution

by:
richweed earned 100 total points
ID: 1336708
How do you mean repost? Just anything?

What was the workaround?
0
 
LVL 1

Author Comment

by:sleach
ID: 1336709
I was setting the form height to 0 in the OnCreate event.  Then a short time after the program had started, I was setting the visible property to false, and resetting the height back to normal.  The problem was that the form would occasionally show anyway.

The workaround was to wait until I acutally needed to make the form visible again, and then reset the height, and border style.

Thanks :)
0
 

Expert Comment

by:richweed
ID: 1336710
Sleach, thanks for the points!

By the way, I put the height assignment in the project source, just after creating the form.

Cheers
Richard
0
 

Expert Comment

by:richweed
ID: 1336711
Sleach, thanks for the points!

By the way, I put the height assignment in the project source, just after creating the form.

Cheers
Richard
0
 
LVL 3

Assisted Solution

by:Pegasus100397
Pegasus100397 earned 100 total points
ID: 1336704
Sleach,

give this a shot:

In your main form, set it's WindowsState property to wsMinimized and add the following to the [Private Declarations} of the main form:

PROCEDURE WMQUERYOPEN(VAR Msg: TWMQueryOpen);
 message WM_QUERYOPEN;

in the {implementation} section of the unit, add this:

Procedure TForm1.WMQUERYOPEN(VAR Msg: TWMQueryOpen);
Begin
 Msg.Result := 0;
END;

Hope this helps!
Pegasus
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 166
Run video youtube webbrowse 10 65
Working with hours 3 65
Press three keys together and trigger a function 3 61
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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