From 983780adc33b17b0b4f069d2eef68a52f1851d02 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Fri, 1 Aug 2008 19:10:25 +0000 Subject: [PATCH] Removed code to prevent alt key's keyup event. It caused more trouble than it solved. Release 0.2. --- altdrag.c | 2 +- hooks.c | 26 -------------------------- resources.rc | 6 +++--- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/altdrag.c b/altdrag.c index 12dd683..501ed2e 100644 --- a/altdrag.c +++ b/altdrag.c @@ -393,7 +393,7 @@ LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { SetAutostart(1,0); } else if (wmId == SWM_ABOUT) { - MessageBox(NULL, "AltDrag - 0.1\nhttp://altdrag.googlecode.com/\nrecover89@gmail.com\n\nDrag windows with the mouse when pressing the alt key.\n\nYou can use -hide as a parameter to hide the tray icon.\n\nSend feedback to recover89@gmail.com", "About AltDrag", MB_ICONINFORMATION|MB_OK); + MessageBox(NULL, "AltDrag - 0.2\nhttp://altdrag.googlecode.com/\nrecover89@gmail.com\n\nDrag windows with the mouse when pressing the alt key.\n\nYou can use -hide as a parameter to hide the tray icon.\n\nSend feedback to recover89@gmail.com", "About AltDrag", MB_ICONINFORMATION|MB_OK); } else if (wmId == SWM_EXIT) { DestroyWindow(hWnd); diff --git a/hooks.c b/hooks.c index 360bce0..28ac4d6 100644 --- a/hooks.c +++ b/hooks.c @@ -27,7 +27,6 @@ static int alt=0; static int move=0; static HWND hwnd=NULL; static POINT offset; -static int preventkeyup=0; static char msg[100]; @@ -41,11 +40,6 @@ _declspec(dllexport) LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPA } else if (wParam == WM_KEYUP || wParam == WM_SYSKEYUP) { alt=0; - //Prevent the keyup if this alt press was involved in dragging a window - if (preventkeyup) { - preventkeyup=0; - return 1; - } } } } @@ -118,26 +112,6 @@ _declspec(dllexport) LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM } //Ready to move window move=1; - //Send the window a control and alt keyup. Then prevent it from receiving the real alt keyup, to prevent behavior like selecting the menu in the active window - KEYBDINPUT ki_control; - ki_control.wVk=VK_CONTROL; - ki_control.dwFlags=KEYEVENTF_KEYUP; - ki_control.time=0; - - KEYBDINPUT ki_alt; - ki_alt.wVk=VK_MENU; - ki_alt.dwFlags=KEYEVENTF_KEYUP; - ki_alt.time=0; - - INPUT keys[2]; - keys[0].type=INPUT_KEYBOARD; - keys[0].ki=ki_control; - keys[1].type=INPUT_KEYBOARD; - keys[1].ki=ki_alt; - - SendInput(2, keys, sizeof(INPUT)); - - preventkeyup=1; //Prevent mousedown from propagating return 1; } diff --git a/resources.rc b/resources.rc index 706f4d5..be51658 100644 --- a/resources.rc +++ b/resources.rc @@ -8,8 +8,8 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "AltDrag.exe.manifest" #define VS_VERSION_INFO 1 VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,1,0,0 - PRODUCTVERSION 0,1,0,0 + FILEVERSION 0,2,0,0 + PRODUCTVERSION 0,2,0,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -21,7 +21,7 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "AltDrag" - VALUE "FileVersion", "0.1" + VALUE "FileVersion", "0.2" VALUE "InternalName", "altdrag" VALUE "LegalCopyright", "© Stefan Sundin 2008" VALUE "OriginalFilename", "AltDrag.exe"