Click here to Skip to main content
16,004,924 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCRC32 computation and error detection Pin
Gagan.2021-Jan-10 22:26
Gagan.2021-Jan-10 22:26 
AnswerRe: CRC32 computation and error detection Pin
DaveAuld21-Jan-10 23:23
professionalDaveAuld21-Jan-10 23:23 
AnswerRe: CRC32 computation and error detection Pin
Luc Pattyn22-Jan-10 1:40
sitebuilderLuc Pattyn22-Jan-10 1:40 
GeneralRe: CRC32 computation and error detection Pin
Gagan.2022-Jan-10 1:44
Gagan.2022-Jan-10 1:44 
GeneralRe: CRC32 computation and error detection Pin
Luc Pattyn22-Jan-10 2:09
sitebuilderLuc Pattyn22-Jan-10 2:09 
GeneralRe: CRC32 computation and error detection Pin
Gagan.2022-Jan-10 2:17
Gagan.2022-Jan-10 2:17 
GeneralRe: CRC32 computation and error detection [modified] Pin
Luc Pattyn22-Jan-10 3:09
sitebuilderLuc Pattyn22-Jan-10 3:09 
Questionhow to lock keyboard and mouse by vb6 code Pin
zhiyuan1621-Jan-10 22:08
zhiyuan1621-Jan-10 22:08 
dear all

i would like to lock keyboard and mouse when my system is running by vb6, however i got some code here, but when i run, some error is there, any one can help me, urgent, thanks.

Option Explicit
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
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long

Public hnexthookproc As Long
'Public Const HC_ACTION = 0
'Public Const WH_KEYBOARD = 2

Public Sub UnHookKBD()

    If hnexthookproc <> 0 Then
        UnhookWindowsHookEx hnexthookpro
        hnexthookproc = 0
    End If

End Sub

Public Function EnableKBDHook()

    If hnexthookproc <> 0 Then
        Exit Function
    End If

    hnexthookproc = SetWindowsHookEx(2, AddressOf MyKBHFunc, App.hInstance, 0)

    If hnexthookproc <> 0 Then
        EnableKBDHook = hnexthookproc
    End If

End Function

Private Sub Command1_Click()

    EnableKBDHook

End Sub

Private Sub Command2_Click()

    UnHookKBD

End Sub

Public Function MyKBHFunc(ByVal iCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

    MyKBHFunc = 0
    If iCode < 0 Then
    MyKBHFunc = CallNextHookEx(hnexthookproc, iCode, wParam, lParam)
    Exit Function
    End If

    If wParam = vbKeyReturn Then

    Debug.Print "haha"
    Else
    Call CallNextHookEx(hnexthookproc, iCode, wParam, lParam)
    End If

End Function

Private Sub Form_Load()

    EnableKBDHook

End Sub

Private Sub Form_Unload(Cancel As Integer)

    CallUnHookKBD

End Sub


the problem is underline point.
QuestionRe: how to lock keyboard and mouse by vb6 code Pin
Eddy Vluggen22-Jan-10 0:22
professionalEddy Vluggen22-Jan-10 0:22 
QuestionHelp, Pretty Please Exporting to Excel Pin
technette21-Jan-10 11:11
technette21-Jan-10 11:11 
AnswerRe: Help, Pretty Please Exporting to Excel Pin
DaveAuld21-Jan-10 12:11
professionalDaveAuld21-Jan-10 12:11 
AnswerRe: Help, Pretty Please Exporting to Excel Pin
Dave Kreskowiak21-Jan-10 12:56
mveDave Kreskowiak21-Jan-10 12:56 
AnswerRe: Help, Pretty Please Exporting to Excel Pin
Rick Shaub22-Jan-10 8:01
Rick Shaub22-Jan-10 8:01 
AnswerRe: Help, Pretty Please Exporting to Excel Pin
technette22-Jan-10 13:46
technette22-Jan-10 13:46 
QuestionWHERE WILL I GET VB.NET PROJECT Pin
rahuldsac21-Jan-10 6:04
rahuldsac21-Jan-10 6:04 
AnswerRe: WHERE WILL I GET VB.NET PROJECT Pin
Dave Kreskowiak21-Jan-10 6:43
mveDave Kreskowiak21-Jan-10 6:43 
AnswerRe: WHERE WILL I GET VB.NET PROJECT Pin
Steven J Jowett21-Jan-10 7:00
Steven J Jowett21-Jan-10 7:00 
AnswerRe: WHERE WILL I GET VB.NET PROJECT Pin
JHizzle21-Jan-10 7:57
JHizzle21-Jan-10 7:57 
JokeRe: WHERE WILL I GET VB.NET PROJECT Pin
Gagan.2022-Jan-10 1:54
Gagan.2022-Jan-10 1:54 
AnswerRe: WHERE WILL I GET VB.NET PROJECT Pin
darkelv22-Jan-10 2:10
darkelv22-Jan-10 2:10 
GeneralRe: WHERE WILL I GET VB.NET PROJECT Pin
Smithers-Jones22-Jan-10 3:51
Smithers-Jones22-Jan-10 3:51 
Questiondatareader error how to solve Pin
Patrício dos Santos21-Jan-10 5:07
Patrício dos Santos21-Jan-10 5:07 
AnswerRe: datareader error how to solve Pin
Dave Kreskowiak21-Jan-10 5:19
mveDave Kreskowiak21-Jan-10 5:19 
GeneralRe: datareader error how to solve Pin
Patrício dos Santos21-Jan-10 5:41
Patrício dos Santos21-Jan-10 5:41 
GeneralRe: datareader error how to solve Pin
Dave Kreskowiak21-Jan-10 6:45
mveDave Kreskowiak21-Jan-10 6:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.