Solved

How to Make app invisible?

Posted on 1997-05-31
10
321 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
Comment Utility
Edited text of question
0
 

Expert Comment

by:richweed
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:sleach
Comment Utility
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
Comment Utility
richwee, I found a workaround, so repost with answer, and i'll you award points.

thanks.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Accepted Solution

by:
richweed earned 100 total points
Comment Utility
How do you mean repost? Just anything?

What was the workaround?
0
 
LVL 1

Author Comment

by:sleach
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

8 Experts available now in Live!

Get 1:1 Help Now