Capture Windows App Main Window Resize Event

katie999
katie999 used Ask the Experts™
on
I need to move a form around based on when/if a user has resized the main Access 2007 application window. Any help would be appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
sorry, mirsread the question - thought you wanted to tap the main form event.

Apparently:
"Access does expose an Application object, but that object does not expose
any events, only methods and properties."
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
This is not simple to do and what you have to do is not within Access.

You'd need to hook the message queue to the main access window in the OS, then determine when it moved by reading the window messages.

Jim.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
Peter's Window Manipulation Examples  might get you started in the right direction. I've used this code several times in several apps for various things.

Examples of how to maximize, restore, size, hide, cascade, and animate (and more!) the main Microsoft Access window as well as your active form window.

mx

Author

Commented:
Thanks to prodigy - that is what I'm facing. However, I just realized that even if I access one of the various lib32 functions (e.g. windows size/position changed) I am still faced with the problem of moving the form in real time while it is being displayed. I have no problem positioning the form after the window is changed and before the form is opened, but using the form OnTimer afterwards is problematic. What I want to do may not be possible given the limited event management options in Access ...
President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
We (the community) have been after Microsoft for years to give us more control of  the main Access window through the Screen object, but it's never happened :(

The main problem you have is figuring out when the main window resizes.  After that, there are a number of things you can do to resize the forms, but it starts with figuring out when the main form resizes.

Jim.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial