protected virtual void DestroyWindowClassCore() { if (_wndClassAtom != 0) { var moduleHandle = InteropMethods.GetModuleHandle(null); InteropMethods.UnregisterClass(new IntPtr(_wndClassAtom), moduleHandle); _wndClassAtom = 0; } }
private static IntPtr SetHook(InteropValues.HookProc proc) { using var curProcess = Process.GetCurrentProcess(); using var curModule = curProcess.MainModule; if (curModule != null) { return(InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_KEYBOARD_LL, proc, InteropMethods.GetModuleHandle(curModule.ModuleName), 0)); } return(IntPtr.Zero); }