Solved

Select a monitor with my Application

Posted on 2013-02-05
6
279 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Call Controller Action Method from ASPX 2 22
VB.NET 2008 Winforms Signing 13 32
MYSQL responding very slow 3 24
Why use this lambda? 12 37
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 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