Exemplo n.º 1
0
 //Konstruktor Hook
 //parameter lowlevel input atau tidak
 public driver_caps(bool global)
 {
     isShow      = false;
     this.Global = global;
     cb_ambilkey = new CallbackEventAmbil(rekamEventHook);
     if (global)
     {
         //Hook secara global ke thread tunggu via dll low level
         HookID = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, cb_ambilkey, 0, 0); // ambil id hook di envi
     }
     else
     {
         // Hook non global manggil event up dan down ke message (ruang lingkup aplikasi)
         HookID = SetWindowsHookEx(HookType.WH_KEYBOARD, cb_ambilkey, 0, GetCurrentThreadId());
     }
 }
Exemplo n.º 2
0
 private static extern int SetWindowsHookEx(HookType idHook, CallbackEventAmbil lpfn, int hInstance, int threadId);