[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

Select a monitor with my Application

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
RGuillermo
Asked:
RGuillermo
  • 2
  • 2
  • 2
1 Solution
 
NicolusCommented:
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
 
Olaf DoschkeSoftware DeveloperCommented:
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
 
NicolusCommented:
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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
RGuillermoProject ManagerAuthor Commented:
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
 
Olaf DoschkeSoftware DeveloperCommented:
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
 
RGuillermoProject ManagerAuthor Commented:
Thank you very much !!
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now