From 3dc795ea21b13cbfa0c277af73dc3363d20da388 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Sat, 22 Jan 2011 18:29:39 +0000 Subject: [PATCH] Assume the hook is gone even if unhooking failed. Update version number to 0.9rc1. --- AltDrag.ini | Bin 7426 -> 7426 bytes altdrag.c | 24 ++++++++---------------- include/error.c | 1 + localization/en-US/info.txt | 4 ++-- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/AltDrag.ini b/AltDrag.ini index 5a38a410e5d89bf745af51285b791b4ce7e88c11..1ebfd022c66bb06326637f8cb6f49a458ec3a0fa 100644 GIT binary patch delta 14 VcmZp&YO>m}hLh1?^IFbOVE`x?1mFMw delta 14 VcmZp&YO>m}hLh27^IFbOVE`x|1mOSx diff --git a/altdrag.c b/altdrag.c index 4fb1c9d..280256e 100644 --- a/altdrag.c +++ b/altdrag.c @@ -19,7 +19,7 @@ //App #define APP_NAME L"AltDrag" -#define APP_VERSION "0.9b1" +#define APP_VERSION "0.9rc1" #define APP_URL L"http://code.google.com/p/altdrag/" #define APP_UPDATE_STABLE L"http://altdrag.googlecode.com/svn/wiki/latest-stable.txt" #define APP_UPDATE_UNSTABLE L"http://altdrag.googlecode.com/svn/wiki/latest-unstable.txt" @@ -238,32 +238,26 @@ int UnhookSystem() { //Remove keyboard hook if (keyhook) { - if (UnhookWindowsHookEx(keyhook) != 0) { - keyhook = NULL; - } - else { + if (UnhookWindowsHookEx(keyhook) == 0) { Error(L"UnhookWindowsHookEx(keyhook)", L"Could not unhook keyboard. Try restarting "APP_NAME".", GetLastError(), TEXT(__FILE__), __LINE__); } + keyhook = NULL; } //Remove mouse hook if (mousehook) { - if (UnhookWindowsHookEx(mousehook) != 0) { - mousehook = NULL; - } - else { + if (UnhookWindowsHookEx(mousehook) == 0) { Error(L"UnhookWindowsHookEx(mousehook)", L"Could not unhook mouse. Try restarting "APP_NAME".", GetLastError(), TEXT(__FILE__), __LINE__); } + mousehook = NULL; } //Remove message hook if (msghook) { if (UnhookWindowsHookEx(msghook) == 0) { - msghook = NULL; - } - else { Error(L"UnhookWindowsHookEx(msghook)", L"Could not unhook windows. Try restarting "APP_NAME".", GetLastError(), TEXT(__FILE__), __LINE__); } + msghook = NULL; //Close HookWindows_x64.exe if (x64) { @@ -283,12 +277,10 @@ int UnhookSystem() { //Unload library if (hinstDLL) { - if (FreeLibrary(hinstDLL) != 0) { - hinstDLL = NULL; - } - else { + if (FreeLibrary(hinstDLL) == 0) { Error(L"FreeLibrary()", L"Could not free hooks.dll. Try restarting "APP_NAME".", GetLastError(), TEXT(__FILE__), __LINE__); } + hinstDLL = NULL; } //Success diff --git a/include/error.c b/include/error.c index 9a313b7..0b3d784 100644 --- a/include/error.c +++ b/include/error.c @@ -37,6 +37,7 @@ void Error(wchar_t *func, wchar_t *info, int errorcode, wchar_t *file, int line) fwprintf(f, L"%s\n\n", msg); fclose(f); #else + //Tip: You can also press Ctrl+C in a MessageBox window to copy the text HHOOK hhk = SetWindowsHookEx(WH_CBT, &ErrorMsgProc, 0, GetCurrentThreadId()); int response = MessageBox(NULL, msg, APP_NAME" Error", MB_ICONERROR|MB_YESNO|MB_DEFBUTTON2); UnhookWindowsHookEx(hhk); diff --git a/localization/en-US/info.txt b/localization/en-US/info.txt index ee80f24..5b31445 100644 --- a/localization/en-US/info.txt +++ b/localization/en-US/info.txt @@ -29,9 +29,9 @@ AltDrag is open source, licensed under GPL. Changelog --------- -0.9 release candidate: +0.9 release candidate - 2011-01-22: Added InactiveScroll. Enable it to scroll inactive windows. -Fixed bug with custom taskbar locations. +Fixed major bug with custom taskbar locations (only present in the beta). Expanded Aero option. Expanded AutoRemaximized option. It is now possible to toggle the maximized state with a resize button while dragging.