Notice I activate notepad before sending the keystrokes to copy or paste. Window menu does not steal focus from the program you right click on.
Does anyone know how to add in a proper copy and paste to a context menu?
Thanks in advance!
Vh_
Code: Select all
#SingleInstance,Force
TrayTip, Context Menu, Script is Active., 5, 1
Menu, Tray, Add, Copy
Menu, Tray, Add, Paste
Menu, Tray, NoStandard ;removes default options
Menu, Tray, Add, ;creates a seperator
Menu, Tray, Add, Exit
return
#IfWinActive, Untitled - Notepad
RButton::
Menu, Tray, Show ; right mouse and windows
return
Copy:
WinActivate, Untitled - Notepad
Send, {AppsKey}c
Return
Paste:
WinActivate, Untitled - Notepad
;ControlFocus, %WhatField%, MyProgram
Send, {AppsKey}p
Return
Exit:
ExitApp