WindowEditContext() $wGlo_ProcHandle = DllCallbackRegister("ON_WINDOW_EDIT_CONTEXT", "ptr", "hwnd;uint;wparam;lparam") $wGlo_ProcOld = _WinAPI_SetWindowLong($hGlo_WE_Control, $GWL_WNDPROC, DllCallbackGetPtr($wGlo_ProcHandle)) Func WindowEditContext() $hGlo_WE_GUI_Context = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "Undo", 0) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "", 1) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "Cut", 2) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "Copy", 3) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "Paste", 4) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "Delete", 5) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "", 6) _GUICtrlMenu_AddMenuItem($hGlo_WE_GUI_Context, "Select All", 7) GUISetState() EndFunc ;==>WindowEditContext Func ON_WINDOW_EDIT_CONTEXT($hWnd, $Msg, $wParam, $lParam) Local $aReturn #forceref $Msg, $lParam Switch $hWnd Case $hGlo_WE_Control Switch $Msg Case $WM_RBUTTONUP _GUICtrlMenu_TrackPopupMenu($hGlo_WE_GUI_Context, $hWnd) Return 0 Case $WM_COMMAND Switch $wParam Case 0 Send( "^z" ) ;------------------------------; 1 Case 2 Send("^x") Case 3 Send("^c") Case 4 Send("^v") Case 5 Send("{Del}") ;------------------------------; 6 Case 7 Send("^a") EndSwitch EndSwitch EndSwitch $aReturn = DllCall("user32.dll", "int", "CallWindowProc", "ptr", $wGlo_ProcOld, "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam) Return $aReturn[0] EndFunc ;==>ON_WINDOW_EDIT_CONTEXT