Click here to Skip to main content
15,902,845 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRunning a program from the network Pin
ltnuke29-Jun-04 11:45
ltnuke29-Jun-04 11:45 
GeneralRe: Running a program from the network Pin
Jeremy Falcon29-Jun-04 11:52
professionalJeremy Falcon29-Jun-04 11:52 
GeneralRe: Running a program from the network Pin
Steven Campbell29-Jun-04 11:59
Steven Campbell29-Jun-04 11:59 
GeneralRe: Running a program from the network Pin
Colin Angus Mackay29-Jun-04 13:16
Colin Angus Mackay29-Jun-04 13:16 
GeneralRe: Running a program from the network Pin
ltnuke30-Jun-04 2:13
ltnuke30-Jun-04 2:13 
GeneralRe: Running a program from the network Pin
Colin Angus Mackay30-Jun-04 4:55
Colin Angus Mackay30-Jun-04 4:55 
GeneralRe: Running a program from the network Pin
mtone2-Jul-04 9:22
mtone2-Jul-04 9:22 
GeneralHooking application Open file calls Pin
WESHILL29-Jun-04 10:32
WESHILL29-Jun-04 10:32 
Hi,

I have the following Keyboard hook module and would like to convert it so that it can hook application File Open call instead. Could someone help me with this.

...........................................
Module TestHook

Public Const WH_KEYBOARD = 2
Public Const VK_SHIFT = &H10
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Integer, ByVal ncode As Integer, ByVal wParam As Integer, ByVal lParam As KBDLLHOOKSTRUCT) As Integer
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Integer) As Integer
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Integer, ByVal lpfn As Integer, ByVal hmod As Integer, ByVal dwThreadId As Integer) As Integer
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Integer) As Integer
Public hHook As Integer
Public Function KeyboardProc(ByVal idHook As Integer, ByVal wParam As Integer, ByVal lParam As KBDLLHOOKSTRUCT) As Integer
'if idHook is less than zero, no further processing is required
If idHook < 0 Then
'call the next hook
KeyboardProc = CallNextHookEx(hHook, idHook, wParam, lParam)
Else
'check if SHIFT-S is pressed
If (GetKeyState(VK_SHIFT) And &HF0000000) And wParam = Asc("S") Then
'show the result
MsgBox("Shift-S pressed ...")
End If
'call the next hook
KeyboardProc = CallNextHookEx(hHook, idHook, wParam, lParam)
End If
End Function


End Module

Private Sub Form_Load()
hHook = SetWindowsHookEx(WH_KEYBOARD, AddressOf KeyboardProc, App.hInstance, App.ThreadID)
End Sub

Private Sub Form_Unload(Cancel As Integer)
'remove the windows-hook
UnhookWindowsHookEx hHook
End Sub
...........................................

Thanks,
GeneralRe: Hooking application Open file calls Pin
Dave Kreskowiak29-Jun-04 15:49
mveDave Kreskowiak29-Jun-04 15:49 
GeneralRe: Hooking application Open file calls Pin
WESHILL29-Jun-04 17:57
WESHILL29-Jun-04 17:57 
GeneralRe: Hooking application Open file calls Pin
Dave Kreskowiak30-Jun-04 0:34
mveDave Kreskowiak30-Jun-04 0:34 
GeneralRe: Hooking application Open file calls Pin
WESHILL30-Jun-04 1:50
WESHILL30-Jun-04 1:50 
GeneralRe: Hooking application Open file calls Pin
Dave Kreskowiak30-Jun-04 2:36
mveDave Kreskowiak30-Jun-04 2:36 
GeneralRe: Hooking application Open file calls Pin
WESHILL5-Jul-04 4:05
WESHILL5-Jul-04 4:05 
GeneralRead a string Pin
Brad Fackrell29-Jun-04 9:57
Brad Fackrell29-Jun-04 9:57 
GeneralRe: Read a string Pin
Name Removed29-Jun-04 10:51
Name Removed29-Jun-04 10:51 
GeneralRe: Read a string Pin
Brad Fackrell29-Jun-04 11:21
Brad Fackrell29-Jun-04 11:21 
GeneralRe: Read a string Pin
shalwi29-Jun-04 18:42
shalwi29-Jun-04 18:42 
GeneralRe: Read a string Pin
Brad Fackrell30-Jun-04 1:33
Brad Fackrell30-Jun-04 1:33 
GeneralRe: Read a string Pin
manish.m.tawde1-Jul-04 0:48
manish.m.tawde1-Jul-04 0:48 
GeneralList Boxes Pin
Glen Conaway29-Jun-04 8:55
Glen Conaway29-Jun-04 8:55 
GeneralRe: List Boxes Pin
Dave Kreskowiak29-Jun-04 9:33
mveDave Kreskowiak29-Jun-04 9:33 
GeneralRe: List Boxes Pin
Glen Conaway29-Jun-04 10:43
Glen Conaway29-Jun-04 10:43 
GeneralRe: List Boxes Pin
Name Removed29-Jun-04 12:03
Name Removed29-Jun-04 12:03 
GeneralRe: List Boxes Pin
Glen Conaway29-Jun-04 12:35
Glen Conaway29-Jun-04 12:35 

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.