Solved

How to Make app invisible?

Posted on 1997-05-31
10
324 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
 
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
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.

 

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

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

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

27 Experts available now in Live!

Get 1:1 Help Now