I appreciate your help, thank you.
I have the code to read the window position and I have code to set the
position.
If I read the position and then reset the window using the same values, the
window seems to shift down and to the left. The shift down seems to be the
title bar of the window which is 94 pixels on my computer but will obviously
be different on other computers. The shift to the left seems to be about 4
pixels. The bottom of the window also moves up quit a bit.
Are the sizes returned the sizes that are need to set the window? What I am
trying to achieve is to get access window to open the size it was when it
was last closed. Since the user has other access applications and will
resize the window for them, I want the window for my application to open as
it was left.
The code I am using to resize the window is
Declare Sub SetWindowPos Lib "user32" (ByVal hWnd&, _
ByVal hWndInsertAfter&, _
ByVal X&, ByVal Y&, ByVal cX&, _
ByVal cY&, ByVal wFlags&)
------------------------
h = Application.hWndAccessApp
'Position Microsoft Access.
SetWindowPos h, HWND_TOP, WindowLeft4, WindowTop, WindowRight - WindowLeft,
WindowBottom - WindowTop , SWP_NOZORDER
where the window sizes are the values reurned by the function you gave me.
Alec