Questions tagged [registerhotkey]
83 questions
122
votes
8 answers
Find out what process registered a global hotkey? (Windows API)
As far as I've been able to find out, Windows doesn't offer an API function to tell what application has registered a global hotkey (via RegisterHotkey). I can only find out that a hotkey is registered if RegisterHotkey returns false, but not who…
![](../../users/profiles/9226.webp)
Marek Jedliński
- 6,528
- 9
- 44
- 55
16
votes
4 answers
Change Keyboard Layout for Other Process
I'm writing a program in C# that runs in the background and allows users to use a hotkey to switch keyboard layouts in the active window. (Windows only supports CTRL+SHIFT and ALT+SHIFT)
I'm using RegisterHotKey to catch the hotkey, and it's…
![](../../users/profiles/34397.webp)
SLaks
- 800,742
- 167
- 1,811
- 1,896
15
votes
4 answers
Global hotkey with WIN32 API?
I've been able to set local hotkeys like this
RegisterHotKey(hwndDlg, 100, MOD_ALT | MOD_CONTROL, 'S');
How can I set the hotkey to be global? I want it to be there even when my window is hidden.
![](../../users/profiles/219554.webp)
Mars
- 3,842
- 10
- 37
- 59
10
votes
1 answer
Detecting Ctrl+V with RegisterHotKey but not intercepting it
I need to detect when a user presses Ctrl+V(regardless of window focus - my app will likely be minimised) but I must not stop the actual paste operation.
I have tried a few things: (I am successfully binding to keystrokes with RegisterHotKey)
I…
![](../../users/profiles/597755.webp)
Ozzah
- 10,386
- 15
- 69
- 112
8
votes
2 answers
Global hotkey release (keyup)? (WIN32 API)
Is there a way to notice the release of a hot-key button registered with RegisterHotKey?
I get a WM_HOTKEY message every time I press the hot-key but I need to know when the key was released
![](../../users/profiles/679173.webp)
Crackoder
- 115
- 6
7
votes
1 answer
Register more than one hotkey with RegisterHotKey
I found this little piece of code to register an hotkey:
[DllImport("user32.dll")]
public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc);
protected override void WndProc(ref Message m)
{
if…
![](../../users/profiles/577309.webp)
Simondotdot
- 73
- 1
- 3
7
votes
1 answer
Register hot key that is already used
Background:
I want to listen to a hot key sequence (Ctrl+Alt+Left) globally, so I'm using:
[DllImport("user32.dll")]
private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);
This works great with many other hot key…
![](../../users/profiles/1282539.webp)
SimpleVar
- 12,897
- 2
- 35
- 58
5
votes
1 answer
How can my form detect KeyDown events when another control has the focus?
procedure TMainForm.KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (GetKeyState(Ord('Q'))<0) and (GetKeyState(Ord('W'))<0) and (GetKeyState(Ord('E'))<0)
then ShowMessage('You pressed it');
end;
the above event only work…
![](../../users/profiles/3500668.webp)
RepeatUntil
- 2,182
- 2
- 27
- 53
4
votes
1 answer
Calling a powershell function with a global hotkey
I want to use a function from my Powershell script by triggering a global hotkey (the combination Ctrl+Shift+F12) which is registered and unregistered by my script. I need to access a .NET object created by my script. In pseudo code:
$object_i_need…
![](../../users/profiles/140367.webp)
Tamás Szelei
- 21,352
- 16
- 94
- 169
4
votes
3 answers
How to detect programmatically whether code is running in shared DLL or exe?
A have a C# class which simplifies the handling of global hot keys.
This class uses the Win32-API function RegisterHotKey() to register the hot keys.
According to MSDN this function needs an ID value in the range 0x0000 through 0xBFFF when
calling…
![](../../users/profiles/117641.webp)
Habi
- 3,095
- 21
- 21
4
votes
1 answer
How to define a mouse gesture in C#
I want to define a mouse gesture in C# with below properties:
Firing the event before other applications that have same gesture
Define different gesture based on different user mouse speed.
So what is the best solution?
![](../../users/profiles/308578.webp)
saber tabatabaee yazdi
- 2,078
- 3
- 26
- 40
3
votes
1 answer
SendInput fails after processing a hotkey containing "Ctrl"
I'm writing a Windows executable in Dephi 2007 (32 bit) which sends keystrokes to another application.
Pressing a hotkey or hotkey combination from within the other application causes my app to send keystrokes to that application. My approach works…
![](../../users/profiles/528796.webp)
Mark Wilsdorf
- 751
- 1
- 5
- 16
3
votes
1 answer
Associate a file extension to an application within C# application
I need to associate a file extension to a specific executable application and write its value in th register , so i see this tutorial :
tutorial
so i create a new Wpf application in which i add this class :
public class FileAssociation
{
…
![](../../users/profiles/2265011.webp)
Lamloumi Afif
- 8,129
- 23
- 79
- 175
3
votes
1 answer
C++ RegisterHotKey without overriding existing functionality
When I register a hot key in C++ (the PrtScn key in this case), I noticed that the original functionality is lost. The key does not capture an image of the screen any more. IS there a way to register the hot key without breaking its existing…
![](../../users/profiles/1227873.webp)
Vikas
- 159
- 1
- 1
- 13
3
votes
2 answers
How to create a global hotkey on Windows with 3 arguments?
Just like Ctl, Alt + delete
I want to write a program, which uses global hotkeys with 3 or more arguments in python. The assigned function should only perform when I press all three keys on my keyboard. For example alt, windows and…
![](../../users/profiles/2390242.webp)
helloworld1234
- 33
- 1
- 6