Getz and Litwin File Selector

P

Peter Hibbs

Hi All

Acess 2000/3

I am using the excellent File Selector code by Ken Getz and Paul
Litwin as shown at http://www.mvps.org/access/api/api0001.htm

Just one minor annoyance, it always opens the dialog near the top left
corner of the screen the first time it is used in an app.

Is there any way to open it in the middle of the screen.

Peter Hibbs.
 
D

Douglas J. Steele

If memory serves, it's determined by the value you pass for hwndOwner. As
configured, the code uses the hwnd of the Access application itself (hence
it's anchored in the top left corner as you've observed)

Unfortunately, I can't remember how to determine a different hwnd to use.
 
S

Storrboy

If you are calling the main function in that code (ahtCommonFileDialog or
something), then one of the arguments is - Optional ByVal hwnd As Variant
(or Long maybe). If this argument is not supplied it defaults to
HwndAccessApp. You need to supply a different value to it. If you are
calling the example or the simpler interface functions (I can't remember
what they are called), then you'll need to modify them to accept and pass on
a different hWnd value, namely the form it's called from.
 
S

Stephen Lebans

To have complete control over the Dialog window you have to supply a
callback function that is run prior to the opening of the window. There is a
sample of this for the Folder Dialog window on my site that you could adapt
for your situation.
Alternatively, open a very tiny form in the middle of your screen and uss
the hWnd of this form in your File Dialog setup.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
P

Peter Hibbs

Hi Guys

Had a look at Stephens code but could not get it to do what I want,
those API calls are a nightmare to understand. I think I will live
with it in the top left of screen for now, perhaps have another go
when I have more time.

Thanks anyway.

Peter Hibbs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top