I want to write my own global snippets tool for Windows XP and higher. This would be an always running in the background tool that would pop-up on a globally-defined hotkey, allow me to select a snippet with substitution arguments, and then paste the expanded snippet into the text input of whatever control I had been in when activated it, and finally, return me to that previous app/input box.
I know how to do most of the algorithmic aspects, but I do not know how to accomplish these windows-based features:
1 - Global Hotkey: how do I define a key-sequence in windows (from .net?) that will work, even when entering data in another apps textbox? (Usually this will be a browser window)
2 - Pasting Into Another App: I could use the paste-buffer and Ctrl-C, but I want to avoid the extra keystrokes.
3 - Return Control to Original Window: Seamlessly return back into my input stream: how do I do that? In fact, how does my tool even know where I was before it popped up?
The reasons that I want to write this myself is first to learn how (because there are other tools like this I would like to make) and secondly, I don't know of any snippets tools that have the argument substitution that I want.
So, the two (2)questions are A) What should be my general approach? and B) how best can I accomplish items 1 to 3 above?