WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

AskDirectory Problem

Keywords:     Start-dir AskDirectory  positioning askdirectory

Question #1:

I cannot seem to get the AskDirectory function to work as documented. If I specify a browse-root, the dialog opens at that root no matter what I specify for start-dir. If browse-root is a blank string, then the start-dir variable is utilized correctly. I am running Win95 and WinBatch 98a.

Answer:

Browse-root: Directory under which the user can browse for directories. The user will not be able to browse above this level.

If you specify a blank string for browse-root...this will allow the entire file system (all drives, directories, and network shares) to be browsed.

Start-dir: Directory which will be selected by default when the dialog box is initially displayed.

NOTE:If you give an INVALID start-dir name, the dialog will display the browse-root...

check to see if the start-dir parameter your specifying is a valid directory path....


Question #2:

I must be confused about when to use the backslash in directory paths. Specifying a backslash at the end of the browse-root path has no effect, but specifying a backslash at the end of the start-dir path seems to make that path invalid.

For example, a browse-root parameter of C:\WinBatch\ has the same effect as specifying C:\WinBatch, but a start-dir parameter of C:\WinBatch\System\ causes the dialog to open in C:\WinBatch, whereas a start-dir parameter of C:\WinBatch\System causes the desired effect of opening the dialog in the C:\WinBatch\System directory.

Answer 2:

There is a BUG in 98A where the AskDirectory does not like the trailing backslash on its directories. This bug is fixed in 98B Either remove the trailing backslash or download the 98B version./

Question #3:

Is there a way how to set the initial coordinates for an AskDirectory dialog? I want it to be opened at the center of my screen instead of the upper left corner...

Answer:

Sorry, no way to set co-ordinates. We ask Windows to display it, and Windows decides where to place it.

Question #4 (similar question on positioning):

I think these ask was already often placed but i don't find a way. how it is possible to define the position of the askdirectory-box. And of all other ask... box?

Answer:

Most of the ASK boxes come up in the "Default" position, which is usually the center of the screen.

The AskDirectory and AskFileName seem to have their own idea where to come up.

AskFileName attempts to center itself on the application. But since WinBatch is usually and icon, it open up near the icon.

AskDirectory seems, for some bizzare reason, to prefer the middle upper left ofthe screen.

The only one you can affect is AskFilename, possibly by doing a

BoxOpen("Hi","There") 
before the AskFileName will open WinBatch in the middle of the screen, then AskFilename will try and center itself on that.

Otherwise...If you make your on Dialog boxes with the dialog editor, you have some control over where it opens, especially if you prefer the upper left of the screen.


Article ID:   W13039
Filename:   AskDirectory problem.txt
File Created: 2002:03:07:15:36:18
Last Updated: 2002:03:07:15:36:18