private void SafeRemove() { if (this.State == HookState.Installed) { NativeExports.ChangeClipboardChain(this.clipboard.Handle, this.clipboard.NextWindow); this.OnSuccessfullUnhook(); } }
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); } } }