jacQues Posted February 21, 2008 Share Posted February 21, 2008 There are numerous applications that add menu items to Window's Alt+Space menu. Example: AutoIt Help > Jump to URL & About... Is this possible with AutoIt and how to do this? jacQues Link to comment Share on other sites More sharing options...
rasim Posted February 24, 2008 Share Posted February 24, 2008 There are numerous applications that add menu items to Window's Alt+Space menu. Example: AutoIt Help > Jump to URL & About... Is this possible with AutoIt and how to do this? jacQuesHi! Try this: #include <GuiConstantsEx.au3> #include <GuiMenu.au3> Global Enum $id_URL = 1000, $id_About $hGui = GUICreate("Menu test", 300, 200) $hMenu = _GUICtrlMenu_GetSystemMenu($hGui) _GUICtrlMenu_AppendMenu($hMenu, $MF_SEPARATOR, 0, 0) _GUICtrlMenu_AppendMenu($hMenu, $MF_STRING, $id_URL, "Go to address...") _GUICtrlMenu_AppendMenu($hMenu, $MF_STRING, $id_About, "About") GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUISetState() Do Until GUIGetMsg() = -3 Func WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) Local $idFrom $idFrom = BitAND($wParam, 0xFFFF) Switch $idFrom Case $id_URL ShellExecute("http://www.autoitscript.com/forum") Case $id_About MsgBox(64, "About", "Autoit v " & @AutoItVersion) EndSwitch Return $GUI_RUNDEFMSG EndFunc Link to comment Share on other sites More sharing options...
therks Posted February 24, 2008 Share Posted February 24, 2008 Variable used without being declared.: GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUIRegisterMsg(^ ERROR Need to include WindowsConstants.au3 for that variable. And just for clarification, it's not possible to use AutoIt to add menu items to other process's windows, correct? Or perhaps the menu items could be added, but they would not be functional I think. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
rasim Posted February 24, 2008 Share Posted February 24, 2008 Hi Saunders! What the version do you using? I tested this code on v3.2.10.0 and all works fine. About to add menu items to other process's... i tryed, i know this wrong, but i are hope, what somebody help me expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiMenu.au3> Global Enum $id_URL = 1000, $id_About Run("notepad.exe") WinWait("[Class:Notepad]") $hWnd = WinGetHandle("[Class:Notepad]") $hGui = GUICreate("Menu test", 300, 200, -1, -1, -1, -1, $hWnd) $hMenu = _GUICtrlMenu_GetSystemMenu($hWnd) _GUICtrlMenu_AppendMenu($hMenu, $MF_SEPARATOR, 0, 0) _GUICtrlMenu_AppendMenu($hMenu, $MF_STRING, $id_URL, "Go to address...") _GUICtrlMenu_AppendMenu($hMenu, $MF_STRING, $id_About, "About") GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUISetState() Do Until GUIGetMsg() = -3 Func WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) Local $idFrom $idFrom = BitAND($wParam, 0xFFFF) Switch $idFrom Case $id_URL ShellExecute("http://www.autoitscript.com/forum") Case $id_About MsgBox(64, "About", "Autoit v " & @AutoItVersion) EndSwitch Return $GUI_RUNDEFMSG EndFunc Link to comment Share on other sites More sharing options...
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