Sign in to follow this  
Followers 0
ako673de

How can I access the menu and all controls of the window of a foreign application

5 posts in this topic

I want to disable the menu bar and all controls of the window of an external application. Afterwards I want to re-enable a few really needed ones.

Is there a simple way to get a list of all controls of a window (similar to FileFindFirst()/FileFindNext()) so I can simply loop through all controls and disable them?

Is there any way to control the menu bar of an external application, like hiding/disabling it completely or disabling only selected menu entries?

Currently my only idea is to disable the whole window and build a GUI for the needed controls that exactly overlays the external window, and let it forward user inputs to the controls of the disabled window. But to me this approach seems to be a little bit too inconvenient.

Any ideas, preferrably of low programming effort and as general as possible?

Share this post


Link to post
Share on other sites

same problem here.

Any ideas?

Zoli

Share this post


Link to post
Share on other sites

Look at Auto3Library and its A3LMenu.au3 with lots menu functions.

Thanks, that is quite a good start! It solves every issue related with the menu bar.

But I couldn't find a function in that toolbox, that retrieves a list of all controls in a window. Do you have a solution for that, too?

Share this post


Link to post
Share on other sites

But I couldn't find a function in that toolbox, that retrieves a list of all controls in a window. Do you have a solution for that, too?

Not directly, but you can get all the control classes used with WinGetClassList() and then increment through the ClassNameNN's.

For example take the class name Edit and loop ControlGetPos() on the sequence Edit1, Edit2, etc. until you get an error for non-existent control.

There are several examples of this already posted on the forum.

<_<


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0