VB203 - VB NET HotKey Hooks

  Рет қаралды 722

MrHem

MrHem

Күн бұрын

Пікірлер: 10
@Gh_Ovimarlixion777
@Gh_Ovimarlixion777 2 жыл бұрын
Creo que te amo, gracias.
@Thegoodpublicist
@Thegoodpublicist 3 жыл бұрын
THANK YOU SO MUCH! I been searching how to do that for a long time 3>
@mrhem5371
@mrhem5371 3 жыл бұрын
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
The Right Way To Return API Errors in .NET
10:40
Nick Chapsas
Рет қаралды 44 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 81 М.
СОБАКА ВЕРНУЛА ТАБАЛАПКИ😱#shorts
00:25
INNA SERG
Рет қаралды 3,6 МЛН
The Most Important Design Pattern in React
35:04
Cosden Solutions
Рет қаралды 98 М.
Stop Using FirstOrDefault in .NET! | Code Cop #021
12:54
Nick Chapsas
Рет қаралды 91 М.
VB170  - VB.NET The Web Browser Object
14:04
MrHem
Рет қаралды 816
Why 4d geometry makes me sad
29:42
3Blue1Brown
Рет қаралды 650 М.
Intro to Windows Forms (WinForms) in .NET 6
1:35:50
IAmTimCorey
Рет қаралды 234 М.
Keyboard And Mouse Monitoring in Vb.net
8:24
TheGuy IsLooking
Рет қаралды 3,7 М.
The Turbo Charged Laptop. Literally.
27:02
Linus Tech Tips
Рет қаралды 1,6 МЛН
СОБАКА ВЕРНУЛА ТАБАЛАПКИ😱#shorts
00:25
INNA SERG
Рет қаралды 3,6 МЛН