assign local application hotkeys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I need ot set hotkeys to my windows application. I want when Word is thea
active application and when user press "Ctrl+Alt+T" for example to start my
action.
I used RegisterHotKey and UnregisterHotKey methods and ovverride WndProc
but even when user works with another program different than MS Word and
press the shortcut key my action is done.
Thanks
 
Hi Ivo,
I need ot set hotkeys to my windows application. I want when Word is thea
active application and when user press "Ctrl+Alt+T" for example to start
my
action.

Ctrl+Alt+T is a shortcut key in Word 2003 at least, I'd assume in other
recent versions as well. When in Word and when pressing the keyboard
shortcut, what happens? Does anything happen in Word?

Secondly, are you checking the return value of RegisterHotKey? Is it true?

And thirdly, what if you create a shortcut to your C# application (for
example on the desktop) and then on the properties of the shortcut specify
Ctrl+Alt+T as the shortcut key, and then in Word press Ctrl+Alt+T, does you
application start?

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
Yes Ctrl+Alt+T is a shortcut key in Word but after register it with
RegisterHotKey method my function (this bound to shortcut key) is executing
no mater which is the active window. And RegisterHotKey returns true.
Acording to thirdly i can't find how to specify shortcut key to shortcut icon
on the desktop. The point is that I don't want my application to be started
with shortcut but when it is started and when MS Word is active window to
have my sshortcut keys working. My application is Shered add-in and starts
when word starts.

Thenks
 
Back
Top