Вопрос в названии темы
Код:
#include <GuiMenu.au3>
Global $idExit, $idCut, $idCopy, $idPaste
Run("Notepad.exe")
WinWaitActive("[CLASS:Notepad]")
If WinExists("[CLASS:Notepad]") Then
$handle = WinGetHandle("[CLASS:Notepad]")
; Create Edit menu
$hEdit = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hEdit, 0, "&Cut", $idCut)
_GUICtrlMenu_InsertMenuItem ($hEdit, 1, "C&opy", $idCopy)
_GUICtrlMenu_InsertMenuItem ($hEdit, 2, "&Paste", $idPaste)
_GUICtrlMenu_InsertMenuItem ($hEdit, 3, "", 0)
_GUICtrlMenu_InsertMenuItem ($hEdit, 4, "E&xit", $idExit)
; Get Main menu
$hMain = _GUICtrlMenu_GetMenu($handle)
$ItemCount = _GUICtrlMenu_GetItemCount($hMain)
_GUICtrlMenu_InsertMenuItem ($hMain, $ItemCount, "&Insert", 0, $hEdit)
; Set window menu
_GUICtrlMenu_SetMenu ($handle, $hMain)
While WinExists($handle)
Sleep(10)
WEnd
EndIf