Solved

How to Make app invisible?

Posted on 1997-05-31
10
325 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
indy Tmemory stream non latin charcter issue 2 110
Magic Software info 18 130
Convert a string into a TDateTime 5 60
Multi-layered image in FireMonkey 9 30
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

808 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