Solved

Select a monitor with my Application

Posted on 2013-02-05
6
249 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:rguillermo
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you very much !!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
crm development 2 34
Code enhancement 5 12
Code works but how can I download the file? 20 44
What .NET website keeps me current? 9 28
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

11 Experts available now in Live!

Get 1:1 Help Now