I need a process for disabling windows key of keyboard through coding.
You can try this:
Private Declare Function SetWindowsHookEx _ Lib "user32" Alias "SetWindowsHookExA" ( _ ByVal idHook As Long, _ ByVal lpfn As Long, _ ByVal hmod As Long, _ ByVal dwThreadId As Long) As Long Private Declare Function CallNextHookEx Lib "user32" ( _ ByVal hHook As Long, _ ByVal nCode As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long Private Declare Function UnhookWindowsHookEx Lib "user32" ( _ ByVal hHook As Long) As Long Private Declare Sub CopyMemory _ Lib "kernel32" Alias "RtlMoveMemory" ( _ pDest As Any, _ pSource As Any, _ ByVal cb As Long) Private Type KBDLLHOOKSTRUCT vkCode As Long scanCode As Long flags As Long time As Long dwExtraInfo As Long End Type Private Const HC_ACTION = 0& Private Const WH_KEYBOARD_LL = 13& Private Const VK_LWIN = &H5B& Private Const VK_RWIN = &H5C& Private hKeyb As Long Private Function KeybCallback(ByVal Code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Static udtHook As KBDLLHOOKSTRUCT If (Code = HC_ACTION) Then 'Copy the keyboard data out of the lParam (which is a pointer) Call CopyMemory(udtHook, ByVal lParam, Len(udtHook)) Select Case udtHook.vkCode Case VK_LWIN, VK_RWIN KeybCallback = 1 Exit Function End Select End If KeybCallback = CallNextHookEx(hKeyb, Code, wParam, lParam) End Function Public Sub HookKeyboard() UnhookKeyboard hKeyb = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf KeybCallback, App.hInstance, 0&) End Sub Public Sub UnhookKeyboard() If hKeyb <> 0 Then Call UnhookWindowsHookEx(hKeyb) hKeyb = 0 End If End Sub
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click Dim txtB1 As New TextBox Dim i For i = ...