Jump to content
Sign in to follow this  
this-is-me

Cancel default input context menu

Recommended Posts

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.

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

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

@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.

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  

×
×
  • Create New...