Ejemplo n.º 1
0
 private void SafeRemove()
 {
     if (this.State == HookState.Installed)
     {
         NativeExports.ChangeClipboardChain(this.clipboard.Handle, this.clipboard.NextWindow);
         this.OnSuccessfullUnhook();
     }
 }
Ejemplo n.º 2
0
 public void RemoveHook()
 {
     if (this.State == HookState.Installed)
     {
         NativeExports.SetLastError(0);
         NativeExports.ChangeClipboardChain(this.clipboard.Handle, this.clipboard.NextWindow);
         var errorCode = NativeExports.GetLastError();
         if (errorCode == 0)
         {
             this.OnSuccessfullUnhook();
         }
         else
         {
             var message = ErrorCodeHelper.GetMessage(errorCode);
             throw new Exception(message);
         }
     }
 }