Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dual Monitor Problem under 64bit

Status
Not open for further replies.

SimplyES

Programmer
Oct 5, 2012
39
0
0
GB
I have just reinstalled my OpSys to 64bit followed by VFP9 with SP2. I have 2 monitors (extended desktop). I have been running VFP on this machine (with the two monitors) for years but only had this problem since going 64bit.
On launching VFP the main screen is too big to fit on one monitor but doesn't appear on the extended desktop (monitor 2). The right side of the screen just disappears off into the ether, along with the control buttons. I can't open anything with VFP when its like this - it just doesn't do anything. I have wondered whether what ever it is doing is off to the right with Peter Pan, or perhaps screen calibration is screwed while the screen is like this and what I'm clicking isn't where it appears to be.

If I double click the title bar to minimize and then click the taskbar icon, it will maximize properly. Bit of a fiddle, but works. I use a startup prg for the development environment for each project and I have tried adding _screen.WindowState = 0 followed by _screen.WindowState = 2. That just doesn't work -- like it only sees one of the two code lines!

Now a new problem has developed. Launching VFP leaves me with the icon on the taskbar and Command, Properties and Data Session windows showing on screen pretty much where I expect them to be. The main screen is not visible. Clicking the taskbar icon does SOMETHING, but I don't know what since nothing visible changes except that something nips across the screen (presumably Tinkerbell!). If I right-click the taskbar icon I do not see Max/Min/Move/Size etc. If I do get to [Max] screen I can work, but I can't change the size of my work area since [Restore] minimizes the screen. Or perhaps [Restore] is sending it off to Neverland.

Apart from the frustration this is causing, I am concerned that something like this might find its way into the finished applications!

By the way, I get none of this on my laptop (64bit W7), even with a 2nd monitor attached.

What have I done!!!
 
I said "If I double click the title bar to minimize and then click the taskbar icon, it will maximize properly." Actually, it doesn't work. Once minimized, clicking the taskbar icon does not bring it back maximized.
 
Well, the obvious thing to investigate first is whether the problem is specific to VFP. Have you tried running other apps across the two monitors? What is the result?

If you have the same, or similar, problems with other apps, then it is not a VFP issue, and you would do better to post a question in a more appropriate forum. That said, there are a few obvious things to check, starting with the video driver. Is it up to date and correct for your 64-bit system? Also, check the advanced properties in the display property sheet. It might be worth experimenting with a lower colour resolution, a lower refresh rate, and different screen resolutions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike. No other apps do this. I have checked drivers are up to date. When it started, it did affect my VFP applications (EXEs) just on my PC. Adding _screen.WindowState = 0 followed by _screen.WindowState = 2 in the controlling PRG DID work there.
I have another app which was developed in VFP (not by me ... Abmis from Accvision) and this behaves as it should. I might try your suggestion, though, and pop the query onto a different forum.
 
You can do a search here for GetSystemMetrics API, using some of those values could help you correct this. If your problem is what I faced, where I put my VFP app on a secondary monitor at work and it was out of desktop screen range on my one monitor at home, you can use the data retrieved here to be have the app on startup to verify and reset any invalid screen positions. I've noticed that many professional apps do check to verify the whether the app is not visible off screen or oversized.
Code:
#DEFINE SM_CYFULLSCREEN 17
#DEFINE SM_XVIRTUALSCREEN 76
#DEFINE SM_YVIRTUALSCREEN 77
#DEFINE SM_CXVIRTUALSCREEN 78
#DEFINE SM_CYVIRTUALSCREEN 79
#DEFINE SM_CMONITORS 80

DECLARE INTEGER GetSystemMetrics IN user32 INTEGER nIndex

loMonitor = CREATEOBJECT("EMPTY")
ADDProperty( loMonitor,"Monitors",GetSystemMetrics(SM_CMONITORS) )
ADDPROPERTY( loMonitor,"VirtualLeft",GetSystemMetrics(SM_XVIRTUALSCREEN) )
ADDPROPERTY( loMonitor,"VirtualTop",GetSystemMetrics(SM_YVIRTUALSCREEN) )
ADDPROPERTY( loMonitor,"VirtualWidth",GetSystemMetrics(SM_CXVIRTUALSCREEN) )
ADDPROPERTY( loMonitor,"VirtualHeight",GetSystemMetrics(SM_CYVIRTUALSCREEN) )
ADDPROPERTY( loMonitor,"DesktopScreenHeight",GetSystemMetrics(SM_CYFULLSCREEN) )
ADDPROPERTY( loMonitor,"DesktopScreenWidth",GetSystemMetrics(SM_CXFULLSCREEN) )
ADDPROPERTY( loMonitor,"ScreenHeight",GetSystemMetrics(SM_CYSCREEN) )
ADDPROPERTY( loMonitor,"ScreenWidth",GetSystemMetrics(SM_CXSCREEN) )

RETURN loMonitor
ENDFUNC
 
That looks hopeful. I'll spend some time with that and see how I get on. Thanks dbMark.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top