Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to hide window define as top level form

Posted on 2011-10-11
6
Medium Priority
?
1,013 Views
Last Modified: 2012-08-14
Hi,
I have small app in VFP. I wan't to hide the main window(first form) aftre running and put icon in the system tray. I'm using FoxTray.ocx to achive system tray icon. My main form is set to:
-desktop = .F.
-showWindow = 0
-WindowType = 0

In activate method of the form i have: "HIDE WINDOW SCREEN"

This working quite well. But when I activate the main form the MainVFP Window show.
What i try to do is to show only the form(without VFPMainScreen) when i click trayIcon and hide it when i click my own "hide" button.

When I use showWindow=2 top-level I can hide main VFP screen but can't hide this top-level form.

0
Comment
Question by:dan_leniwiec
  • 3
  • 3
6 Comments
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 36948654
If you wish to hide it after execution then use this:
_SCREEN.Visible = .F.

If you wish to hide it before launching the application, I suggest to create a config.fpw file in the same folder as the executable and in it put:
SCREEN=OFF
0
 

Author Comment

by:dan_leniwiec
ID: 36948688
ok,
but that wan't hide top-level form...
0
 

Author Comment

by:dan_leniwiec
ID: 36948755
I find the solution. Mayby not the best but working ;)

I set my main program form called "MainForm", ShowWindow = 2 as-top-level-form.
At the beggining I set _screen.visible = .F.
And after invoking the form, but before read events I do "HIDE WINDOW ALL" (here should be something like 'HIDE WINDOW 'MainForm'')
When i want to show the form I invoke "SHOW WINDOW ALL" and HIDE WINDOW SCREEN.

Still don't know how to use properly - HIDE WINDOW 'MainForm'...someone know ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 27

Expert Comment

by:CaptainCyril
ID: 36948840
SHOW and HIDE WINDOW are for older versions of FoxPro.

You should be using Form.Visible = .F. or .T.
_SCREEN.Visible = .F.
Application.Visible = .F.
0
 

Author Comment

by:dan_leniwiec
ID: 36948940
None of them work with my app.
Only _screen.visible

Could you please tell me where i should put these  lines ?
0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 1000 total points
ID: 36949031
SCREEN=OFF you put it in a config.fpw file. You create this file using this
MODIFY FILE c:\path\config.fpw

You also put this file in the project when you build the application.

This will prevent the Main FoxPro window (_SCREEN) from showing when you click on the icon of the software.

When you wish to activate a screen, the click or double click event of the tray icon should have Visible = .T. or Form.Show.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans

564 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