PantZ4 Posted August 31, 2007 Share Posted August 31, 2007 So I was wondering if I could change the context menu when you click on the title line. This context menu; Just so I could add my own command. Is this possible? Link to comment Share on other sites More sharing options...
Zedna Posted August 31, 2007 Share Posted August 31, 2007 In your AutoIt GUI or external application? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
PantZ4 Posted August 31, 2007 Author Share Posted August 31, 2007 external? If you mean in every program window, then yes. That is what I'm trying to achieve. Link to comment Share on other sites More sharing options...
Zedna Posted August 31, 2007 Share Posted August 31, 2007 For modifying system menu are these API functions:GetSystemMenu, InsertMenuBut for modiy external app look at ANYGUI UDFHere is modification system menu in AutoIt GUI:expandcollapse popup#include <GUIConstants.au3> Global Const $WM_SYSCOMMAND = 0x0112 Global Const $MF_BYPOSITION = 0x0400 Global Const $MF_SEPARATOR = 0x0800 $Form1 = GUICreate("Test", 300, 200) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") CreateSystemMenuItem("") $nItem_about = CreateSystemMenuItem("About") While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) $nID = BitAnd($wParam, 0xFFFF) If $nID = $nItem_about Then About() EndFunc Func About() MsgBox(64, "About","Test 1.0" & @CRLF & @CRLF & _ "Zedna" & @CRLF & _ "AutoIt") EndFunc Func GetSystemMenu($hWnd, $bRevert = 0) Local $hMenu = DllCall("user32.dll", "hwnd", "GetSystemMenu", _ "hwnd", $hWnd, _ "int", $bRevert) Return $hMenu[0] EndFunc Func InsertMenu($hMenu, $nPosition, $nFlags, $nIDNewItem, $lpNewItem) Local $nResult = DllCall("user32.dll", "int", "InsertMenu", _ "hwnd", $hMenu, _ "int", $nPosition, _ "int", $nFlags, _ "int", $nIDNewItem, _ "str", $lpNewItem) Return $nResult[0] EndFunc Func CreateSystemMenuItem($sText, $hMenu = -1) If $hMenu = -1 Then $hMenu = GetSystemMenu($Form1) Local $nID = GUICtrlCreateDummy() Local $nFlags = 0 If $sText = "" Then $nFlags = $MF_SEPARATOR $nFlags = BitOr($MF_BYPOSITION, $nFlags) InsertMenu($hMenu, 0xFFFFFFFF, $nFlags, $nID, $sText) Return $nID EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
PantZ4 Posted August 31, 2007 Author Share Posted August 31, 2007 Ah I will take a look and come back if there is something I don't understand . Thanks once again . 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