Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

VB.Net - WM_PASTE #14

Open
snrchang opened this issue May 12, 2018 · 1 comment
Open

VB.Net - WM_PASTE #14

snrchang opened this issue May 12, 2018 · 1 comment

Comments

@snrchang
Copy link

Could you be so kind to give me a example of using your awesome library in VB.Net

Also could this library be used to globally catch the WM_PASTE hook.
So you can detect user paste not only by ctrl v but also by context menu

Thanks so much for this library and your work

@justcoding121
Copy link
Owner

justcoding121 commented May 16, 2018

I am not sure on the syntax for event handling in VB.Net. Its been years.

    Dim eventHookFactory = New EventHookFactory()
    Dim keyboardWatcher = eventHookFactory.GetKeyboardWatcher()
    keyboardWatcher.Start()

I see that difficulty is with attaching the events with handlers. It won't be any different than the vb sample code in msdn for timer elapsed event.

https://msdn.microsoft.com/en-us/library/system.timers.timer.interval(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2

May be something like below.


 ' Hook up the Elapsed event for the timer.  
 AddHandler keyboardWatcher.OnKeyInput, AddressOf OnKeyInputEvent

   Private Sub OnKeyInputEvent(source As Object, e As KeyInputEventArgs)
         Console.WriteLine(string.Format("Key {0} event of key {1}", e.KeyData.EventType, e.KeyData.Keyname));
    End Sub

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants