I've been reading about ApplicationCommands (specifically Paste) here and I have a question regarding the following paragraph:
A MenuItem is created and it's Command property is set to the Paste command. The CommandTarget is not explicitly set to the TextBox object. When the CommandTarget is not set, the target for the command is the element which has keyboard focus. If the element which has keyboard focus does not support the Paste command or cannot currently execute the paste command (the clipboard is empty, for example) then the MenuItem would be grayed out.
I understand in general what the sentence in bold means, and how it applies to the application I'd be creating myself. However, is it possible that the target for the command be an element (that has keyboard focus etc.) in a different application?
The specific thing I'm thinking of here is a background process that listens for an event (I'm thinking a HotKey or similar) and then pastes text into whatever currently has keyboard focus. For now it would just be the same text every time, so I wouldn't need to paste something specific to whatever happens to have focus (if such a thing is even possible).
I haven't started on anything yet, it was just an idea I came up with and am interested in investigating.
Thanks for any help!