Skip to content

Return true if button was clicked #1312

Answered by junkmd
johnyCZS asked this question in Q&A
Discussion options

You must be logged in to vote

After some testing I wasn't able to make methods you suggested work, mainly due to error: "menuItem doesn't have method".

Indeed, since MenuWrapper is not a subclass of UIAWrapper, I couldn't use methods like invoke or wait_enabled. I'm sorry.

The final solution which I implemented and it seems to work is printing .rectangle() of the menu item, this works. Then before and right after .click_input() I print coords of the mousecursor with win32api.GetCursorPos() and I compare them with coords provided by .rectangle().

If MenuItem can be retrieved, I think it indicates that the GUI is not frozen.
In that situation, you're right that click_input() moves the mouse pointer, so by capturing …

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
4 replies
@johnyCZS
Comment options

@junkmd
Comment options

@johnyCZS
Comment options

@junkmd
Comment options

Comment options

You must be logged in to vote
8 replies
@johnyCZS
Comment options

@junkmd
Comment options

@johnyCZS
Comment options

@junkmd
Comment options

Answer selected by johnyCZS
@johnyCZS
Comment options

@junkmd
Comment options

@johnyCZS
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants