From 8c2fd1a5c8d92c6683b3c49cfeaeb11007e78993 Mon Sep 17 00:00:00 2001 From: RamonUnch <74856804+RamonUnch@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:56:45 +0100 Subject: [PATCH] Add files via upload --- AltDrag.txt | 4 +++- Lang/_en_US baseline.txt | Bin 10920 -> 11138 bytes Lang/fr_FR.ini | Bin 11456 -> 11684 bytes Lang/it_IT.ini | Bin 11518 -> 11768 bytes config.c | 18 +++++++++++++--- hooks.c | 34 +++++++++++++++++++++++------ languages.h | 11 +++++++++- resource.h | 4 ++++ window.rc | 45 +++++++++++++++++++++------------------ 9 files changed, 83 insertions(+), 33 deletions(-) diff --git a/AltDrag.txt b/AltDrag.txt index 99d7d170..a8e9b706 100644 --- a/AltDrag.txt +++ b/AltDrag.txt @@ -25,6 +25,9 @@ Note that this version has some more feature.. == CHANGELOG == == AltDrag 1.31 == ++ Added option to replace the resize center mode with Move mode. + GUI was adjusted accordingly + * Improved the non full windows dragging mode, it will no longer move the window when it snaps but only the transparent square and the window will be moved when click is released as expected. @@ -36,7 +39,6 @@ Note that this version has some more feature.. * Fixed some annoying behavior in the in case of unresponsive windows. - == AltDrag 1.30 == + Re-introduced the Aero snap at top to maximize a window. this behavior can diff --git a/Lang/_en_US baseline.txt b/Lang/_en_US baseline.txt index b808ddf0121f8728117151d5f97b73bdc1bc3459..2924e8bdf14120d8d397f323bb13d3a4094edf4a 100644 GIT binary patch delta 118 zcmZ1x+7!M)jc4)|ZZ%auhJ1!1hFk_)21kY*AXH#TVNhep1d63HBr}u%S@{fklN)(O zCqLqrkaYrz+cG!-RpbNZN`Pc8P)89^RXRh)OV delta 16 XcmZn)UlF=Njc4*BUX{%%ym4{>H=+f< diff --git a/Lang/fr_FR.ini b/Lang/fr_FR.ini index 611eaaf0f74da95937f54f25ddf6e5894dc98bdb..d2f99191d35dbaecc2f20a4b4aaf6c099d8374e8 100644 GIT binary patch delta 182 zcmX>Qxg>hSE}qH9IQS+@@$gtWGo&))F_ZwwA_hN(d?1<2V9O8!WR-$Niy0IcQW(@2 zGJ!Iw49P&TOrTsIL-FK;9Ks+I)R9ea0;;lQaAHVg0O?By(rQ3+k{L1>Qn9M{1)5a` jG}o5Fh2bSoZ2?0LP){<*HIvt~i%)Lg7214{=aD=B7>p`3 delta 16 YcmZ1yeIRnfE}qF-*o8K4;Qb;G07EqgasU7T diff --git a/Lang/it_IT.ini b/Lang/it_IT.ini index 1abdc449781a378c6b6045c9581c8e5d51996fe3..7c9211efa7467fa8db01bd90d141a8283be37e7a 100644 GIT binary patch delta 154 zcmewt`6GJ6G@i-ZxcDaDb(Br!7nj^TjVD6^0NW)b=>Px# delta 20 ccmewn{V#IEG@i+uxTGcr@NsS4!t0^{0A~~kIRF3v diff --git a/config.c b/config.c index ec55740e..00d32485 100644 --- a/config.c +++ b/config.c @@ -263,7 +263,8 @@ INT_PTR CALLBACK GeneralPageDialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA Button_SetCheck(GetDlgItem(hwnd, IDC_RESIZEALL), ret? BST_CHECKED : BST_UNCHECKED); ret=GetPrivateProfileInt(L"General", L"ResizeCenter", 1, inipath); - Button_SetCheck(GetDlgItem(hwnd, IDC_RESIZECENTER), ret? BST_CHECKED : BST_UNCHECKED); + ret = ret==1? IDC_RZCENTER_NORM: ret==2? IDC_RZCENTER_MOVE: IDC_RZCENTER_BR; + CheckRadioButton(hwnd, IDC_RZCENTER_NORM, IDC_RZCENTER_MOVE, ret); HWND control = GetDlgItem(hwnd, IDC_LANGUAGE); ComboBox_ResetContent(control); @@ -305,8 +306,16 @@ INT_PTR CALLBACK GeneralPageDialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA WritePrivateProfileString(L"Performance",L"FullWin", _itow(val, txt, 10), inipath); } else if (id == IDC_RESIZEALL) { WritePrivateProfileString(L"Advanced", L"ResizeAll", _itow(val, txt, 10), inipath); - } else if (id == IDC_RESIZECENTER) { - WritePrivateProfileString(L"General", L"ResizeCenter", _itow(val, txt, 10), inipath); + + } else if (id == IDC_RZCENTER_NORM) { + CheckRadioButton(hwnd, IDC_RZCENTER_NORM, IDC_RZCENTER_MOVE, IDC_RZCENTER_NORM); + WritePrivateProfileString(L"General", L"ResizeCenter", L"1", inipath); + } else if (id == IDC_RZCENTER_BR) { + CheckRadioButton(hwnd, IDC_RZCENTER_NORM, IDC_RZCENTER_MOVE, IDC_RZCENTER_BR); + WritePrivateProfileString(L"General", L"ResizeCenter", L"0", inipath); + } else if (id == IDC_RZCENTER_MOVE) { + CheckRadioButton(hwnd, IDC_RZCENTER_NORM, IDC_RZCENTER_MOVE, IDC_RZCENTER_MOVE); + WritePrivateProfileString(L"General", L"ResizeCenter", L"2", inipath); } else if (id == IDC_LANGUAGE && event == CBN_SELCHANGE) { int i = ComboBox_GetCurSel(control); @@ -382,6 +391,9 @@ INT_PTR CALLBACK GeneralPageDialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA SetDlgItemText(hwnd, IDC_FULLWIN, l10n->general_fullwin); SetDlgItemText(hwnd, IDC_RESIZEALL, l10n->general_resizeall); SetDlgItemText(hwnd, IDC_RESIZECENTER, l10n->general_resizecenter); + SetDlgItemText(hwnd, IDC_RZCENTER_NORM, l10n->general_resizecenter_norm); + SetDlgItemText(hwnd, IDC_RZCENTER_BR, l10n->general_resizecenter_br); + SetDlgItemText(hwnd, IDC_RZCENTER_MOVE, l10n->general_resizecenter_move); SetDlgItemText(hwnd, IDC_AUTOSTART_BOX, l10n->general_autostart_box); SetDlgItemText(hwnd, IDC_AUTOSTART, l10n->general_autostart); diff --git a/hooks.c b/hooks.c index 0f01c859..9f000fe2 100644 --- a/hooks.c +++ b/hooks.c @@ -972,8 +972,10 @@ static void MouseMove(POINT pt) if (mm_start && IsZoomed(state.hwnd)) { WINDOWPLACEMENT wndpl = { sizeof(WINDOWPLACEMENT) }; GetWindowPlacement(state.hwnd, &wndpl); + // Set size to monitor to prevent flickering wnd = wndpl.rcNormalPosition = state.mdiclient? mdimon: GetMonitorRect(pt); + if (state.mdiclient) { // Make it a little smaller since MDIClients by // default have scrollbars that would otherwise appear @@ -1000,6 +1002,7 @@ static void MouseMove(POINT pt) , wnd.top + mdiclientpt.y - borders.top , wnd.right + mdiclientpt.x + borders.right , wnd.bottom+ mdiclientpt.y + borders.bottom }; + } // Clear restore flag state.wndentry->restore = 0; @@ -1552,6 +1555,10 @@ static int ActionMaxRestMin(POINT pt, int delta) static HCURSOR CursorToDraw() { HCURSOR cursor; + + if(state.action == AC_MOVE) + return cursors[HAND]; + if ((state.resize.y == RZ_TOP && state.resize.x == RZ_LEFT) || (state.resize.y == RZ_BOTTOM && state.resize.x == RZ_RIGHT)) { cursor = cursors[SIZENWSE]; @@ -1572,7 +1579,13 @@ static HCURSOR CursorToDraw() ///////////////////////////////////////////////////////////////////////////// static int ActionMove(HMONITOR monitor ) { + if (!monitor) { + POINT pt; + GetCursorPos(&pt); + monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); + } // Toggle Maximize window if this is a double-click + if (GetTickCount()-state.clicktime <= conf.dbclktime && IsResizable(state.hwnd)) { state.action = AC_NONE; // Stop move action state.clicktime = 0; // Reset double-click time @@ -1679,11 +1692,15 @@ static int ActionResize(POINT pt, POINT mdiclientpt, RECT *wnd, RECT mon) // Prevent mousedown from propagating return 1; } - if (!conf.ResizeCenter && state.resize.y == RZ_CENTER && state.resize.x == RZ_CENTER) { - state.resize.x = RZ_RIGHT; - state.resize.y = RZ_BOTTOM; - state.offset.y = wnd->bottom-pt.y; - state.offset.x = wnd->right-pt.x; + if (state.resize.y == RZ_CENTER && state.resize.x == RZ_CENTER) { + if (conf.ResizeCenter == 0) { + state.resize.x = RZ_RIGHT; + state.resize.y = RZ_BOTTOM; + state.offset.y = wnd->bottom-pt.y; + state.offset.x = wnd->right-pt.x; + } else if (conf.ResizeCenter == 2) { + state.action = AC_MOVE; + } } return -1; @@ -1826,6 +1843,7 @@ static int init_movement_and_actions(POINT pt, enum action action, int nCode, WP GetMinMaxInfo_glob(state.hwnd); // for CLAMPH/W functions int ret = ActionResize(pt, mdiclientpt, &wnd, mon); + action = state.action; if(ret==1) return 1; else if (ret==0) CallNextHookEx(NULL, nCode, wParam, lParam); @@ -2009,14 +2027,16 @@ __declspec(dllexport) LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wPara return 1; } else if (state.alt && buttonstate == STATE_DOWN) { - if(!init_movement_and_actions(pt, action, nCode, wParam, lParam)) { + int ret = init_movement_and_actions(pt, action, nCode, wParam, lParam); + action = state.action; + if(!ret) { return CallNextHookEx(NULL, nCode, wParam, lParam); } else { return 1; } // FINISHING THE MOVE - } else if (buttonstate == STATE_UP && state.action == action) { + } else if (buttonstate == STATE_UP && state.action) { if (!mm_start && LastWin.hwnd) { if(!conf.FullWin) // to erase the last rectangle... Rectangle(hdcc, oldRect.left, oldRect.top, oldRect.right, oldRect.bottom); diff --git a/languages.h b/languages.h index f309428b..859579ea 100644 --- a/languages.h +++ b/languages.h @@ -64,7 +64,10 @@ struct strings { wchar_t *general_fullwin; wchar_t *general_resizeall; wchar_t *general_resizecenter; - + wchar_t *general_resizecenter_norm; + wchar_t *general_resizecenter_br; + wchar_t *general_resizecenter_move; + // general autostart wchar_t *general_autostart_box; wchar_t *general_autostart; @@ -178,6 +181,9 @@ struct { { &l10n_ini.general_fullwin, L"GeneralFullWin" }, { &l10n_ini.general_resizeall, L"GeneralResizeAll" }, { &l10n_ini.general_resizecenter, L"GeneralResizeCenter" }, + { &l10n_ini.general_resizecenter_norm, L"GeneralResizeCenterNorm" }, + { &l10n_ini.general_resizecenter_br, L"GeneralResizeCenterBr" }, + { &l10n_ini.general_resizecenter_move, L"GeneralResizeCenterMove" }, { &l10n_ini.general_autostart_box, L"GeneralAutostartBox" }, { &l10n_ini.general_autostart, L"GeneralAutostart" }, @@ -288,6 +294,9 @@ struct strings en_US = { /* FullWin */ L"&Drag full windows", /* ResizeAll */ L"&Resize all windows", /* ResizeCenter */ L"&Center resize mode", + /* ResizeCenterNorm */ L"All d&irections", + /* ResizeCenterBr */ L"B&ottom right", + /* ResizeCenterMove */ L"Mo&ve", /* autostart_box */ L"Autostart", /* autostart */ L"S&tart "APP_NAME" when logging on", diff --git a/resource.h b/resource.h index 1d00e81c..488bf2f4 100644 --- a/resource.h +++ b/resource.h @@ -85,3 +85,7 @@ #define IDC_PAUSEBL 2014 #define IDC_MDISBL_HEADER 2015 #define IDC_MDIS 2016 + +#define IDC_RZCENTER_NORM 2017 +#define IDC_RZCENTER_BR 2018 +#define IDC_RZCENTER_MOVE 2019 diff --git a/window.rc b/window.rc index f2744f43..0f1ba5d4 100644 --- a/window.rc +++ b/window.rc @@ -12,7 +12,7 @@ BEGIN ICON app_icon, IDC_STATIC, 15,15,0,0 LTEXT "Version",IDC_VERSION, 48, 15, 160,8 - LTEXT "https://stefansundin.github.io/altdrag/", 0, 48,25,160,10 + EDITTEXT IDC_URL, 48,25,160,10, ES_READONLY | NOT WS_BORDER LTEXT "Created by Stefan Sundin",IDC_AUTHOR, 10, 40, 200, 8 LTEXT "https://stefansundin.com/", 0, 10,50,200,10 @@ -55,26 +55,29 @@ EXSTYLE WS_EX_WINDOWEDGE CAPTION "General" FONT 8, "Ms Shell Dlg" BEGIN - GROUPBOX "General", IDC_GENERAL_BOX,3,1,212,120 - CONTROL "AutoFocus", IDC_AUTOFOCUS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP | BS_MULTILINE,10,13,195,18 - CONTROL "Aero", IDC_AERO, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10, 31,195,8 - CONTROL "InactiveScroll", IDC_INACTIVESCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,43,195,8 - CONTROL "MDI", IDC_MDI, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10, 55,195,8 - - CONTROL "FullWin", IDC_FULLWIN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,110, 76,102,8 - CONTROL "ResizeAll", IDC_RESIZEALL, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,110, 90,102,8 - CONTROL "resizeCenter",IDC_RESIZECENTER, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,104,102,8 - - LTEXT "AutoSnap:", IDC_AUTOSNAP_HEADER,10,65,95,8 - COMBOBOX IDC_AUTOSNAP, 10,75 ,95,120, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP - LTEXT "Language:", IDC_LANGUAGE_HEADER,10,90,95,8 - COMBOBOX IDC_LANGUAGE, 10,100,95,120, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP | WS_VSCROLL - - GROUPBOX "Autostart",IDC_AUTOSTART_BOX ,3,125,212,53 - CONTROL "Autostart",IDC_AUTOSTART, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,137,195,8 - CONTROL "Hide tray",IDC_AUTOSTART_HIDE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,150,195,8 - CONTROL "Elevate", IDC_AUTOSTART_ELEVATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,163,140,8 - DEFPUSHBUTTON "Elevate", IDC_ELEVATE, 153,160,58,14 + GROUPBOX "General", IDC_GENERAL_BOX,3,1,212,132 + CONTROL "AutoFocus", IDC_AUTOFOCUS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP | BS_MULTILINE,10,13,195,18 + CONTROL "Aero", IDC_AERO, "Button",BS_AUTOCHECKBOX | WS_TABSTOP, 10, 30, 195,8 + CONTROL "InactiveScroll",IDC_INACTIVESCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, 10, 40, 195,8 + CONTROL "MDI", IDC_MDI, "Button",BS_AUTOCHECKBOX | WS_TABSTOP, 10, 50, 195,8 + CONTROL "FullWin", IDC_FULLWIN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP, 10, 60, 195,8 + CONTROL "ResizeAll", IDC_RESIZEALL, "Button",BS_AUTOCHECKBOX | WS_TABSTOP, 10, 70, 195,8 + + GROUPBOX "ResizeCenter", IDC_RESIZECENTER, 110,88, 102,42 + RADIOBUTTON "All d&irections",IDC_RZCENTER_NORM, 115,98, 95,8, WS_GROUP|WS_TABSTOP + RADIOBUTTON "B&ottom right", IDC_RZCENTER_BR, 115,108, 95,8, WS_GROUP|WS_TABSTOP + RADIOBUTTON "Mo&ve", IDC_RZCENTER_MOVE, 115,118, 95,8, WS_GROUP|WS_TABSTOP + + LTEXT "AutoSnap:", IDC_AUTOSNAP_HEADER,10,82,95,8 + COMBOBOX IDC_AUTOSNAP, 10,91 ,95,120, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP + LTEXT "Language:", IDC_LANGUAGE_HEADER,10,105,95,8 + COMBOBOX IDC_LANGUAGE, 10,115,95,120, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_TABSTOP | WS_VSCROLL + + GROUPBOX "Autostart",IDC_AUTOSTART_BOX ,3,135,212,43 + CONTROL "Autostart",IDC_AUTOSTART, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,145,195,8 + CONTROL "Hide tray",IDC_AUTOSTART_HIDE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,155,140,8 + CONTROL "Elevate", IDC_AUTOSTART_ELEVATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,165,140,8 + DEFPUSHBUTTON "Elevate", IDC_ELEVATE, 155,160,55,14 LTEXT "Note: Instant!",IDC_AUTOSAVE,3,180,216,8