Jump to content

context popup in 3rd party gui


ziggery
 Share

Recommended Posts

Hi, im tryin to create a popup context menu when SPACE is pressed in some 3rd party application.The menu is created but doesnt show up. Hope u can help me:

#include "WinAPI.au3"
#include "GuiMenu.au3"
#include "GUIConstantsEx.au3"
#include "WindowsConstants.au3"
#include"Constants.au3"


HotKeySet('{ESC}', '_EXIT')
HotKeySet('{SPACE}',"Mach")
$NOTEPID=Run("NOTEPAD.exe")
WinWait("[CLASS:NOTEPAD]")


While 1
sleep(100)
WEnd


Func _EXIT()
Exit
EndFunc


Func OnAutoItExit()
ProcessClose($NOTEPID)
EndFunc

func mach()
;WinKill("[CLASS:#32768]")
local $h2Wnd=WinGetHandle("[CLASS:NOTEPAD]")
Local $hMenu

$hMenu = _GUICtrlMenu_CreatePopup()
ConsoleWrite($hMenu)
_GUICtrlMenu_InsertMenuItem($hMenu, 0, "TEST", 1000)
_GUICtrlMenu_TrackPopupMenu($hMenu, $h2Wnd,500,500)
;_GUICtrlMenu_DestroyMenu($hMenu)

EndFunc
Edited by ziggery
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...