Exemplo n.º 1
0
 private void BeginListening()
 {
     if (!listening)
     {
         listening    = true;
         callback     = new Win32.CBTCallback(ModalListener);
         handleToHook = Win32.SetWindowsHookEx(CbtHookType, callback, IntPtr.Zero, Win32.GetCurrentThreadId());
     }
 }
Exemplo n.º 2
0
 private IntPtr CurrentHandle()
 {
     //return Win32.GetThreadDesktop( AppDomain.GetCurrentThreadId());
     return(Win32.GetThreadDesktop(Win32.GetCurrentThreadId()));
 }
Exemplo n.º 3
0
 private void BeginListening()
 {
     if (!listening)
     {
         listening = true;
         // Note: the callback is saved as a member to keep the CLR from shuffling off the pointer
         // before the callback is used.
         // If we try to assign the call back "inline" we get memory violation errors.
         callback     = Callback_ModalListener;
         handleToHook = Win32.SetWindowsHookEx(HCBT_ACTIVATE, callback, IntPtr.Zero, Win32.GetCurrentThreadId());
     }
 }
Exemplo n.º 4
0
 private static IntPtr CurrentHandle()
 {
     return(Win32.GetThreadDesktop(Win32.GetCurrentThreadId()));
 }