Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi everybody
I want to write an app to translate character between two language(decoder), so I need a TSR app that run behind of windows and by pressing some special keys(ctrl+shift+N),the app get the text and translate it to desired language and leave the decoded text into clipboard.
I write this APP in windows form but i don't know how to change it to TSR.
let me to explain more how my app working:

in fact i want my app work like this:
i have tow writing language in my windows(EN, FA), sometimes I forget to change my writing language and i type some words for example in Office Word, and suddenly i came to know that i didn't change my writing language,
so I want to select my written text and copy it to clipboard and press a combination key to load my app and decode the copied text to correct language and copy it again to clipboard and then my app be hide. and then i can past it into Office word.
this was exactly that i want to do,
anyone can help me to do it?
thanks in advanced
Posted
Updated 20-Oct-14 8:59am
v2
Comments
Sergey Alexandrovich Kryukov 20-Oct-14 12:35pm    
If you mean "Terminate and Stay Resident", as your description and the acronym suggest, this notion has nothing to do with Windows. TSR has become historical.
—SA
PIEBALDconsult 20-Oct-14 13:37pm    
Perhaps you want it to be in the System Tray?
nashalj 20-Oct-14 13:57pm    
it can be like your mean
any help?
nashalj 20-Oct-14 13:41pm    
yes my mean is Terminate and Stay Resident", and i know that it is historical, but I need it, if you know about that, please help ,
thanks

Please see my comment to the question. There is no such thing as TSR in Windows, or any other OS which can carry CLR.

Your description suggests that you merely need a global hot key. Then this CodeProject article will help you: Setting A Global Hot Key[^].

Good luck.
—SA
 
Share this answer
 
Wikipedia:
TSR is unique to DOS and not used in Windows.

You talk of C#, so you are on .NET, so you are (probably) on Windows - why not learn about services...and keyboard hook...
http://msdn.microsoft.com/en-us/library/aa984464(v=vs.71).aspx[^]
Processing Global Mouse and Keyboard Hooks in C#[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Oct-14 12:44pm    
You see, using global hooks for such things would be a huge overkill. A global hook needs to be installed in a separate native assembly; hook code is very hard to debug.
At the same time, Windows provides much simpler specialized solution: global hot keys. Please see my answer.
—SA
Kornfeld Eliyahu Peter 20-Oct-14 12:51pm    
I'm not an expert on hooks and global hot keys so don't kill me please :-)... I understood that OP need to catch all the key-strokes so hook sound to me proper...But most important was to tell OP that TSR is not an option...
Sergey Alexandrovich Kryukov 20-Oct-14 13:46pm    
Right, it can be solved this way. But if some simple and reliable solution exists (the one I described in my answer), using anything so difficult as global hooks would be at least pointless. I worked enough with global hooks, believe me, it's much, much harder, especially for debugging. And the use of global hot keys is quite trivial.
—SA
Kornfeld Eliyahu Peter 20-Oct-14 13:53pm    
I believe you totally :-) That's why I gave you a 5!
Sergey Alexandrovich Kryukov 20-Oct-14 14:10pm    
Oh, thank you very much.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900