Solved

Select a monitor with my Application

Posted on 2013-02-05
6
290 Views
Last Modified: 2013-02-07
Hello Experts,
I have a desktop with two monitors and I need my app to open its windows on a pre selected monitor. HOw can I do this ?
Regards,
0
Comment
Question by:rguillermo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Nicolus
ID: 38858038
Open the App's window... Move it to the monitor you want to use... close the app on that monitor and Windows remembers that opening.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 38859038
As Nicolus says. This is a job for Windows and/or the device driver to remember.

If you want to override this, look out for _VFP.Left and _VFP.Top. In a two monitor setup with a left and right monitor you will have _VFP.Left at about 0, if it's in the left screen and about half the desktop screen resolution, for the right screen. I'd not recommend that, though. Any application can be maximised on any screen and next time you start it it will be the same. I remember this was a bit problematic in XP without a proper device driver configured to remember windows positions and states, but I think since Vista and at least Win7 I've never seen this fail.

Bye, Olaf.
0
 
LVL 4

Expert Comment

by:Nicolus
ID: 38861538
Olaf,

Thank you for adding an important factor which I missed in my original posting...


Open the App's window... Move it to the monitor you want to use...  MAXIMIZE THE WINDOW, then close the app on that monitor and Windows will remember which monitor to open the app in.

But you have to maximize it after it has been moved to the desired monitor before closing it.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:rguillermo
ID: 38865511
And if I want to have a button to choose where to open the next window?
Can I select in which screen the the next window will open from my own app ?
Thanks
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 38865608
Internal in fox applications the Foxuser.DBF will store windows positions. So unless you suppress foxuser.dbf creation and don't set forms left/top or autocenter, that's automatic, too. In the firs place a form will show at the Left/Top position you set in the form designer.

The help topic "resource files in applications says this about the foxuser.dbf:
Visual FoxPro resource files store useful information for your application, including window positions, Browse window configurations, and label definitions. If your application relies on specific settings for any of these resource items, you must also distribute the FoxUser database and memo files or the resource files you create specifically for your application. These resource files consist of a Visual FoxPro table with an associated memo file, usually named FoxUser.dbf and FoxUser.fpt.
If that doesn't work for you, set Left and Top at Init and store it somewhere in destroy or in release. You have a database language, just use it to store these two ints somewhere. You're free to do anything you want, and if you want to store windows positions, feel free to do so.

Bye, Olaf.
0
 

Author Closing Comment

by:rguillermo
ID: 38865773
Thank you very much !!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS question 16 59
Whice version VisualStudio for new Dev Laptop? 10 33
How do I "share" on social sites? 2 32
Datagridview column resizing 8 22
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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