ziggery Posted August 10, 2012 Posted August 10, 2012 (edited) 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: expandcollapse popup#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 August 10, 2012 by ziggery
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now