Jump to content

Click a window's system menu (NOT by pressing Alt-Space)


Recommended Posts

I'm working on a script that runs the DOSBox MS-DOS emulator while the script remains running in the background.

DOSBox doesn't respond to the Alt-Space keystroke that normally opens the "system menu" at the upper left corner of a window. I want to set a hotkey in my script that will click on that menu when I press Alt-Space or some other key.

I know how to set a hotkey in AutoIt. What I don't know is how to make AutoIt click the system menu (NOT the File menu or any other top-line menu) of a window. If anyone knows how to do this, could you kindly let me know how it's done?

Thanks for any help.

Link to comment
Share on other sites

Hi,

Take a look at MouseMove, MouseClick functions in the help file.

Edit :

Global $aDOSBoxWndPos = WinGetPos("DOSBox ")

MouseClick("left", $aDOSBoxWndPos[0] + 5, $aDOSBoxWndPos[1] + 5, 1, 0)

Edit2 : There is maybe a winapi function or another trick to show this menu without clicking with the mouse on it.

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

The MouseClick idea is probably the best one - and thanks for spelling out the exact code. As you say in your EDIT2, I hope there's something else that can do this, because the MouseClick method relies on coordinates which may not always be where we expect.

But this certainly does what I asked - thank you again!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...