VB203 - VB NET HotKey Hooks

  Рет қаралды 736

MrHem

MrHem

Күн бұрын

Пікірлер: 10
@Gh_Ovimarlixion777
@Gh_Ovimarlixion777 2 жыл бұрын
Creo que te amo, gracias.
@Thegoodpublicist
@Thegoodpublicist 4 жыл бұрын
THANK YOU SO MUCH! I been searching how to do that for a long time 3>
@mrhem5371
@mrhem5371 4 жыл бұрын
Glad it helped!
@gerryRD19
@gerryRD19 3 жыл бұрын
Is there a way to register multiple keys? For example I want to register a hotkey that handles Win+V
@mrhem5371
@mrhem5371 3 жыл бұрын
We can use the modifier parameter to couple the key with an ALT, CRLT or WIN. In the documentation, it says the WINDOWS keys are reserved for use by the operating system, so I'd avoid using that with RegisterHotKey(). If you still want to use the WIN key or do more interesting stuff I recommend looking into www.autohotkey.com/ AUTOHOTKEY. Here would be the modifications required to couple with an ALT key. 'change the id to integer instead of keys Public Declare Auto Function RegisterHotKey Lib "User32.dll" (ByVal x As IntPtr, ByVal id As Integer, modifier As UInteger, keycode As Keys) As Long Public Const WM_HOTKEY = &H312 Public Const MOD_ALT = &H1 'add the MOD_ALT hex Protected Overrides Sub WndProc(ByRef m As Message) MyBase.WndProc(m) If (m.Msg = WM_HOTKEY) Then Dim id = m.WParam.ToInt32 If (id = 1) Then 'check for the id number MsgBox("ALT A") End If End If End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load RegisterHotKey(Me.Handle, 1, MOD_ALT, Keys.A) 'id 1 is registered with ALT A End Sub
@TheDailyRant
@TheDailyRant 3 жыл бұрын
@@mrhem5371 Loved the video great tuition and very helpful. I am using VS 2019 on windows 10. I had to update a line of your code to make it work on my system... from RegisterHotKey(Me.Handle, 1, MOD_ALT, Keys.A) 'id 1 is registered with ALT A to RegisterHotKey(Me.Handle, 1, CUInt(MOD_ALT), Keys.A) 'id 1 is registered with ALT A It works perfectly now. Thanks
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Вопрос Ребром - Джиган
43:52
Gazgolder
Рет қаралды 3,8 МЛН
Lists Practical
17:37
Zakaria abusilmiyeh
Рет қаралды 111
Proving Pythagoras Theorem Using Trigonometry
12:51
MrHem
Рет қаралды 126
Control Properties | Intro C# Visual Studio
7:28
Room 212
Рет қаралды 81
Resource Manager | Game Engine Devlog 4
14:19
Dimanari Null
Рет қаралды 33
How to swap driver into your fn cheeto src
5:15
C++ ⦁ Theory ⦁ Lesson 31 ⦁ for
12:04
Blogan Programming
Рет қаралды 130