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.
 
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.
 
Top