; Context Menu $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() ; Context Menu End ---------------------------------------------------------------------------- GUIRegisterMsg($WM_COMMAND, "ON_WINDOW_EDIT_COMMAND") GUIRegisterMsg($WM_NOTIFY, "ON_WINDOW_EDIT_NOTIFY") Func ON_WINDOW_EDIT_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iCode #forceref $hWnd, $iMsg $iCode = _WinAPI_HiWord($wParam) Switch $lParam Case $hGlo_WE_Control Switch $iCode Case $EN_CHANGE _GUICtrlRichEdit_SetModified($hGlo_WE_Control, True) Return 0 EndSwitch EndSwitch Switch $wParam Case 0 Send( "^z" ) Return 0 ;------------------------------; 1 Case 2 Send("^x") Return 0 Case 3 Send("^c") Return 0 Case 4 Send("^v") Return 0 Case 5 Send("{Del}") Return 0 ;------------------------------; 6 Case 7 Send("^a") Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>ON_WINDOW_EDIT_COMMAND Func ON_WINDOW_EDIT_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $hWndFrom, $iCode, $tMsgFilter, $tNMHDR #forceref $hWnd, $iMsg, $wParam $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hGlo_WE_Control Switch $iCode Case $EN_SELCHANGE _GUICtrlRichEdit_SetModified($hGlo_WE_Control, True) Return 0 Case $EN_MSGFILTER $tMsgFilter = DllStructCreate($tagMSGFILTER, $lParam) If DllStructGetData($tMsgFilter, "msg") = $WM_LBUTTONDBLCLK Then _GUICtrlRichEdit_SetModified($hGlo_WE_Control, True) Return 0 EndIf If DllStructGetData($tMsgFilter, "msg") = $WM_RBUTTONUP Then _GUICtrlMenu_TrackPopupMenu($hGlo_WE_GUI_Context, $hWnd) Return 0 EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>ON_WINDOW_EDIT_NOTIFY