473,806 Members | 2,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

assign local application hotkeys

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 UnregisterHotKe y 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
Aug 21 '07 #1
2 2433
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
ja***@removethi s.dystopia.fi
http://www.saunalahti.fi/janij/
Aug 21 '07 #2
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

"Jani Järvinen [MVP]" wrote:
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
ja***@removethi s.dystopia.fi
http://www.saunalahti.fi/janij/
Aug 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
316
by: skumar | last post by:
I need to access the Tabpages by hotkeys "alt+P" in case of "Principals" as one of the Tabpage. Also i need to underline the word "P" in "Principals" so that user is informed about the hotkey.If i use "&" in front of the word "P",it is not underlining the word.It just stays "&" itself. I know we can add this hotkeys to toolbars,buttons and lots of other controls.
2
11132
by: Hasan Ammar | last post by:
Is it possible to set up hotkeys using onkeypress? I know it can be done with the usual alphanumeric keys, but what about function keys? or using ctrl/alt combinations? Does anybody have a tutorial/guide?
1
2313
by: Matthew Wells | last post by:
How do you prevent someone from using Ctrl+, (ctl + comma) or Ctl + . (Ctl + perios) to get to design view. I have all the normal properites turned off (Access special keys, F!!, etc) but nothing seems to stop that one. I tired using AutoKeys to remap it, but I keep getting "Invalid Syntax" or "Invalid keystroke combination". Most of these new hotkeys are really for developers and we should be able to stop end users from using them. I...
3
2861
by: Matthew Wells | last post by:
I'm reposting because an idiot replied without reading the whole message. I've tried autokeys and it isn't working for this combination. Please read on. While in form view, how do you prevent someone from using Ctrl+, (ctl + comma) or Ctl + . (Ctl +period) to get to design view. I have all the normal properites turned off (Access special keys, F11, etc) but nothing seems to stop that one. I tried using AutoKeys to remap it, but I...
2
2098
by: Martin Hjärtmyr | last post by:
I have a program that uses Hotkeys! And they works just fine! I use this hotkeylib: http://www.vbaccelerator.com/home/NET/Code/Libraries/Windows_Messages/Hot_Key_Form/HotKeyForm_zip_HotKeyForm_HotKeyForm_HotKeyFormLib_cs.asp But my hotkeys suddenly stops working when i use this: ShowInTaskbar = false;
3
3744
by: Bernd Eichelsdorf | last post by:
Hi, I would like to add hotkeys to my webapp - it's running on a barcode scanner, that has got a number pad and the keys F1 - F4. I would like to add hotkeys, so that when the user presses F1, the focus is set on form field 1 and so on... Is that possible with javascript, if so, how?
4
6135
by: Octavius Khan | last post by:
I have an application that runs in the system tray and I use global hotkeys to perform functions. When certain hotkeys are pressed, my system tray application may display a message box and sometimes a balloontip, but then focus is taken away from the application the user is using when this happens. How can I return focus to the original application? For example, let's say the user is using Notepad and then presses Ctrl-F9. This causes...
4
3732
by: =?Utf-8?B?QWxleGFuZGVy?= | last post by:
Hi! I am new to C#. I read two C# books in the last two days which only covered the basics. And now I am on my third day. The books were really bad, because they did not cover windows applications, only ten to twenty pages how to create forms. So now you know why I want to have hotkeys in a CONSOLE Application. Is this possible? I would be glad if you could give me some links in the msdn or just the names of the functions needed. If...
0
10624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.