From 3f842c733568aa9068aa83fad52540eb98f334b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 20 Jul 2022 20:25:59 +0200 Subject: Simplify require, prefer. --- c/common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c/common.cpp') diff --git a/c/common.cpp b/c/common.cpp index 25ff899..4ce95a0 100644 --- a/c/common.cpp +++ b/c/common.cpp @@ -84,8 +84,8 @@ static LRESULT CALLBACK CBTProc(const int nCode, const WPARAM wParam, const LPAR int EBMessageBox(const TCHAR* const tszText, const TCHAR* const tszCaption, const unsigned uType) { extern HWND g_hWnd; - HHOOK hHook = require(WH_CBT, CBTProc, (HINSTANCE)NULL, GetCurrentThreadId()); + HHOOK hHook = require(SetWindowsHookEx(WH_CBT, CBTProc, (HINSTANCE)NULL, GetCurrentThreadId())); int r = MessageBox(g_hWnd, tszText, tszCaption, uType); - require(hHook); + require(UnhookWindowsHookEx(hHook)); return r; } -- cgit v1.2.3