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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open dialog opens offscreen? 1

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
Hey there folks--

I'm running the following code (in VFP8 SP1):

Code:
IF llInvalidCLP
     tcIniFile = GETFILE("INI","Please specify an INI file...","Open",1)
     tcIniFile = JUSTFNAME(tcIniFile)
     IF EMPTY(tcIniFile)
          ERROR ERR_MISSINGINI
     ENDIF
ENDIF

And everytime the Open dialog box appears, it's off-screen to the bottom-right and the only way to get it back on screen is to right-click the taskbar button, click Move and arrow it back to the visible area.

I've compiled and run the exe on multiples machines (two XPPro, one Server 2003) with the same result. I thought it may have been because of my dual-monitor setup, but the same happens on both dual- and single-monitor setups. I'm using RESOURCES=OFF in config.fpw and have deleted all FOXUSER.* files.

Is the position of the Open dialog saved anywhere? What could be causing this? Thoughts?

thanks
-- frank~
 
I created a form, put a button on it and the command "getfile()" in the click event of button. When ran I cannot get the results you are getting. The getfile always goes to the middle of screen and is on top of the form. Are you calling this from a form and if so what are the non default properties of the form? You could do a work around by getting the handle of the window but this would be bad coding.

Regards,

Rob
 
Thanks for the reply..

There's no form - this is in a prg. I've tried recreating the exe after deleting all foxuser files from my hd, and with the VFP window maximized in the primary monitor (otherwise, the Screen.Left is some negative value), but still no difference. This only happens in the exe; running the same code from the IDE brings up the Open dialog in the center of the screen.

I'm really at a loss here.

--frank~
 
PS.- I've also tried removing all arguments from the GetFile() with the same results. Oddly enough, though, with GetDir(*no arguments), the dialog box comes up vertically centered, but halfway off the right-edge of the screen (so only half is visible). But when I run the following:

Code:
GETDIR(lcHomeDir,"Select the Distribution Directory...","Select Distribution Directory...",65)

the dialog box comes up correctly, centered vertically and horizontally. So I tried specifying a bunch of different combinations of arguments in the GetFile(), with the same result -- always off the screen to the lower-right.

I have no clue! [ponder]
 
Same thing happened with version 5 as well.
You can circumvent it by creating a small form, calling getfile() and then immediately closing the form. It may sound lame but it works.
 
The form should have .ShowWindow set to 2

Code:
do form form1 name aForm1 linked 
aForm1.Move(_screen.width/2, _screen.height/2)
a1= GETFILE("INI","Please specify an INI file...","Open",1)
release "aForm1"
 
That's an odd little fix, but I guess if it works.

Is this really a bug in VFP8 SP1?

Just curious. Thanks for the solution.

-- frank~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top