Sign in to follow this  
Followers 0
this-is-me

Cancel default input context menu

11 posts in this topic

I have been trying to cancel the default context menu on a gui, and haven't been doing so well.

I have a piece of code hastily thrown together to show what I have tried so far:

#Include <GuiConstants.au3>
$WM_CONTEXTMENU = 0x007B
$test = GuiCreate("test")
GuiCtrlCreateInput("test", 0, 0, 30, 30)
GUIRegisterMsg($WM_CONTEXTMENU, "catchcontext")
GuiSetState()
While 1
sleep(1000)
wend

Func catchcontext($hWndGUI, $MsgID)
msgbox(0,"","")
return
endfunc

As you can see when right-clicking the gui, the message is captured only from the gui itself, not on the input box. I am attempting to cancel any context menu whatsoever from the inputbox.


Who else would I be?

Share this post


Link to post
Share on other sites



Hello Everyone. Just bumping for further perusal.


Who else would I be?

Share this post


Link to post
Share on other sites

*Bump* Anyone?


Who else would I be?

Share this post


Link to post
Share on other sites

This would require subclassing the edit control so that you can catch it's messages and discard the one that triggers the menu. You can not use AutoIt to subclass a window.

Share this post


Link to post
Share on other sites

When you say subclass the edit box, doesn't GuiRegisterMsg allow subclassing for the Gui window?


Who else would I be?

Share this post


Link to post
Share on other sites

No. You have to provide your own Window procedure to subclass a window. There is no way to write a Window procedure in AutoIt. It requires the ability to use AutoIt functions as callbacks to C API functions.

Share this post


Link to post
Share on other sites

I see. Thanks anyway. I will cancel it in another way.


Who else would I be?

Share this post


Link to post
Share on other sites

Why can't the user right click the edit control?

Share this post


Link to post
Share on other sites

I don't want them to, and that's all the info you get.


Who else would I be?

Share this post


Link to post
Share on other sites

We can't help if you aren't nice. It doesn't matter if AutoIt can do it or not. We will or will not help based on you and you should know that being an experienced forum user.

Share this post


Link to post
Share on other sites

@Icekirby1, I will explain this very simply.

  • Valik has explained that this cannot be done using AutoIt.
  • I have accepted his answer and have decided to pursue another avenue.
  • If this thread had a close button I would have used it two posts ago, because the matter is resolved.
  • Your help (or anyone else's) at this time is a mute point. Neither do I need any additional help on this matter nor did I request it again.
Therefore, thank you for your offer, but any additional comments in this thread are superflous.

Who else would I be?

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