├── AltDrag.ini ├── media ├── find.cur ├── find.ico ├── find.png ├── icon.ico ├── icon.png ├── icon-big.ico ├── taskbar.ico ├── tray-disabled.ico └── tray-enabled.ico ├── include ├── hooks.rc ├── hookwindows_x64.rc ├── x86.exe.manifest ├── x64.exe.manifest ├── languages.c ├── altdrag.rc ├── localization.c ├── autostart.c ├── tray.c ├── error.c └── update.c ├── .gitignore ├── localization ├── nb_NO │ ├── installer.nsh │ └── Translation.ini ├── de_DE │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── es_ES │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── fr_FR │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── gl_ES │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── it_IT │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── ja_JP │ ├── Translation.ini │ └── installer.nsh ├── ko_KR │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── nl_NL │ ├── Translation.ini │ └── installer.nsh ├── pl_PL │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── pt_BR │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── ru_RU │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── sk_SK │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── zh_CN │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── zh_TW │ ├── Translation.ini │ ├── installer.nsh │ └── strings.h ├── installer.nsh ├── languages.h ├── en_US │ ├── installer.nsh │ ├── strings.h │ └── Translation.ini ├── ca_ES │ ├── installer.nsh │ ├── strings.h │ └── Translation.ini └── strings.h ├── tools ├── unhook.c ├── ini.c ├── export_l10n_ini.c └── import_languages.c ├── config ├── resource.h └── window.rc ├── hookwindows_x64.c ├── installer.nsi └── altdrag.c /AltDrag.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/AltDrag.ini -------------------------------------------------------------------------------- /media/find.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/find.cur -------------------------------------------------------------------------------- /media/find.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/find.ico -------------------------------------------------------------------------------- /media/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/find.png -------------------------------------------------------------------------------- /media/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/icon.ico -------------------------------------------------------------------------------- /media/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/icon.png -------------------------------------------------------------------------------- /include/hooks.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/include/hooks.rc -------------------------------------------------------------------------------- /media/icon-big.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/icon-big.ico -------------------------------------------------------------------------------- /media/taskbar.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/taskbar.ico -------------------------------------------------------------------------------- /media/tray-disabled.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/tray-disabled.ico -------------------------------------------------------------------------------- /media/tray-enabled.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/media/tray-enabled.ico -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | .DS_Store 3 | *.swp 4 | 5 | bin 6 | *.dll 7 | *.exe 8 | /Translation.ini 9 | -------------------------------------------------------------------------------- /include/hookwindows_x64.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/include/hookwindows_x64.rc -------------------------------------------------------------------------------- /localization/nb_NO/installer.nsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/nb_NO/installer.nsh -------------------------------------------------------------------------------- /localization/de_DE/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/de_DE/Translation.ini -------------------------------------------------------------------------------- /localization/es_ES/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/es_ES/Translation.ini -------------------------------------------------------------------------------- /localization/fr_FR/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/fr_FR/Translation.ini -------------------------------------------------------------------------------- /localization/gl_ES/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/gl_ES/Translation.ini -------------------------------------------------------------------------------- /localization/it_IT/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/it_IT/Translation.ini -------------------------------------------------------------------------------- /localization/ja_JP/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/ja_JP/Translation.ini -------------------------------------------------------------------------------- /localization/ko_KR/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/ko_KR/Translation.ini -------------------------------------------------------------------------------- /localization/nb_NO/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/nb_NO/Translation.ini -------------------------------------------------------------------------------- /localization/nl_NL/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/nl_NL/Translation.ini -------------------------------------------------------------------------------- /localization/pl_PL/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/pl_PL/Translation.ini -------------------------------------------------------------------------------- /localization/pt_BR/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/pt_BR/Translation.ini -------------------------------------------------------------------------------- /localization/ru_RU/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/ru_RU/Translation.ini -------------------------------------------------------------------------------- /localization/sk_SK/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/sk_SK/Translation.ini -------------------------------------------------------------------------------- /localization/zh_CN/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/zh_CN/Translation.ini -------------------------------------------------------------------------------- /localization/zh_TW/Translation.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/altdrag/master/localization/zh_TW/Translation.ini -------------------------------------------------------------------------------- /localization/installer.nsh: -------------------------------------------------------------------------------- 1 | !include "localization\en_US\installer.nsh" 2 | !include "localization\fr_FR\installer.nsh" 3 | !include "localization\pl_PL\installer.nsh" 4 | !include "localization\pt_BR\installer.nsh" 5 | !include "localization\ru_RU\installer.nsh" 6 | !include "localization\sk_SK\installer.nsh" 7 | !include "localization\zh_CN\installer.nsh" 8 | !include "localization\it_IT\installer.nsh" 9 | !include "localization\de_DE\installer.nsh" 10 | !include "localization\ca_ES\installer.nsh" 11 | !include "localization\ko_KR\installer.nsh" 12 | -------------------------------------------------------------------------------- /include/x86.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /include/x64.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /localization/languages.h: -------------------------------------------------------------------------------- 1 | // Do not edit this file! It is automatically generated! 2 | 3 | #include "en_US/strings.h" 4 | #include "fr_FR/strings.h" 5 | #include "pl_PL/strings.h" 6 | #include "pt_BR/strings.h" 7 | #include "sk_SK/strings.h" 8 | #include "ru_RU/strings.h" 9 | #include "zh_CN/strings.h" 10 | #include "zh_TW/strings.h" 11 | #include "it_IT/strings.h" 12 | #include "de_DE/strings.h" 13 | #include "es_ES/strings.h" 14 | #include "gl_ES/strings.h" 15 | #include "ca_ES/strings.h" 16 | #include "ko_KR/strings.h" 17 | 18 | struct strings *languages[] = { 19 | &en_US, 20 | &fr_FR, 21 | &pl_PL, 22 | &pt_BR, 23 | &sk_SK, 24 | &ru_RU, 25 | &zh_CN, 26 | &zh_TW, 27 | &it_IT, 28 | &de_DE, 29 | &es_ES, 30 | &gl_ES, 31 | &ca_ES, 32 | &ko_KR, 33 | }; 34 | 35 | struct strings *l10n = &en_US; 36 | -------------------------------------------------------------------------------- /include/languages.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | void UpdateLanguage() { 11 | wchar_t path[MAX_PATH]; 12 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 13 | PathRemoveFileSpec(path); 14 | wcscat(path, L"\\Translation.ini"); 15 | FILE *f = _wfopen(path, L"rb"); 16 | if (f != NULL) { 17 | fclose(f); 18 | LoadTranslation(path); 19 | l10n = &l10n_ini; 20 | return; 21 | } 22 | 23 | wchar_t txt[10]; 24 | GetPrivateProfileString(L"General", L"Language", L"en-US", txt, ARRAY_SIZE(txt), inipath); 25 | int i; 26 | for (i=0; i < ARRAY_SIZE(languages); i++) { 27 | if (!wcsicmp(txt,languages[i]->code)) { 28 | l10n = languages[i]; 29 | break; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /include/altdrag.rc: -------------------------------------------------------------------------------- 1 | app_icon ICON "media/icon.ico" 2 | taskbar_icon ICON "media/taskbar.ico" 3 | tray_disabled ICON "media/tray-disabled.ico" 4 | tray_enabled ICON "media/tray-enabled.ico" 5 | 6 | #include "../config/window.rc" 7 | 8 | #ifdef _WIN64 9 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "include/x64.exe.manifest" 10 | #else 11 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "include/x86.exe.manifest" 12 | #endif 13 | 14 | #define VS_VERSION_INFO 1 15 | VS_VERSION_INFO VERSIONINFO 16 | FILEVERSION 1,0,0,0 17 | PRODUCTVERSION 1,0,0,0 18 | FILEFLAGSMASK 0x3fL 19 | FILEFLAGS 0x0L 20 | FILEOS 0x40004L 21 | FILETYPE 0x1L 22 | FILESUBTYPE 0x0L 23 | BEGIN 24 | BLOCK "StringFileInfo" 25 | BEGIN 26 | BLOCK "040904b0" 27 | BEGIN 28 | VALUE "FileDescription", "AltDrag" 29 | VALUE "FileVersion", "1.1" 30 | VALUE "InternalName", "altdrag" 31 | VALUE "OriginalFilename", "AltDrag.exe" 32 | VALUE "CompanyName", "Stefan Sundin" 33 | VALUE "LegalCopyright", "� Stefan Sundin 2015" 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x409, 1200 39 | END 40 | END 41 | -------------------------------------------------------------------------------- /tools/unhook.c: -------------------------------------------------------------------------------- 1 | /* 2 | Send a message to all windows, this forces them to unhook invalid hooks. 3 | Needed to unhook windows hooked to hooks.dll CallWndProc after unclean AltDrag.exe exit. 4 | If you still can't override hooks.dll, use Process Explorer to search for hooks.dll. 5 | This also applies to hooks_x64.dll. 6 | 7 | Copyright (C) 2015 Stefan Sundin 8 | 9 | This program is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | */ 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { 20 | /* 21 | char title[100]; 22 | char classname[100]; 23 | GetWindowText(hwnd, title, 100); 24 | GetClassName(hwnd, classname, 100); 25 | printf("Sending WM_NULL to window: %s [%s]\n", title, classname); 26 | */ 27 | PostMessage(hwnd, WM_NULL, 0, 0); 28 | 29 | return TRUE; 30 | } 31 | 32 | int main() { 33 | EnumWindows(EnumWindowsProc, 0); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /tools/ini.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 16 | 17 | int main(int argc, char *argv[]) { 18 | if (argc < 4) { 19 | printf("Not enough arguments\n"); 20 | printf("Usage: ini
[new value]\n"); 21 | return 0; 22 | } 23 | 24 | // Get path 25 | char path[MAX_PATH]; 26 | if (PathIsRelative(argv[1])) { 27 | GetCurrentDirectory(ARRAY_SIZE(path), path); 28 | PathAddBackslash(path); 29 | strcat(path, argv[1]); 30 | } 31 | else { 32 | strcpy(path, argv[1]); 33 | } 34 | 35 | // Write/Read 36 | if (argc == 4) { 37 | char txt[1000]; 38 | GetPrivateProfileString(argv[2], argv[3], NULL, txt, ARRAY_SIZE(txt), path); // No error detection possible 39 | printf(txt); 40 | } 41 | else if (WritePrivateProfileString(argv[2],argv[3],argv[4],path) == 0) { 42 | int errorcode = GetLastError(); 43 | char *errormsg; 44 | int length = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorcode, 0, (char*)&errormsg, 0, NULL); 45 | errormsg[length-2] = '\0'; // Remove that damn newline at the end of the formatted error message 46 | printf("WritePrivateProfileString() failed in file %s, line %d.\nError: %s (%d)", TEXT(__FILE__), __LINE__, errormsg, errorcode); 47 | LocalFree(errormsg); 48 | return 1; 49 | } 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /include/localization.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | size_t wcslen_resolved(wchar_t *str) { 11 | // Return the length of str, having resolved escape sequences 12 | wchar_t *ptr; 13 | int num_escape_sequences = 0; 14 | for (ptr=str; *ptr != '\0'; ptr++) { 15 | if (*ptr == '\\' && *(ptr+1) != '\0') { 16 | ptr++; 17 | num_escape_sequences++; 18 | } 19 | } 20 | return ptr-str-num_escape_sequences; 21 | } 22 | 23 | void wcscpy_resolve(wchar_t *dest, wchar_t *source) { 24 | // Copy from source to dest, resolving \\n to \n 25 | for (; *source != '\0'; source++,dest++) { 26 | if (*source == '\\' && *(source+1) == 'n') { 27 | *dest = '\n'; 28 | source++; 29 | } 30 | else { 31 | *dest = *source; 32 | } 33 | } 34 | *dest = '\0'; 35 | } 36 | 37 | void LoadTranslation(wchar_t *ini) { 38 | wchar_t txt[3000]; 39 | int i; 40 | for (i=0; i < ARRAY_SIZE(l10n_mapping); i++) { 41 | // Get pointer to default English string to be used if ini entry doesn't exist 42 | wchar_t *def = *(wchar_t**) ((void*)&en_US + ((void*)l10n_mapping[i].str - (void*)&l10n_ini)); 43 | GetPrivateProfileString(L"Translation", l10n_mapping[i].name, def, txt, ARRAY_SIZE(txt), ini); 44 | if (l10n_mapping[i].str == &l10n_ini.about_version) { 45 | wcscat(txt, L" "); 46 | wcscat(txt, TEXT(APP_VERSION)); 47 | } 48 | *l10n_mapping[i].str = realloc(*l10n_mapping[i].str, (wcslen_resolved(txt)+1)*sizeof(wchar_t)); 49 | wcscpy_resolve(*l10n_mapping[i].str, txt); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /localization/zh_CN/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - zh-CN localization by Jack Jin (superjwl@gmail.com) and alex310110 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "SimpChinese" 9 | LangString L10N_LANG ${LANG_SIMPCHINESE} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "已经安装" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "选择如何安装${APP_NAME}。" 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME}已经安装在你的系统中。选择你想进行的操作,并点击下一步继续。" 14 | LangString L10N_UPGRADE_UPGRADE 0 "(&U)把${APP_NAME}升级到${APP_VERSION}。" 15 | LangString L10N_UPGRADE_INI 0 "你的旧配置将被保存为${APP_NAME}-old.ini。" 16 | LangString L10N_UPGRADE_INSTALL 0 "(&I)安装到新的位置。" 17 | LangString L10N_UPGRADE_UNINSTALL 0 "(&t)卸载${APP_NAME}。" 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "快捷键" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "快捷键Alt + Shift和${APP_NAME}冲突。" 21 | LangString L10N_ALTSHIFT_HEADER 0 "安装程序检测到当前windows切换键盘布局的快捷键为Alt + Shift。$\n$\n而在使用${APP_NAME}时,按住shift键可以在窗口之间相互吸附。所以切换键盘布局和窗口相互吸附这两个功能的快捷键相同。当${APP_NAME}内部试图阻止意外的键盘布局切换时,会造成按住shift键移动窗口操作的失败。$\n$\n此时,你可以禁止或修改切换键盘布局的快捷键。点击下一步继续。" 22 | LangString L10N_ALTSHIFT_BUTTON 0 "(&O)打开键盘设置" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "注册表优化" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "注山表优化是可选的,以保持${APP_NAME}不会意外中止。" 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "在Windows 7中,微软加入了一个特性,如果键盘和鼠标勾子长时间没有响应,则会停用它们。不幸的是,这个检查会出错,特别是当你对电脑进行长时间休眠,睡眠或锁定时。$\n$\n如果发生这种情况,你会发现${APP_NAME}没有任何提示而停止工作,你必须先停用并再启用${APP_NAME}使之再次工作。$\n$\n有一个注册表项可以设定windows7等待hooks响应的时间,你可以通过下面的按钮来启用或停用这个注册表项。请注意,这个注册表项完全是可选的。" 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&E启用注册表优化" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&D禁用注册表优化" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "注册表优化已经成功应用。" 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "改动将会在你下次登录时起作用。" 31 | -------------------------------------------------------------------------------- /localization/zh_TW/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - zh-TW localization by Zkm (zkm@ilowkey.net) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "繁體中文(台灣)" ; English name of this language 9 | LangString L10N_LANG ${LANG_ENGLISH} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "早已安裝" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "請選擇您要安裝 ${APP_NAME} 的方式。" 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} 早已安裝至您的系統中。選取您想執行的內容並按下「下一步」以繼續動作。" 14 | LangString L10N_UPGRADE_UPGRADE 0 "升級 ${APP_NAME} 至 ${APP_VERSION} 版(&U)。" 15 | LangString L10N_UPGRADE_INI 0 "您原先使用的設定檔案將被複製為 ${APP_NAME}-old.ini。" 16 | LangString L10N_UPGRADE_INSTALL 0 "安裝至新位置(&I)" 17 | LangString L10N_UPGRADE_UNINSTALL 0 "移除 ${APP_NAME}(&T)。" 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "鍵盤快捷鍵" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Alt 鍵 + Shift 鍵將會跟 ${APP_NAME} 衝突。" 21 | LangString L10N_ALTSHIFT_HEADER 0 "安裝程式已偵測到 Windows 使用鍵盤的 Alt 鍵 + Shift 鍵作為切換快捷鍵。$\n$\n當您使用 ${APP_NAME} 時,您可以按下 Shift 來讓兩個視窗彼此貼齊。這表示切換快捷鍵與貼齊快捷鍵相同。當 ${APP_NAME} 內部嘗試阻止鍵盤快捷鍵的切換時,您按下 Shift 鍵拖曳視窗貼齊的功能將無法使用。$\n$\n因此您可以停用或改變鍵盤切換快捷鍵。按下「下一步」繼續動作。" 22 | LangString L10N_ALTSHIFT_BUTTON 0 "開啟鍵盤快捷鍵設定(&O)" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "登錄檔最佳化" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "此最佳化是可選的選項,讓 ${APP_NAME} 能免於意外地終止。" 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "在 Windows 7 中微軟增加了一個功能,讓長時間沒有回應的鍵盤與滑鼠 Hook 變為停用狀態。不幸的是,這個檢查很容易出錯,特別是當您讓電腦長時間休眠、睡眠或鎖定的時候。$\n$\n若是發生此情形,您會發現 ${APP_NAME} 無預警的停止工作,接著您得手動停用再啟用 ${APP_NAME} 以讓它能再次正常執行。$\n$\n最佳化此登錄檔可以讓 Windows 在停止 hooks 前的等待時間變長,您可以使用底下的按鈕啟用或停用此選項。請注意:這個登錄檔最佳化完全是可選的選項。" 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "啟用登錄檔最佳化(&E)" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "停用登錄檔最佳化(&D)" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "此登錄檔最佳化早已被套用。" 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "此變更將於下次登入時套用。" 31 | -------------------------------------------------------------------------------- /localization/ja_JP/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - ja-JP localization by kakakaya 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Japanese" ; English name of this language 9 | LangString L10N_LANG ${LANG_JAPANESE} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "インストール済み" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "${APP_NAME}のインストール方法を選択してください。" 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME}は既にこのコンピュータにインストールされています。行いたい操作を選択してください。" 14 | LangString L10N_UPGRADE_UPGRADE 0 "(&U)${APP_NAME}を更新する(${APP_VERSION})。" 15 | LangString L10N_UPGRADE_INI 0 "今までの設定は${APP_NAME}-old.iniにコピーされます。" 16 | LangString L10N_UPGRADE_INSTALL 0 "(&I)新しい場所にインストールする。" 17 | LangString L10N_UPGRADE_UNINSTALL 0 "(&n)${APP_NAME}をアンインストールする。" 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "キーボードショートカット" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Alt + Shiftはこのプログラムと競合しています: ${APP_NAME}。" 21 | LangString L10N_ALTSHIFT_HEADER 0 "Windowsのキーボードレイアウトを変更するショートカットキーがAlt+Shiftに設定されていることが検出されました。$\n$\n${APP_NAME}では、Shiftを押しながらウィンドウをドラッグすることで他のウィンドウにスナップさせられます。つまり、スナップさせようとしてキーボードレイアウトが変わってしまうかもしれません。${APP_NAME}はキーボードレイアウトの変更をさせないように試しますが、もしウィンドウをドラッグし始める前にShiftキーを押していたら上手く動作しません。$\n$\nこのボタンを押すことで、キーボードレイアウト変更のショートカットキーを無効化したり、別のショートカットキーに割り当てを変更することができます。" 22 | LangString L10N_ALTSHIFT_BUTTON 0 "(&O)キーボード設定を開く" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "レジストリ変更" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "${APP_NAME}が突然停止することを防ぎます。" 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "MicrosoftはWindows 7に、時間が掛かるキーボードやマウス操作へのフックを停止する機能を付加しました。これは、コンピュータを頻繁に休止や、スリープ、ロックする時にしばしば誤って動作します。$\n$\nそのような場合、${APP_NAME}は動かなくなってしまい、直すには動作を一旦停止させてから再度有効化させる必要があります。$\n$\n下のボタンからレジストリ変更を有効化・無効化することで、Windowsがフックの停止をするまでの時間を伸ばすことができます。この変更は現在のユーザにのみ反映されます。レジストリ変更をしなくてもAltDragは利用可能です。" 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "(&E)レジストリ変更を有効化する" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "(&D)レジストリ変更を無効化する" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "レジストリ変更は既に行われています。" 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "この変更は次にログインした時から有効になります。" 31 | -------------------------------------------------------------------------------- /localization/ko_KR/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - ko-KR localization by @jeyraof 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Korean" ; English name of this language 9 | LangString L10N_LANG ${LANG_KOREAN} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "이미 설치 되었습니다." 12 | LangString L10N_UPGRADE_SUBTITLE 0 "${APP_NAME}을 설치할 방법을 선택하세요." 13 | LangString L10N_UPGRADE_HEADER 0 "이 컴퓨터에 ${APP_NAME}이 이미 설치되어 있습니다. 원하는 동작을 선택하고, 다음을 눌러 진행하세요." 14 | LangString L10N_UPGRADE_UPGRADE 0 "(&U) ${APP_NAME}을 ${APP_VERSION}로 업그레이드 합니다." 15 | LangString L10N_UPGRADE_INI 0 "기존 세팅을 ${APP_NAME}-old.ini 파일로 백업합니다." 16 | LangString L10N_UPGRADE_INSTALL 0 "(&I) 새로운 위치에 설치합니다." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "${APP_NAME}을 제거합니다." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "키보드 단축키" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "단축키 Alt + Shift 가 ${APP_NAME}과 충돌합니다." 21 | LangString L10N_ALTSHIFT_HEADER 0 "현재 키보드 레이아웃을 변경하기 위한 윈도우 단축키가 Alt + Shift 인것을 감지했습니다.$\n$\n${APP_NAME}을 사용하는 동안, 창을 드래그 할때 Shift 를 눌러 다른 창에 달라붙게 만들 수 있습니다. 키보드 레이아웃을 변경하기 위한 단축키와 같은 동작을 하는것을 의미합니다. ${APP_NAME}이 내부적으로 갑작스런 키보드 레이아웃 변경을 차단하려는동안, 창을 드래그 시작하기 전에 Shift 를 누른다면 동작하지 않습니다. 이 버튼을 눌러 키보드 레이아웃 변경을 위한 단축키를 비활성화 혹은 변경할 수 있습니다. 다음을 눌러 진행하세요." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "(&O) 키보드 세팅 열기" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "레지스트리 수정" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "${APP_NAME}이 갑작스럽게 멈추는것을 방지합니다." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "윈도우 7 에서는 반응하기에 너무 길면 키보드와 마우스의 훅을 멈추는 기능이 추가되었습니다. 불행히도 이 기능은 잘못되게 동작할 수 있습니다. 특히 절전모드 혹은 잠금화면으로 들어갈때 자주 발생합니다.$\n$\n만약 이런일이 발생한다면, 경고 없이 ${APP_NAME}이 작동을 멈추는것을 찾고 직접 ${APP_NAME}을 종료 후 재실행 하셔야 합니다.$\n$\n이 레지스트리 수정은 윈도우가 훅이 멈추기 전에 더 길게 기다리도록 만듭니다. 아래의 버튼으로 활성화 혹은 비활성화 하실 수 있습니다. 이 옵션은 선택이라는것을 인지해 주십시오." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "(&E) 레지스트리 수정 활성화" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "(&D) 레지스트리 수정 비활성화" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "레지스트리 수정이 이미 적용되었습니다." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "이 변경은 컴퓨터를 재시작하면 반영됩니다." 31 | -------------------------------------------------------------------------------- /include/autostart.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | // No error reporting since we don't want the user to be interrupted 11 | void CheckAutostart(int *on, int *hidden, int *elevated) { 12 | *on = *hidden = *elevated = 0; 13 | // Read registry 14 | HKEY key; 15 | wchar_t value[MAX_PATH+20] = L""; 16 | DWORD len = sizeof(value); 17 | RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_QUERY_VALUE, &key); 18 | RegQueryValueEx(key, APP_NAME, NULL, NULL, (LPBYTE)value, &len); 19 | RegCloseKey(key); 20 | // Compare 21 | wchar_t path[MAX_PATH], compare[MAX_PATH+20]; 22 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 23 | swprintf(compare, ARRAY_SIZE(compare), L"\"%s\"", path); 24 | if (wcsstr(value,compare) != value) { 25 | return; 26 | } 27 | // Autostart is on, check arguments 28 | *on = 1; 29 | if (wcsstr(value,L" -hide") != NULL) { 30 | *hidden = 1; 31 | } 32 | if (wcsstr(value,L" -elevate") != NULL) { 33 | *elevated = 1; 34 | } 35 | } 36 | 37 | void SetAutostart(int on, int hide, int elevate) { 38 | // Open key 39 | HKEY key; 40 | int error = RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, NULL, 0, KEY_SET_VALUE, NULL, &key, NULL); 41 | if (error != ERROR_SUCCESS) { 42 | Error(L"RegCreateKeyEx(HKEY_CURRENT_USER,'Software\\Microsoft\\Windows\\CurrentVersion\\Run')", L"Error opening the registry.", error); 43 | return; 44 | } 45 | if (on) { 46 | // Get path 47 | wchar_t path[MAX_PATH], value[MAX_PATH+20]; 48 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 49 | swprintf(value, ARRAY_SIZE(value), L"\"%s\"%s%s", path, (hide?L" -hide":L""), (elevate?L" -elevate":L"")); 50 | // Set autostart 51 | error = RegSetValueEx(key, APP_NAME, 0, REG_SZ, (LPBYTE)value, (wcslen(value)+1)*sizeof(value[0])); 52 | if (error != ERROR_SUCCESS) { 53 | Error(L"RegSetValueEx('"APP_NAME"')", L"SetAutostart()", error); 54 | return; 55 | } 56 | } 57 | else { 58 | // Remove 59 | error = RegDeleteValue(key, APP_NAME); 60 | if (error != ERROR_SUCCESS) { 61 | Error(L"RegDeleteValue('"APP_NAME"')", L"SetAutostart()", error); 62 | return; 63 | } 64 | } 65 | // Close key 66 | RegCloseKey(key); 67 | } 68 | -------------------------------------------------------------------------------- /localization/zh_CN/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Jack Jin and alex310110 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings zh_CN = { 13 | L"zh-CN", 14 | L"Chinese", 15 | L"简体", 16 | L"Jack Jin and alex310110", 17 | L"AltDrag", 18 | L"AltDrag (禁止)", 19 | L"允许", 20 | L"禁止", 21 | L"隐藏通知栏图标", 22 | L"发现有可用的更新!", 23 | L"打开设置", 24 | L"关于", 25 | L"退出", 26 | L"发现新版本!", 27 | L"有可用的新版本。打开AltDrag网站吗?", 28 | L"没有可用的更新。", 29 | L"AltDrag 配置", 30 | L"通用", 31 | L"鼠标和键盘", 32 | L"排除列表", 33 | L"增强", 34 | L"关于", 35 | L"通用设置", 36 | L"(&F)拖动时聚焦窗口\nCtrl也可以聚焦到窗口", 37 | L"(&n)Win7窗口贴边自动调整", 38 | L"(&S)滚动非活动窗口", 39 | L"&MDI支持", 40 | L"自动吸附在:", 41 | L"禁止", 42 | L"到屏幕边缘", 43 | L"+ 在窗口外", 44 | L"+ 在窗口内", 45 | L"语言:", 46 | L"随系统自动启动", 47 | L"(&t)登录时启动AltDrag", 48 | L"(&H)隐藏通知栏图标", 49 | L"(&E)提升至超级用户权限", 50 | L"注意,除非你完全禁用UAC,否则每次登录都会出现UAC提示。", 51 | L"(&l)提升", 52 | L"已经提升", 53 | L"这会创建一个新的以超级用户权限运行的AltDrag实例。以允许AltDrag管理其他以超级用户权限运行的程序。\n\n。在弹出UAC提示时,你必须同意AltDrag以超级用户权限运行", 54 | L"提升过程终止。", 55 | L"注意: 设置改动后会立即保存!", 56 | L"鼠标动作", 57 | L"鼠标左键:", 58 | L"鼠标中键:", 59 | L"鼠标右键:", 60 | L"鼠标第4键:", 61 | L"鼠标第5键:", 62 | L"滚动:", 63 | L"(&L)通过鼠标中键单击标题栏来降低窗口层次", 64 | L"移动", 65 | L"更改大小", 66 | L"关闭", 67 | L"最小化", 68 | L"降低", 69 | L"一直在最上层", 70 | L"居中", 71 | L"无动作", 72 | L"Alt+Tab", 73 | L"音量", 74 | L"透明度", 75 | L"热键", 76 | L"(&e)左Alt", 77 | L"(&R)右Alt", 78 | L"左&Winkey", 79 | L"右W&inkey", 80 | L"左&Ctrl", 81 | L"右C&trl", 82 | L"你可以通过修改ini配置文件来加入任何键!\n用shift键使窗口间进行吸附。", 83 | L"排除列表设置", 84 | L"按进程名称的排除列表:", 85 | L"排除列表:", 86 | L"自动吸附列表:", 87 | L"排除列表具体如何工作,请参阅AltDrag网站维基!", 88 | L"辩识窗口", 89 | L"全用此工具来辩识窗口的类名,以便于你在排除列表或自动吸附列表中进行添加。", 90 | L"增强设置", 91 | L"(&E)在普通移动中吸附窗口。\n与自动吸附同时工作!", 92 | L"注意这个特性不是100%安全的,因为他会对其他进程进行挂接或类似操作。", 93 | L"(&u)自动检查更新", 94 | L"为&beta版检查更新", 95 | L"检查更新", 96 | L"AltDrag的设置保存在AltDrag.ini。有少量配置可以通过手工编辑此文件来更改。", 97 | L"打开&ini文件", 98 | L"关于AltDrag", 99 | L"版本 1.0", 100 | L"作者: Stefan Sundin", 101 | L"AltDrag 是自由和开源软件!\n迎重新发布!", 102 | L"(&D)捐赠", 103 | L"翻译贡献者", 104 | L"在禁用AltDrag时发生错误。这可能是因为windows已经禁用了在禁用AltDrag的勾子而引起的。\n\n如果是第一次发生这种情况,你可以安全的忽略并继续使用在禁用AltDrag。\n\n如果这个错误重复出现,你可以阅读wiki来防范这种情况的再次发生。 (在About页上寻找'在禁用AltDrag意外停止工作')", 105 | }; 106 | -------------------------------------------------------------------------------- /tools/export_l10n_ini.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | #define UNICODE 11 | #define _UNICODE 12 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #define APP_NAME L"AltDrag" 20 | #define APP_VERSION "1.0" 21 | #define HELP_URL "https://stefansundin.github.io/altdrag/doc/translate.html" 22 | 23 | #include "../localization/strings.h" 24 | 25 | void wcscpy_escape(wchar_t *dest, wchar_t *source) { 26 | // Copy from source to dest, escaping \n to \\n 27 | for (; *source != '\0'; source++,dest++) { 28 | if (*source == '\n') { 29 | *dest = '\\'; 30 | dest++; 31 | *dest = 'n'; 32 | } 33 | else { 34 | *dest = *source; 35 | } 36 | } 37 | *dest = '\0'; 38 | } 39 | 40 | int main(int argc, char *argv[]) { 41 | char utf16le_bom[2] = { 0xFF, 0xFE }; 42 | int i,j; 43 | for (i=0; i < ARRAY_SIZE(languages); i++) { 44 | l10n = languages[i]; 45 | if (l10n == &en_US) { 46 | continue; 47 | } 48 | 49 | wchar_t ini[MAX_PATH]; 50 | GetModuleFileName(NULL, ini, ARRAY_SIZE(ini)); 51 | PathRemoveFileSpec(ini); 52 | wcscat(ini, L"\\"); 53 | wcscat(ini, l10n->code); 54 | wcscat(ini, L"\\Translation.ini"); 55 | 56 | FILE *f = _wfopen(ini, L"wb"); 57 | fwrite(utf16le_bom, 1, sizeof(utf16le_bom), f); // Write BOM 58 | fwprintf(f, L"; Translation file for "APP_NAME" "APP_VERSION"\n\ 59 | ; %s localization by %s\n\ 60 | ; Simply put this file in the same directory as "APP_NAME", then restart "APP_NAME".\n\ 61 | ; Please read the website for help: "HELP_URL"\n\ 62 | ; Use encoding UTF-16LE with BOM to be able to use Unicode\n\ 63 | \n\ 64 | ", l10n->code, l10n->author); 65 | fclose(f); 66 | 67 | for (j=0; j < ARRAY_SIZE(l10n_mapping); j++) { 68 | wchar_t txt[3000]; 69 | // Get pointer to string 70 | wchar_t *str = *(wchar_t**) ((void*)l10n + ((void*)l10n_mapping[j].str - (void*)&l10n_ini)); 71 | // Escape 72 | wcscpy_escape(txt, str); 73 | // Remove version number from about.version 74 | if (l10n_mapping[j].str == &l10n_ini.about.version) { 75 | txt[wcslen(txt)-strlen(APP_VERSION)] = '\0'; 76 | if (txt[wcslen(txt)-1] == ' ') { 77 | txt[wcslen(txt)-1] = '\0'; 78 | } 79 | } 80 | // Write 81 | WritePrivateProfileString(L"Translation", l10n_mapping[j].name, txt, ini); 82 | } 83 | } 84 | 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /localization/zh_TW/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Zkm 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings zh_TW = { 13 | L"zh-TW", 14 | L"Taiwanese", 15 | L"繁體中文(台灣)", 16 | L"Zkm", 17 | L"AltDrag", 18 | L"AltDrag (停用)", 19 | L"啟用", 20 | L"停用", 21 | L"隱藏系統匣圖示", 22 | L"有可用的更新!", 23 | L"設定", 24 | L"關於", 25 | L"離開", 26 | L"發現新版本!", 27 | L"有新版本可以更新。是否前往官方網站下載?", 28 | L"無可用更新。", 29 | L"AltDrag 設定", 30 | L"一般", 31 | L"滑鼠與鍵盤", 32 | L"排除清單", 33 | L"進階", 34 | L"關於", 35 | L"一般設定", 36 | L"拖曳視窗時取得視窗焦點(&F)。\n您也可以按下 Ctrl 鍵取得視窗焦點。", 37 | L"仿Win7程式視窗靠近邊緣自動調整大小(&N)", 38 | L"滑鼠滾輪捲動未取得焦點的視窗(&S)", 39 | L"MDI 支援(&M)", 40 | L"自動貼齊至:", 41 | L"已停用", 42 | L"螢幕邊緣", 43 | L"+ 視窗外側", 44 | L"+ 視窗內側", 45 | L"語言:", 46 | L"系統啟動時自動啟動", 47 | L"登入時啟動 AltDrag(&T)", 48 | L"隱藏系統匣圖示(&H)", 49 | L"提升至 Administrator 權限(&E)", 50 | L"注意:除非您完整地停用UAC功能,否則UAC功能會在您每次登入時提示。", 51 | L"提升(&L)", 52 | L"已提升", 53 | L"這將會建立一個以 Administrator 權限執行的新 AltDrag 執行個體。這將允許 AltDrag 管理以 Administrator 權限執行的其他程式。\n\n您將需要同意以 Administrator 權限執行的 AltDrag 所引發的 Windows UAC 提示。", 54 | L"已終止提升過程。", 55 | L"注意:設定會在變更後立即儲存。", 56 | L"滑鼠動作", 57 | L"滑鼠左鍵:", 58 | L"滑鼠中鍵:", 59 | L"滑鼠右鍵:", 60 | L"滑鼠第4按鍵:", 61 | L"滑鼠第5按鍵:", 62 | L"滑鼠滾輪:", 63 | L"在視窗標題上按下滑鼠中鍵移至最下層(&L)", 64 | L"移動視窗", 65 | L"調整視窗大小", 66 | L"關閉視窗", 67 | L"最小化視窗", 68 | L"最下層化視窗", 69 | L"總在最上層", 70 | L"置中視窗於螢幕", 71 | L"無作用", 72 | L"Alt+Tab", 73 | L"音量", 74 | L"透明度", 75 | L"快捷鍵:", 76 | L"左側 Alt 鍵(&E)", 77 | L"右側 Alt 鍵(&R)", 78 | L"左側 Win 鍵(&W)", 79 | L"右側 Win 鍵(&I)", 80 | L"左側 Ctrl 鍵(&C)", 81 | L"右側 Ctrl 鍵(&T)", 82 | L"您可以編輯 ini 檔案增加快捷鍵。\n使用 shift 鍵以貼齊視窗。", 83 | L"排除清單設定", 84 | L"處理程序排除清單:", 85 | L"排除清單:", 86 | L"貼齊清單:", 87 | L"了解如何讓排除清單作用請閱讀官方網站的 wiki 頁面。", 88 | L"識別視窗", 89 | L"按下圖示以識別視窗的類別名稱以讓您增加它至排除清單或貼齊清單。", 90 | L"進階設定", 91 | L"當正常地移動視窗時啟用貼齊功能。\n視窗之間自動貼齊!(&E)", 92 | L"注意:連結其它處理程序功能並非 100% 安全。例如當遊玩有反外掛保護的遊戲就有可能有被 ban 的風險。\n\n您是否確定要啟用此功能?", 93 | L"自動檢查更新(&U)", 94 | L"檢查 Beta 版本(&B)", 95 | L"立即檢查(&C)", 96 | L"AltDrag 的設定以儲存至 AltDrag.ini。少部份可透過手動編輯此檔案來設定。", 97 | L"開啟 INI 檔案(&I)", 98 | L"關於 AltDrag", 99 | L"版本 1.0", 100 | L"作者:Stefan Sundin", 101 | L"AltDrag 是免費開源的軟體!\n歡迎重新封裝發佈!", 102 | L"贊助(&D)", 103 | L"翻譯作者", 104 | L"停用 AltDrag 時發生錯誤。這通常是由於 Windows 早已有停用 AltDrag 的勾點。\n\n若這是第一次發生,您可以安心地忽略它並繼續使用 AltDrag。\n\n若是重覆發生這種情形,您可以至官網 wiki 閱讀 關於 頁面的「AltDrag mysteriously stops working」以避免再次發生。", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/ru_RU/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - ru-RU localization by Nick Eoneof (eoneof@gmail.com) 2 | ; and Dmitry Trubin (dtruebin@gmail.com) 3 | ; 4 | ; This program is free software: you can redistribute it and/or modify 5 | ; it under the terms of the GNU General Public License as published by 6 | ; the Free Software Foundation, either version 3 of the License, or 7 | ; (at your option) any later version. 8 | 9 | !insertmacro MUI_LANGUAGE "Russian" 10 | LangString L10N_LANG ${LANG_RUSSIAN} "" 11 | 12 | LangString L10N_UPGRADE_TITLE 0 "Уже установлено" 13 | LangString L10N_UPGRADE_SUBTITLE 0 "Выберите параметры установки ${APP_NAME}." 14 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} уже установлена на этой системе. Выберите желаемое действие и нажмите «Далее», чтобы продолжить." 15 | LangString L10N_UPGRADE_UPGRADE 0 "&Обновить ${APP_NAME} до версии ${APP_VERSION}." 16 | LangString L10N_UPGRADE_INI 0 "Существующие настройки будут скопированы в ${APP_NAME}-old.ini." 17 | LangString L10N_UPGRADE_INSTALL 0 "Установить в другое &место." 18 | LangString L10N_UPGRADE_UNINSTALL 0 "У&далить ${APP_NAME}." 19 | 20 | LangString L10N_ALTSHIFT_TITLE 0 "Горячая клавиша" 21 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Сочетание Alt + Shift конфликтует с ${APP_NAME}." 22 | LangString L10N_ALTSHIFT_HEADER 0 "Установщик обнаружил, что сочетание Alt + Shift переключает раскладку клавиатуры.$\n$\nТак как ${APP_NAME}, использует то же сочетание для перетаскивания окон с пристыковкой, она может блокировать случайное переключение раскладки. Блокировка не удастся, если нажать Shift до начала перетаскивания.$\n$\nВы можете отключить или изменить сочетание, переключающее раскладку, нажав эту кнопку. Нажмите «Далее», чтобы продолжить." 23 | LangString L10N_ALTSHIFT_BUTTON 0 "Настройки &клавиатуры" 24 | 25 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Твик реестра" 26 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Твик, позволяющий предотвратить внезапную остановку ${APP_NAME}." 27 | LangString L10N_HOOKTIMEOUT_HEADER 0 "В Windows 7, Microsoft реализовали функцию, которая останавливает перехват нажатий клавиатуры и мыши, если они занимают слишком много времени. К сожалению, очень часто эта функция срабатывает ошибочно (особенно, если вы отправили компьютер в гибернацию, режим сна или заблокировали систему).$\n$\nЕсли это произошло, ${APP_NAME} прекратит функционировать без предупреждения и для возобновления работы вам будет необходимо вручную выключить и включить ${APP_NAME}. $\n$\nСуществует твик реестра, увеличивающий время ожидания перед остановкой перехвата. Его можно включить и выключить кнопками ниже. Имейте ввиду, что этот твик не является обязательным." 28 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Включить твик реестра" 29 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Отключить твик реестра" 30 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "Твик реестра уже включен." 31 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "Изменения вступят в силу при следующем входе в систему." 32 | -------------------------------------------------------------------------------- /localization/sk_SK/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - sk-SK localization by Miroslav Miklus (miroslav.miklus@gmail.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Slovak" 9 | LangString L10N_LANG ${LANG_SLOVAK} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Aplikácia už je nainštalovaná" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Zvoľte si prosím spôsob inštalácie ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} už je na tomto systéme nainštalovaná. Zvoľte prosím operáciu, ktorú si želáte vykonať." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Upgrade ${APP_NAME} na ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Existujúce nastavenia sa skopírujú do ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Inštalovať na novú lokalitu." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "&Odinštalovať ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Klávesová skratka" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Klávesová skratka Alt + Shift už je používaná aplikáciou ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "Inštalátor zistil, že klávesová skratka Alt + Shift je používaná na prepínanie rozloženia klávesnice.$\n$\nPomocou ${APP_NAME}, je možné počas presúvania okien prilepiť jedno k druhému podržaním klávesy Shift. To znamená, že budete používať kombináciu kláves Alt + Shift. Tú istú kombináciu ktorú používate na prepínanie rozloženia klávesnice. Aj keď sa ${APP_NAME} blokuje náhodné prepnutie rozloženia klávesnice, nie je to možné ak stlačíte Shift ešte pred prenosom samotného okna.$\n$\nPo stlačení tlačidla $\"Nastaviť$\" môžete túto klávesovú skratku vypnúť, či zmeniť." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Nastaviť" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Registry tweak" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Optional tweak to keep ${APP_NAME} from stopping unexpectedly." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7, Microsoft implemented a feature that stops keyboard and mouse hooks if they take too long to respond. Unfortunately, this check can erroneously misbehave, especially if you hibernate, sleep, or lock the computer a lot.$\n$\nIf this happens, you will find that ${APP_NAME} stop functioning without warning, and you have to manually disable and enable ${APP_NAME} to make it work again.$\n$\nThere is a registry tweak to make Windows wait longer before stopping hooks, which you can enable or disable by using the buttons below. Please note that this registry tweak is completely optional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Enable registry tweak" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Disable registry tweak" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "The registry tweak has already been applied." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "The change will take effect on your next login." 31 | -------------------------------------------------------------------------------- /localization/en_US/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - en-US localization by Stefan Sundin 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "English" ; English name of this language 9 | LangString L10N_LANG ${LANG_ENGLISH} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Already Installed" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Choose how you want to install ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} is already installed on this system. Select the operation you want to perform and click Next to continue." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Upgrade ${APP_NAME} to ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Your existing settings will be copied to ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Install to a new location." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "Unins&tall ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Keyboard Shortcut" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "The shortcut Alt + Shift conflicts with ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "The installer has detected that the Windows shortcut to toggle the current keyboard layout is Alt + Shift.$\n$\nWhen using ${APP_NAME}, you can press Shift while dragging windows to make them snap to other windows. This means you are likely to press Alt + Shift, the same combination which toggles your keyboard layout. While ${APP_NAME} internally tries to block accidentally switching the keyboard layout, it will not succeed if you press Shift before you start dragging a window.$\n$\nYou can disable or change the shortcut which toggles the keyboard layout by pressing this button. Click Next to continue." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Open keyboard settings" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Registry tweak" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Optional tweak to keep ${APP_NAME} from stopping unexpectedly." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7, Microsoft implemented a feature that stops keyboard and mouse hooks if they take too long to respond. Unfortunately, this check can erroneously misbehave, especially if you hibernate, sleep, or lock the computer a lot.$\n$\nIf this happens, you will find that ${APP_NAME} stop functioning without warning, and you have to manually disable and enable ${APP_NAME} to make it work again.$\n$\nThere is a registry tweak to make Windows wait longer before stopping hooks, which you can enable or disable by using the buttons below. The tweak will only affect the current user. Please note that this registry tweak is completely optional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Enable registry tweak" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Disable registry tweak" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "The registry tweak has already been applied." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "The change will take effect on your next login." 31 | -------------------------------------------------------------------------------- /localization/ca_ES/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - ca-ES localization by Àlfons Sánchez 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Catalan" 9 | LangString L10N_LANG ${LANG_CATALAN} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Ja instal·lat" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Selecciona com instal·lar ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} ja està instal·lat en aquest sistema. Selecciona la operació a realitzar i clica Següent per continuar." 14 | LangString L10N_UPGRADE_UPGRADE 0 "Act&ualitza ${APP_NAME} a ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Els teus paràmetres existents es copiaran a ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Instal·la en una nova ubicació." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "Desins&tal·la ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Drecera de teclat" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "La drecera Alt + Majúscules entra en conflicte amb ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "El instal·lador ha detectat que la drecera de Windows per canviar la distribució de teclat és Alt + Shift.$\n$\nQuan uses ${APP_NAME}, pots premer Majúscules mentre arrossegues finestres per fer que s'adapten automàticament a altres. Açò implica que probablement premes Alt + Shift, la mateixa combinació que canvia la distribució de teclat. Mentre ${APP_NAME} intenta internament bloquejar un canvi accidental de la distribució de teclat, no funcionarà si prems Majúscules abans d'iniciar l'arrossegament.$\n$\nPots desactivar o canviar la drecera que canvia la distribució de teclat fent clic en aquest botó. Fes clic en Següent per continuar." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Obrir paràmetres de teclat" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Alteració del registre" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Alteració opcional per evitar que ${APP_NAME} es tanqui inesperadament." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "En Windows 7, Microsoft va implementar una característica que fa que els ganxos de teclat i ratolí es desactiven si triguen a respondre. Malauradament, aquesta comprovació pot comportar-se inadequadament, especialment s'hibernes, suspens o bloquejes l'ordinador a sovint.$\n$\nSi açò passa, trobaràs que ${APP_NAME} deixa de funcionar sense avís, i hauràs de desactivar i tornar a activar manualment ${APP_NAME} per fer que torni a funcionar.$\n$\nHi ha una alteració del registre per fer que Windows esperi més abans de desactivar els ganxos, i pots activar i desactivar-la amb els botons de sota. Nota: l'alteració és opcional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "Activar alt&eració del registre" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Desactivar alteració del reg." 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "L'alteració del registre ja s'ha aplicat." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "El canvi tindrà efecte al pròxim inici de sessió." 31 | -------------------------------------------------------------------------------- /localization/pl_PL/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - pl-PL localization by Krystian Maksymowicz (krystian.maksymowicz@gmail.com) and Paweł 'Pawouek' Krafczyk (pkrafczyk@gmail.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Polish" 9 | LangString L10N_LANG ${LANG_POLISH} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Już zainstalowany" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Wybierz sposób instalacji ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} już jest zainstalowany. Wybierz jedną z poniższych czynności i klinknij Dalej by kontynuować." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Uaktualniono ${APP_NAME} do wersji ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Twoje aktualne ustawienia będą skopiowane do ${APP_NAME}-stary.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Zainstaluj w innej lokacji." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "&Odinstaluj ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Skrót klawiszowy" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Skrót klawiszowy Alt + Shift jest w konflikcie z ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "Instalator wykrył, że system korzysta z kombinacji klawiszy Alt + Shift przy zmianie układu klawiatury.$\n$\nPrzy korzystaniu z ${APP_NAME} możesz przytrzymać Shift podczas przeciągania okna by dokować je do krawędzi innego okna. Oznacza to, że prawdopodobne iż wciśniesz Alt + Shift, co również spowoduje zmianę układu klawiatury. Mimo iż ${APP_NAME} stara się blokować przypadkowe zmiany układu klawiatury to nie będzie to możliwe, gdy klawisz Shift będzie wciśnięty przed rozpoczęciem przeciągania okna.$\n$\nMożesz wyłączyć lub zmienić skrót klawiszowy do zmiany układu klawiatury wciskając ten przycisk. Wciśnij Dalej by kontynuować." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Otwórz ustawienia klawiszy" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Registry tweak" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Optional tweak to keep ${APP_NAME} from stopping unexpectedly." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7, Microsoft implemented a feature that stops keyboard and mouse hooks if they take too long to respond. Unfortunately, this check can erroneously misbehave, especially if you hibernate, sleep, or lock the computer a lot.$\n$\nIf this happens, you will find that ${APP_NAME} stop functioning without warning, and you have to manually disable and enable ${APP_NAME} to make it work again.$\n$\nThere is a registry tweak to make Windows wait longer before stopping hooks, which you can enable or disable by using the buttons below. Please note that this registry tweak is completely optional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Enable registry tweak" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Disable registry tweak" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "The registry tweak has already been applied." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "The change will take effect on your next login." 31 | -------------------------------------------------------------------------------- /localization/fr_FR/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - fr-FR localization by Samy Mechiri (samy.mechiri@kxen.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "French" 9 | LangString L10N_LANG ${LANG_FRENCH} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Déjà installé" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Choisissez comment vous désirez installer ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} est déjà installé sur ce système. Choisissez une opération et clickez sur Suivant pour continuer." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Mettre à jour ${APP_NAME} vers ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Vos paramètres précédents seront copiés dans ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Installer dans un nouveau dossier." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "&Désinstaller ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Raccourcis clavier" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Le raccourci Alt + Shift est en conflit avec ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "L'installeur à détécté que le raccourci de Windows pour changer la configuration du clavier est Alt + Shift.$\n$\nEn utilisant ${APP_NAME}, vous pouvez maintenir Shift en faisant glisser des fenêtres pour aimanter les fenêtres. Celà signifie que vous pourrez être amenés à tapper Alt + Shift, la même combinaison de touche qui change la configuration du clavier. ${APP_NAME} tente d'empecher le changement accidentel de configuration du clavier, cependant il ne pourra le faire si vous maintenez Shift avant de faire glisser une fenêtre.$\n$\nVous pouvez désactiver ou modifier le raccourcis qui change la configuration du clavier en cliquant sur le bouton ci-dessous. Cliquez sur Suivant pour continuer." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Paramètres clavier" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Registry tweak" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Optional tweak to keep ${APP_NAME} from stopping unexpectedly." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7, Microsoft implemented a feature that stops keyboard and mouse hooks if they take too long to respond. Unfortunately, this check can erroneously misbehave, especially if you hibernate, sleep, or lock the computer a lot.$\n$\nIf this happens, you will find that ${APP_NAME} stop functioning without warning, and you have to manually disable and enable ${APP_NAME} to make it work again.$\n$\nThere is a registry tweak to make Windows wait longer before stopping hooks, which you can enable or disable by using the buttons below. Please note that this registry tweak is completely optional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Enable registry tweak" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Disable registry tweak" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "The registry tweak has already been applied." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "The change will take effect on your next login." 31 | -------------------------------------------------------------------------------- /localization/pt_BR/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - pt-BR localization by Jucá Costa (virgilino@gmail.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "PortugueseBR" 9 | LangString L10N_LANG ${LANG_PORTUGUESEBR} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Já instalado" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Escolha o modo de instalação de ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} já está instalado neste sistema. Selecione a operação a ser executada e clique em Próximo para continuar." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Atualizar ${APP_NAME} para a versão ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Suas configurações já existentes serão copiadas para ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Instalar em outra pasta." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "&Desinstalar ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Atalho de teclado" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "O atalho Alt + Shift entra em conflito com ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "O instalador detectou que o atalho do Windows para alternar o layout do teclado é Alt + Shift.$\n$\nAo utilizar o ${APP_NAME}, você pode pressionar Shift enquanto arrasta uma janela para alinhá-la com outras janelas. Isso significa que é provável que você pressione Alt + Shift, a mesma combinação que alterna o layout do teclado. Ainda que o ${APP_NAME} tente bloquear estas mudanças acidentais, ele poderá não conseguir se você pressionar Shift antes de começar a arrastar uma janela.$\n$\nVocê pode desativar ou mudar o atalho que alterna o layout do teclado pressionando o botão abaixo. Clique em Próximo para continuar." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Alterar teclados..." 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Ajuste do resgitro" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Ajuste opcional para evitar que o ${APP_NAME} pare de funcionar inesperadamente." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "No Windows 7, a Microsoft acrescentou uma ferramenta para interromper injeções (hooks) do teclado e mouse se eles demorassem a responder. Infelizmente, esta verificação pode equivocadamente se comportar mal, especialmente se você hiberna, suspende ou troca de usuário frequentemente.$\n$\nSe isto acontecer, o ${APP_NAME} poderá parar de funcionar sem qualquer aviso, e você deverá desativá-lo e reativá-lo manualmente para que ele volte a funcionar.$\n$\nHá um ajuste no Registro do Windows para fazer com que o sistema aguarde mais tempo antes de interromper injeções (hooks). Você pode ativá-lo usando os botões abaixo. Note que este ajuste é completamente opcional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Ativar ajuste no registro" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Desativar ajuste no registro" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "O ajuste no registro já foi aplicado." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "A mudança será aplicada no seu próximo logon." 31 | -------------------------------------------------------------------------------- /localization/ko_KR/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Jeyraof 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings ko_KR = { 13 | L"ko-KR", 14 | L"Korean", 15 | L"Korean", 16 | L"Jeyraof", 17 | L"AltDrag", 18 | L"AltDrag (비활성화)", 19 | L"활성화", 20 | L"비활성화", 21 | L"트레이로 숨기기", 22 | L"최신버전이 있습니다!", 23 | L"설정", 24 | L"이 프로그램에 대해서", 25 | L"종료", 26 | L"새로운 버전을 찾았습니다.", 27 | L"새로운 버전을 찾았습니다. 웹사이트를 열겠습니까?", 28 | L"최신 버전입니다.", 29 | L"AltDrag 설정", 30 | L"일반", 31 | L"마우스, 키보드", 32 | L"블랙리스트", 33 | L"고급", 34 | L"정보", 35 | L"일반 설정", 36 | L"(&F) 드래그하는동안 창을 강조합니다.\nCtrl 키를 눌러서도 창을 강조할 수 있습니다.", 37 | L"(&n) 에어로 기능을 모방합니다.", 38 | L"(&S) 비활성화된 창을 스크롤합니다.", 39 | L"(&M)DI 지원", 40 | L"자동으로 대상에 맞춥니다:", 41 | L"비활성화", 42 | L"스크린 화면", 43 | L"+ 창 밖으로", 44 | L"+ 창 안으로", 45 | L"언어:", 46 | L"자동실행", 47 | L"(&t) 로그온 할때 자동으로 AltDrag 를 실행", 48 | L"(&H) 트레이로 숨기기", 49 | L"(&E) 관리자 권한으로 높히기", 50 | L"UAC를 완전히 비활성화 하지 않는 한, 로그인 할 때 마다 UAC 프롬프트가 나타납니다.", 51 | L"(&l) 높히기", 52 | L"관리자 권한입니다.", 53 | L"관리자 권한으로 새로운 AltDrag 인스턴스를 실행합니다. AltDrag가 관리자 권한으로 실행중인 다른 프로그램을 관리할 수 있도록 허락합니다.\n\nAltDrag를 관리자 권한으로 실행하기 위해서는 UAC 프롬프트를 승낙해야합니다.", 54 | L"높히기 취소", 55 | L"설정을 저장하고 즉시 반영됩니다.", 56 | L"마우스 동작", 57 | L"왼쪽 버튼:", 58 | L"가운데 버튼:", 59 | L"오른쪽 버튼:", 60 | L"추가버튼 4:", 61 | L"추가버튼 5:", 62 | L"스크롤 휠:", 63 | L"(&L) 제목 표시줄을 가운데 클릭 함으로써, 창을 줄입니다.", 64 | L"창 이동", 65 | L"창 사이즈 변경", 66 | L"창 닫기", 67 | L"창 최소화", 68 | L"창 줄이기", 69 | L"항상 위에", 70 | L"화면의 중앙", 71 | L"아무것도", 72 | L"Alt+Tab", 73 | L"소리", 74 | L"투명도", 75 | L"단축키:", 76 | L"(&e) 왼쪽 Alt 키", 77 | L"(&R) 오른쪽 Alt 키", 78 | L"(&W) 왼쪽 Windows 키", 79 | L"(&i) 오른쪽 Windows 키", 80 | L"(&C) 왼쪽 Ctrl 키", 81 | L"(&t) 오른쪽 Ctrl 키", 82 | L"ini 파일을 수정해서 단축키를 변경하거나 추가할 수 있습니다.\n창들을 붙이기(스냅) 위해서 Shift 키를 사용하세요.", 83 | L"블랙리스트 설정", 84 | L"프로세스 블랙리스트:", 85 | L"블랙리스트:", 86 | L"스냅리스트:", 87 | L"위키에서 블랙리스트의 설명을 보실 수 있습니다.", 88 | L"창 찾기", 89 | L"아이콘을 클릭해서 창을 블랙리스트 혹은 스냅리스트에 등록할 수 있습니다.", 90 | L"고급 설정", 91 | L"(&E) 일반적으로 창을 움직일때 스냅기능을 활성화합니다.\n자동으로 스냅기능이 작동합니다.", 92 | L"다른 프로세스를 후킹하여 사용하는 것이므로, 완전히 안전하지는 않다는걸 염두에 두십시오. 게임을 할때 게임가드와 충돌이 날 수 있습니다.\n\n정말 활성화 하시겠습니까?", 93 | L"(&u) 자동 업데이트 체크", 94 | L"(&b) 베타 버전 체크", 95 | L"(&C) 지금 업데이트 체크", 96 | L"AltDrag 의 설정은 AltDrag.ini 에 저장됩니다. 이 파일을 직접 수정해야만 사용가능한 몇가지의 기능들이 존재합니다.", 97 | L"(&i) ini 파일 열기", 98 | L"AltDrag 에 대하여", 99 | L"버전 1.0", 100 | L"제작: Stefan Sundin", 101 | L"AltDrag는 무료이며 오픈소스 소프트웨어입니다!\n마음껏 재배포하세요!", 102 | L"(&D)기부", 103 | L"@jeyraof", 104 | L"AltDrag을 비활성화시킨 에러가 있습니다. 이 에러는 AltDrag의 훅들이 이미 비활성화 된경우 자주 발생합니다.\n\n만약 이 에러가 처음이라면, 무시하고 AltDrag를 이용하시면 됩니다.\n\n만약 반복적으로 에러가 발생한다면, 위키에서 해결 방법을 읽으실 수 있습니다. (해당 문서: 'AltDrag mysteriously stops working' on the About page).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/it_IT/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - it-IT localization by Hexaae (hexaae@gmail.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Italian" 9 | LangString L10N_LANG ${LANG_ITALIAN} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Già installato" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Scegli come installare ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} è già istallato su questo sistema. Scegli cosa vuoi fare e clicca Avanti per continuare." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Aggiorna ${APP_NAME} alla ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Le tue impostazioni verranno copiate come ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Installa in una nuova posizione." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "Disins&talla ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Tasto di scelta rapida" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Il tasto di scelta rapida Alt + Shift è in conflitto con ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "L'installer ha trovato che il tasto di scelta rapida di Windows per cambiare la lingua di input è Alt + Maiusc.$\n$\nUtilizzando ${APP_NAME}, potrai premere Maiusc durante il trascinamento di una finestra per agganciarla alle altre. Ciò significa che andrai a premere Alt + Maiusc, la stessa combinazione per cambiare le lingue di input. Sebbene ${APP_NAME} provi internamente a bloccare cambi accidentali delle lingue di input, non ce la farà se premerai Maiusc prima di iniziare a trascinare la finestra.$\n$\nPuoi disattivare o modificare il tasto di selta rapida per cambiare le lingue di input premendo questo bottone. Premi Avanti per continuare." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "A&pri impostazioni tastiera" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Modifica al registro" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Modifica opzionale per evitare che ${APP_NAME} venga arrestato inaspettatamente." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7, Microsoft ha implementato una funzionalità che arresta gli hook a mouse e tastiera in caso di risposta troppo lunga. Sfortunatamente, questo controllo può dare risultati errati, specialmente in caso di ibernazione, sospensione, o se blocchi spesso il computer.$\n$\nSe accade, ti capiterà che ${APP_NAME} smetterà di funzionare senza avvertimenti, e dovrai manualmente disattivare e riattivare ${APP_NAME} perché torni a funzionare.$\n$\nC'è una modifica al registro affinché Windows attenda più a lungo prima di arrestare gli hook, che puoi attivare o disattivare utilizzando il pulsante in basso. Prego, nota che tale modifica al registro è assolutamente opzionale." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "Atti&va modifica al registro" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Disattiva modifica al registro" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "La modifica al registro è già stata applicata." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "Il cambiamento avrà effetto al prossimo accesso." 31 | -------------------------------------------------------------------------------- /localization/gl_ES/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - gl-ES localization by Jorge Amigo (alpof@yahoo.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Galician" 9 | LangString L10N_LANG ${LANG_GALICIAN} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Xa instalado" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Elixa cómo instalar ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} xa está instalado neste sistema. Escolla a operación que quere realizar e prema Seguinte para continuar." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Actualizar ${APP_NAME} a ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "A configuración existente será copiada a ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Instalar nunha nova ubicación." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "Desinstalar ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Atallo de teclado" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "O atallo Alt + Maiúsculas entra en conflicto con ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "O instalador detectou que o atallo de Windows para activa-la actual distribución de teclado é Alt + Maiúsculas.$\n$\nCando se usa ${APP_NAME}, pódese premer Maiúsculas mentres arrástranse as ventás para facer que se peguen a outras ventás. Esto significa que é posible que se prema Alt + Maiúsculas, a mesma combinación que activa a distribución de teclado. Mentres que ${APP_NAME} internamente trata de bloquea-lo cambio accidental de distribución de teclado, non o conseguirá se prémese Maiúsculas antes de comenza-lo arrastre dunha ventá.$\n$\nPódese deshabilitar ou cambia-lo atallo que activa a distribución de teclado premendo este botón. Prema Seguinte para continuar." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Abri-la configuración do teclado" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Axuste do rexistro" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Axuste opcional para evitar que ${APP_NAME} péchese inesperadamente." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "En Windows 7, Microsoft implementóu unha funcionalidade para evitar ganchos de teclado e rato se tardan de máis en respostar. Desgraciadamente, esta funcionalidade pode comportarse erróneamente, especialmente se hiberna, suspende o bloquéase moito o equipo.$\n$\nSe esto ocurre, observarase que ${APP_NAME} deixará de funcionar sen avisar, e ${APP_NAME} deberá ser manualmente deshabilitado e habilitado para facer que volte a funcionar.$\n$\nExiste un axuste de rexistro para facer que Windows espere máis tempo antes de para-los ganchos, que pode ser habilitado ou deshabilitado usando os botóns de abaixo. Por favor, nótese que este axuste de rexistro é completamente opcional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Habilita-lo axuste de rexistro" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Deshabilita-lo axuste de rexistro" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "O axuste de registro xa se aplicóu." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "O cambio farase efectivo no próximo inicio de sesión." 31 | -------------------------------------------------------------------------------- /include/tray.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | NOTIFYICONDATA tray; 11 | HICON icon[2]; 12 | int tray_added = 0; 13 | int hide = 0; 14 | extern int update; 15 | 16 | int InitTray() { 17 | // Load icons 18 | icon[0] = LoadImage(g_hinst, L"tray_disabled", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); 19 | icon[1] = LoadImage(g_hinst, L"tray_enabled", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); 20 | if (icon[0] == NULL || icon[1] == NULL) { 21 | Error(L"LoadImage('tray_*')", L"Could not load tray icons.", GetLastError()); 22 | return 1; 23 | } 24 | 25 | // Create icondata 26 | tray.cbSize = sizeof(NOTIFYICONDATA); 27 | tray.uID = 0; 28 | tray.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP; 29 | tray.hWnd = g_hwnd; 30 | tray.uCallbackMessage = WM_TRAY; 31 | // Balloon tooltip 32 | tray.uTimeout = 10000; 33 | wcsncpy(tray.szInfoTitle, APP_NAME, ARRAY_SIZE(tray.szInfoTitle)); 34 | tray.dwInfoFlags = NIIF_USER; 35 | 36 | // Register TaskbarCreated so we can re-add the tray icon if (when) explorer.exe crashes 37 | WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated"); 38 | 39 | return 0; 40 | } 41 | 42 | int UpdateTray() { 43 | wcsncpy(tray.szTip, (ENABLED()?l10n->tray_enabled:l10n->tray_disabled), ARRAY_SIZE(tray.szTip)); 44 | tray.hIcon = icon[ENABLED()?1:0]; 45 | 46 | // Only add or modify if not hidden or if balloon will be displayed 47 | if (!hide || tray.uFlags&NIF_INFO) { 48 | // Try until it succeeds, sleep 100 ms between each attempt 49 | while (Shell_NotifyIcon((tray_added?NIM_MODIFY:NIM_ADD),&tray) == FALSE) { 50 | Sleep(100); 51 | } 52 | // Success 53 | tray_added = 1; 54 | } 55 | return 0; 56 | } 57 | 58 | int RemoveTray() { 59 | if (!tray_added) { 60 | // Tray not added 61 | return 1; 62 | } 63 | 64 | if (Shell_NotifyIcon(NIM_DELETE,&tray) == FALSE) { 65 | Error(L"Shell_NotifyIcon(NIM_DELETE)", L"Failed to remove tray icon.", GetLastError()); 66 | return 1; 67 | } 68 | 69 | // Success 70 | tray_added = 0; 71 | return 0; 72 | } 73 | 74 | void ShowContextMenu(HWND hwnd) { 75 | POINT pt; 76 | GetCursorPos(&pt); 77 | HMENU menu = CreatePopupMenu(); 78 | 79 | InsertMenu(menu, -1, MF_BYPOSITION, SWM_TOGGLE, (ENABLED()?l10n->menu_disable:l10n->menu_enable)); 80 | InsertMenu(menu, -1, MF_BYPOSITION, SWM_HIDE, l10n->menu_hide); 81 | 82 | if (update) { 83 | InsertMenu(menu, -1, MF_BYPOSITION|MF_SEPARATOR, 0, NULL); 84 | InsertMenu(menu, -1, MF_BYPOSITION, SWM_UPDATE, l10n->menu_update); 85 | } 86 | 87 | InsertMenu(menu, -1, MF_BYPOSITION|MF_SEPARATOR, 0, NULL); 88 | InsertMenu(menu, -1, MF_BYPOSITION, SWM_CONFIG, l10n->menu_config); 89 | InsertMenu(menu, -1, MF_BYPOSITION, SWM_ABOUT, l10n->menu_about); 90 | 91 | InsertMenu(menu, -1, MF_BYPOSITION|MF_SEPARATOR, 0, NULL); 92 | InsertMenu(menu, -1, MF_BYPOSITION, SWM_EXIT, l10n->menu_exit); 93 | 94 | // Track menu 95 | SetForegroundWindow(hwnd); 96 | TrackPopupMenu(menu, TPM_BOTTOMALIGN, pt.x, pt.y, 0, hwnd, NULL); 97 | DestroyMenu(menu); 98 | } 99 | -------------------------------------------------------------------------------- /localization/nl_NL/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - nl-NL localization by Merijn Bosma (bosma@xs4all.nl) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Dutch" 9 | LangString L10N_LANG ${LANG_DUTCH} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Al geïnstalleerd" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Kies hoe u {APP_NAME} wilt installeren." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} is al geïnstalleerd op dit systeem. Kies wat u wilt doen en klik op Volgende om door te gaan." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Upgrade ${APP_NAME} naar ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Uw bestaande instellingen zullen gekopieerd worden naar ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Installeer op een nieuwe locatie." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "${APP_NAME} &deinstalleren." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Sneltoets" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "De sneltoets Alt + Shift conflicteerd met ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "De installatie heeft gedetecteerd dat de Windows sneltoets om de huidige toetsenbordindeling te schakelen Alt + Shift is.$\n$\nAls u ${APP_NAME} gebruikt kunt u Shift gebruiken tijdens het slepen om vensters aan elkaar te koppelen. Dit betekend dat het zeer waarschijnlijk is dat u Alt + Shift in zal drukken, dezelfde combinatie die uw toetsenbordindeling schakelt. ${APP_NAME} zal altijd proberen het foutief schakelen van de toetsenbord indeling te voorkomen, maar dit zal niet lukken als u Shift indrukt vóórdat u het venster gaat slepen.$\n$\nU kunt de sneltoets waarmee u de toetsenbordindeling schakelt veranderen door op deze knop te drukken. Druk op Volgende om door te gaan." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Open toetsenbordinstellingen" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Register instellingen" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Optionele instelling om te voorkomen dat ${APP_NAME} onverwachts stopt." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7 heeft Microsoft een optie ingebouwd, die toetsenbord- en muishaken uitschakeld als deze te lang niet reageren. Helaas kan deze optie zich onterecht misdragen, zeker als u de pc regelmatig in slaap- of sluimerstand zet, of vergrendeld.$\n$\nWanneer dit gebeurd zult u merken dat ${APP_NAME} zonder waarschuwing stopt met werken, en dat u handmatig {$APP_NAME} zult moeten uitschakelen en weer inschakelen, zodat het weer gaat werken.$\n$\nEr is een register instelling die ervoor zorgt dat Windows langer wacht voordat toetsenbord- en muishaken worden uitgeschakeld, die u aan- en uit kunt zetten met de knoppen hieronder. Deze register instellingen zijn optioneel." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "Register instellingen &inschakelen" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "Register instelling &uitschakelen" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "De register instelling is al uitgevoerd." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "De wijzigingen zullen van kracht worden hebben als u opnieuw inlogt." 31 | -------------------------------------------------------------------------------- /localization/es_ES/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - es-ES localization by Jorge Amigo (alpof@yahoo.com) 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "Spanish" 9 | LangString L10N_LANG ${LANG_SPANISH} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Ya instalado" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Elija cómo instalar ${APP_NAME}." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} ya está instalado en este sistema. Seleccione la operación que quiere realizar y pulse Siguiente para continuar." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Actualizar ${APP_NAME} a ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "La configuración existente será copiada a ${APP_NAME}-old.ini." 16 | LangString L10N_UPGRADE_INSTALL 0 "&Instalar en una nueva ubicación." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "Desinstalar ${APP_NAME}." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Atajo de teclado" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "El atajo Alt + Mayúsculas entra en conflicto con ${APP_NAME}." 21 | LangString L10N_ALTSHIFT_HEADER 0 "El instalador ha detectado que el atajo de Windows para activar la actual distribución de teclado es Alt + Mayúsculas.$\n$\nCuando se usa ${APP_NAME}, se puede pulsar Mayúsculas mientras se arrastran ventanas para hacer que se peguen a otras ventanas. Esto significa que es posible que se presione Alt + Mayúsculas, la misma combinación que activa la distribución de teclado. Mientras que ${APP_NAME} internamente trata de bloquear el cambio accidental de distribución de teclado, no lo conseguirá si se presiona Mayúsculas antes de comenzar a arrastrar una ventana.$\n$\nSe puede deshabilitar o cambiar el atajo que avtiva la distribución de teclado presionando este botón. Pulse Siguiente para continuar." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Abrir la configuración del teclado" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Ajuste del registro" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Ajuste opcional para evitar que ${APP_NAME} se cierre inesperadamente." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "En Windows 7, Microsoft implementó una funcionalidad para evitar ganchos de teclado y ratón si tardan demasiado en responder. Desgraciadamente, esta funcionalidad puede comportarse erróneamente, especialmente si se hiberna, suspende o bloquea mucho el equipo.$\n$\nSi esto ocurre, se observará que ${APP_NAME} dejará de funcionar sin ningún aviso, y ${APP_NAME} deberá ser manualmente deshabilitado y habilitado para hacer que vuelva a funcionar.$\n$\nExiste un ajuste de registro para hacer que Windows espere más tiempo antes de parar los ganchos, que puede ser habilitado o deshabilitado usando los botones de abajo. Por favor, nótese que este ajuste de registro es completamente opcional." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "&Habilitar el ajuste de registro" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "&Deshabilitar el ajuste de registro" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "El ajuste de registro ya ha sido aplicado." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "El cambio se hará efectivo en el próximo inicio de sesión." 31 | -------------------------------------------------------------------------------- /localization/de_DE/installer.nsh: -------------------------------------------------------------------------------- 1 | ; AltDrag - de-DE localization by Markus Hentsch 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | !insertmacro MUI_LANGUAGE "German" 9 | LangString L10N_LANG ${LANG_GERMAN} "" 10 | 11 | LangString L10N_UPGRADE_TITLE 0 "Bereits installiert" 12 | LangString L10N_UPGRADE_SUBTITLE 0 "Wählen Sie aus, wie ${APP_NAME} installiert werden soll." 13 | LangString L10N_UPGRADE_HEADER 0 "${APP_NAME} ist auf diesem System bereits installiert. Wählen Sie die gewünschte Aktion aus und klicken Sie auf Weiter um fortzufahren." 14 | LangString L10N_UPGRADE_UPGRADE 0 "&Aktualisierung von ${APP_NAME} auf ${APP_VERSION}." 15 | LangString L10N_UPGRADE_INI 0 "Ihre bisherigen Einstellungen werden nach ${APP_NAME}-old.ini kopiert." 16 | LangString L10N_UPGRADE_INSTALL 0 "An einem neuen Ort &installieren." 17 | LangString L10N_UPGRADE_UNINSTALL 0 "${APP_NAME} &deinstallieren." 18 | 19 | LangString L10N_ALTSHIFT_TITLE 0 "Tastenkombination" 20 | LangString L10N_ALTSHIFT_SUBTITLE 0 "Die Tastenkombination Alt + Shift steht mit ${APP_NAME} im Konflikt." 21 | LangString L10N_ALTSHIFT_HEADER 0 "Das Installationsprogramm hat festgestellt, dass Alt + Shift derzeit von Windows dazu verwendet wird, das Tastaturlayout umzuschalten.$\n$\nMit ${APP_NAME} können bewegte Fenster bei gedrückter Shift-Taste aneinander eingerastet werden. Es kann also vorkommen, dass Sie damit versehentlich das Tastaturlayout ändern. ${APP_NAME} versucht zwar intern das Wechseln des Tastaturlayouts zu verhindern, scheitert aber wenn Sie die Shift-Taste drücken noch bevor Sie das Fenster bewegen.$\n$\nSie können die Tastenkombination zum Umschalten des Tastaturlayouts ändern, indem Sie auf den nachfolgenden Button klicken. Klicken Sie auf Weiter um fortzufahren." 22 | LangString L10N_ALTSHIFT_BUTTON 0 "&Einstellungen öffnen" 23 | 24 | LangString L10N_HOOKTIMEOUT_TITLE 0 "Registry-Tweak" 25 | LangString L10N_HOOKTIMEOUT_SUBTITLE 0 "Optionaler Tweak um zu verhindern, dass ${APP_NAME} unerwartet beendet wird." 26 | LangString L10N_HOOKTIMEOUT_HEADER 0 "In Windows 7 hat Microsoft eine Funktion implementiert, die Tastatur- und Maus-Hooks selbstständig beendet, sobald diese eine zu große Antwortverzögerung haben. Leider kommt es vor, dass diese Funktion fälschlicherweise ausgelöst wird, wenn der Computer oft gesperrt oder in Ruhezustand bzw. Standby versetzt wird.$\n$\nWenn das passiert, wird ${APP_NAME} ohne jegliche Warnung aufhören zu funktionieren und muss manuell deaktiviert und wieder aktiviert werden.$\n$\nEs gibt einen Registry-Tweak um Windows dazu zu bringen, länger auf Hooks zu warten bevor sie beendet werden. Sie können diesen über die nachfolgenden Buttons aktivieren oder deaktivieren. Bitte beachten Sie, dass dieser Registry-Tweak völlig optional ist." 27 | LangString L10N_HOOKTIMEOUT_APPLYBUTTON 0 "Registry-Tweak a&ktivieren" 28 | LangString L10N_HOOKTIMEOUT_REVERTBUTTON 0 "Registry-Tweak &deaktivieren" 29 | LangString L10N_HOOKTIMEOUT_ALREADYAPPLIED 0 "Der Registry-Tweak wurde bereits aktiviert." 30 | LangString L10N_HOOKTIMEOUT_FOOTER 0 "Die Änderung wird bei Ihrer nächsten Anmeldung übernommen." 31 | -------------------------------------------------------------------------------- /include/error.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | int showerror = 1; 11 | 12 | 13 | #if defined(DEBUG) || defined(ERROR_WRITETOFILE) 14 | 15 | #include 16 | wchar_t log_filename[1000] = L""; 17 | 18 | FILE *OpenLog(wchar_t *mode) { 19 | //return stdout; 20 | // Put the file on the desktop (since we should always be able to write there) 21 | if (log_filename[0] == '\0') { 22 | SHGetFolderPath(NULL, CSIDL_DESKTOP, NULL, SHGFP_TYPE_CURRENT, log_filename); 23 | wcscat(log_filename, L"\\"APP_NAME"-log.txt"); 24 | } 25 | FILE *f = _wfopen(log_filename, mode); 26 | if (f == NULL) { 27 | // If it fails to open the file, it should print to the terminal (recompile with -mconsole) 28 | return stdout; 29 | } 30 | return f; 31 | } 32 | 33 | void CloseLog(FILE *f) { 34 | if (f != stdout) { 35 | fclose(f); 36 | } 37 | } 38 | 39 | #endif 40 | 41 | 42 | LRESULT CALLBACK ErrorMsgProc(INT nCode, WPARAM wParam, LPARAM lParam) { 43 | if (nCode == HCBT_ACTIVATE) { 44 | // Edit the caption of the buttons 45 | SetDlgItemText((HWND)wParam, IDYES, L"Copy error"); 46 | SetDlgItemText((HWND)wParam, IDNO, L"OK"); 47 | } 48 | return 0; 49 | } 50 | 51 | void _Error(wchar_t *func, wchar_t *info, int errorcode, wchar_t *file, int line) { 52 | if (!showerror) { 53 | return; 54 | } 55 | // Format message 56 | wchar_t msg[1000], *errormsg; 57 | int length = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorcode, 0, (wchar_t*)&errormsg, 0, NULL); 58 | if (length != 0) { 59 | errormsg[length-2] = '\0'; // Remove that damn newline at the end of the formatted error message 60 | } 61 | swprintf(msg, ARRAY_SIZE(msg), L"%s failed in file %s, line %d.\nError: %s (%d)\n\n%s", func, file, line, errormsg, errorcode, info); 62 | LocalFree(errormsg); 63 | // Display message 64 | #ifdef ERROR_WRITETOFILE 65 | FILE *f = OpenLog(L"ab"); 66 | fputws(msg, f); 67 | fputws(L"\n\n", f); 68 | CloseLog(f); 69 | #else 70 | // Tip: You can also press Ctrl+C in a MessageBox window to copy the text 71 | HHOOK hhk = SetWindowsHookEx(WH_CBT, &ErrorMsgProc, 0, GetCurrentThreadId()); 72 | int response = MessageBox(NULL, msg, APP_NAME" Error", MB_ICONERROR|MB_YESNO|MB_DEFBUTTON2); 73 | UnhookWindowsHookEx(hhk); 74 | if (response == IDYES) { 75 | // Copy message to clipboard 76 | int size = (wcslen(msg)+1)*sizeof(msg[0]); 77 | wchar_t *data = LocalAlloc(LMEM_FIXED, size); 78 | memcpy(data, msg, size); 79 | OpenClipboard(NULL); 80 | EmptyClipboard(); 81 | SetClipboardData(CF_UNICODETEXT, data); 82 | CloseClipboard(); 83 | LocalFree(data); 84 | } 85 | #endif 86 | } 87 | 88 | #define Error(a,b,c) _Error(a, b, c, TEXT(__FILE__), __LINE__) 89 | 90 | //DBG("%d", 5); 91 | //DBGA("%d", 5); 92 | 93 | #ifdef ERROR_WRITETOFILE 94 | 95 | #define DBG(fmt, ...) { \ 96 | FILE *f = OpenLog(L"ab"); \ 97 | fwprintf(f, TEXT(fmt), ##__VA_ARGS__); \ 98 | fputws(L"\n\n", f); \ 99 | CloseLog(f); \ 100 | } 101 | 102 | #else 103 | 104 | #define DBG(fmt, ...) { \ 105 | wchar_t _txt[1000]; \ 106 | wsprintf(_txt, TEXT(fmt), ##__VA_ARGS__); \ 107 | MessageBox(NULL, _txt, APP_NAME" Debug", MB_ICONINFORMATION|MB_OK); \ 108 | } 109 | 110 | #define DBGA(fmt, ...) { \ 111 | char _txt[1000]; \ 112 | sprintf(_txt, fmt, ##__VA_ARGS__); \ 113 | MessageBoxA(NULL, _txt, "Debug", MB_ICONINFORMATION|MB_OK); \ 114 | } 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /config/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef IDC_STATIC 2 | #define IDC_STATIC (-1) 3 | #endif 4 | 5 | #define IDD_GENERALPAGE 201 6 | #define IDD_INPUTPAGE 202 7 | #define IDD_BLACKLISTPAGE 203 8 | #define IDD_ADVANCEDPAGE 204 9 | #define IDD_ABOUTPAGE 205 10 | #define IDI_FIND 206 11 | #define IDI_BIGICON 207 12 | #define IDC_AUTOSNAP_HEADER 1000 13 | #define IDC_FINDWINDOW 1000 14 | #define IDC_CHECKNOW 1001 15 | #define IDC_LANGUAGE_HEADER 1001 16 | #define IDC_LOWERWITHMMB 1001 17 | #define IDC_TRANSLATIONS_BOX 1001 18 | #define IDC_INI 1002 19 | #define IDC_NEWRULE 1002 20 | #define IDC_MDI 1003 21 | #define IDC_SCROLL 1003 22 | #define IDC_TRANSLATIONS 1003 23 | #define IDC_AUTOSAVE 1004 24 | #define IDC_PROCESSBLACKLIST_HEADER 1004 25 | #define IDC_SCROLL_HEADER 1004 26 | #define IDC_AUTOSTART_ELEVATE 1005 27 | #define IDC_BLACKLIST_HEADER 1006 28 | #define IDC_ELEVATE 1006 29 | #define IDC_LMB_HEADER 1006 30 | #define IDC_MMB_HEADER 1007 31 | #define IDC_RMB_HEADER 1008 32 | #define IDC_CHECKONSTARTUP 1009 33 | #define IDC_MB4_HEADER 1009 34 | #define IDC_BETA 1010 35 | #define IDC_MB5_HEADER 1010 36 | #define IDC_FINDWINDOW_BOX 1012 37 | #define IDC_HOTKEYS_MORE 1013 38 | #define IDC_BLACKLIST_BOX 1014 39 | #define IDC_SNAPLIST_HEADER 1015 40 | #define IDC_BLACKLIST_EXPLANATION 1016 41 | #define IDC_ADVANCED_BOX 1017 42 | #define IDC_GENERAL_BOX 1018 43 | #define IDC_AUTOSTART_BOX 1019 44 | #define IDC_AUTOFOCUS 1101 45 | #define IDC_AUTOSNAP 1102 46 | #define IDC_AERO 1103 47 | #define IDC_INACTIVESCROLL 1104 48 | #define IDC_LANGUAGE 1105 49 | #define IDC_LMB 1201 50 | #define IDC_MMB 1202 51 | #define IDC_RMB 1203 52 | #define IDC_MB4 1204 53 | #define IDC_MB5 1205 54 | #define IDC_LEFTALT 1206 55 | #define IDC_RIGHTALT 1207 56 | #define IDC_LEFTWINKEY 1208 57 | #define IDC_RIGHTWINKEY 1209 58 | #define IDC_LEFTCTRL 1210 59 | #define IDC_RIGHTCTRL 1211 60 | #define IDC_HOOKWINDOWS 1401 61 | #define IDC_OPENINI 1402 62 | #define IDC_DONATE 1501 63 | #define IDC_SNAPLIST 1505 64 | #define IDC_BLACKLIST 1506 65 | #define IDC_PROCESSBLACKLIST 1507 66 | #define IDC_AUTOSTART 1508 67 | #define IDC_AUTOSTART_HIDE 1511 68 | #define IDC_MOUSE_BOX 1511 69 | #define IDC_HOTKEYS_BOX 1512 70 | #define IDC_FINDWINDOW_EXPLANATION 1513 71 | #define IDC_ABOUT_BOX 1514 72 | #define IDC_VERSION 1515 73 | #define IDC_AUTHOR 1516 74 | #define IDC_LICENSE 1517 75 | -------------------------------------------------------------------------------- /localization/sk_SK/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Miroslav Miklus 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings sk_SK = { 13 | L"sk-SK", 14 | L"Slovak", 15 | L"Slovenčina", 16 | L"Miroslav Miklus", 17 | L"AltDrag", 18 | L"AltDrag (vypnutý)", 19 | L"Zapnúť", 20 | L"Vypnúť", 21 | L"Odstrániť z lišty", 22 | L"Aktualizácia dostupná!", 23 | L"Otvoriť nastavenia", 24 | L"O aplikácii", 25 | L"Koniec", 26 | L"Dostupná nová verzia!", 27 | L"Je dostupná nová verzia. Prejsť na webstránku?", 28 | L"Nie sú dostupné žiadne aktualizácie.", 29 | L"AltDrag Konfigurácia", 30 | L"Všeobecné", 31 | L"Myš a klávesnica", 32 | L"Blacklist", 33 | L"Pokročilé", 34 | L"O aplikácii", 35 | L"Všeobecné nastavenia", 36 | L"&Označiť okno počas premiesňovania.\nOkno je možné označiť stlačením klávesy Ctrl.", 37 | L"Mimic Aero S&nap", 38 | L"&Skrolovanie neaktívnych okien", 39 | L"&MDI support", 40 | L"Automatické uchytenie na:", 41 | L"Vypnuté", 42 | L"Na okraje obrazovky", 43 | L"+ mimo okien", 44 | L"+ vnútri okien", 45 | L"Jazyk:", 46 | L"Autoštart", 47 | L"Š&tart AltDrag po prihlásení", 48 | L"&Schovať lištu", 49 | L"&Elevate to administrator privileges", 50 | L"Note that a UAC prompt will appear every time you log in, unless you disable UAC completely.", 51 | L"E&levate", 52 | L"Elevated", 53 | L"This will create a new instance of AltDrag which is running with administrator privileges. This allows AltDrag to manage other programs which are running with administrator privileges.\n\nYou will have to approve a UAC prompt from Windows to allow AltDrag to run with administrator privileges.", 54 | L"Elevation aborted.", 55 | L"Upozornenie: Nastavenia sú ukladané a aplikované okamžite!", 56 | L"Akcie myši", 57 | L"Ľavé tlačidlo myši:", 58 | L"Stredné tlačidlo myši:", 59 | L"Pravé tlačidlo myši:", 60 | L"4. tlačidlo myši:", 61 | L"5. tlačidlo myši:", 62 | L"Scroll:", 63 | L"&Lower windows by middle clicking on title bars", 64 | L"Move", 65 | L"Resize", 66 | L"Close", 67 | L"Minimize", 68 | L"Lower", 69 | L"AlwaysOnTop", 70 | L"Center", 71 | L"Nothing", 72 | L"Alt+Tab", 73 | L"Volume", 74 | L"Transparency", 75 | L"Klávesové skratky", 76 | L"&Left Alt", 77 | L"&Right Alt", 78 | L"Left &Winkey", 79 | L"Right W&inkey", 80 | L"Left &Ctrl", 81 | L"Right C&trl", 82 | L"Ďalšie klávesové skratky môžete zadefinovať v .ini súbore! Prilepenie okien docielite podržaním klávesy Shift.", 83 | L"Nastavenie blacklistu", 84 | L"Blacklist procesov:", 85 | L"Blacklist:", 86 | L"Snaplist:", 87 | L"Princíp fungovania blacklistu je možné nájsť na wiki", 88 | L"Identifikácia okna", 89 | L"Túto funkciu je možné využiť pre určenie \"classname\" okna, použiteľného pre funkcionality blacklistu, či prichytávania okien v rámci snaplistu.", 90 | L"Pokročilé nastavenia", 91 | L"&Povoliť prichytávanie počas presunu okien.\nPracuje pri zapnutom automatickom prichytávaní okien!", 92 | L"Táto funkcia nie je 100% bezpečná, nakoľko je potrebný zásah do iných procesov.", 93 | L"Automatická kontrola akt&ualizácii", 94 | L"Kontrolovať aj dostupnosť &beta verzii", 95 | L"Skontrolovať aktualizácie", 96 | L"AltDrag nastavenia sú ukladané do súboru AltDrag.ini. Niektoré nastavenia je možné upraviť len manuálnou editáciou tohto súboru.", 97 | L"Otvoriť &ini súbor", 98 | L"O aplikácií AltDrag", 99 | L"Verzia 1.0", 100 | L"Autor Stefan Sundin", 101 | L"AltDrag je voľne dostupný softvér s otvoreným zdrojovým kódom. Šírte ho prosím ďalej.", 102 | L"&Prispej", 103 | L"Translation credit", 104 | L"There was an error disabling AltDrag. This was most likely caused by Windows having already disabled AltDrag's hooks.\n\nIf this is the first time this has happened, you can safely ignore it and continue using AltDrag.\n\nIf this is happening repeatedly, you can read on the website wiki how to prevent this from happening again (look for 'AltDrag mysteriously stops working' on the About page).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/pl_PL/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Krystian Maksymowicz, Paweł 'Pawouek' Krafczyk 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings pl_PL = { 13 | L"pl-PL", 14 | L"Polish", 15 | L"Polski", 16 | L"Krystian Maksymowicz, Paweł 'Pawouek' Krafczyk", 17 | L"AltDrag", 18 | L"AltDrag (wyłączony)", 19 | L"Włącz", 20 | L"Wyłącz", 21 | L"Ukryj ikonę", 22 | L"Aktualizacja jest dostępna!", 23 | L"Ustawienia", 24 | L"Informacje", 25 | L"Zakończ", 26 | L"Znaleziono nową wersję!", 27 | L"Nowa wersja jest dostępna. Odwiedzić stronę?", 28 | L"Brak dostępnych aktualizacji.", 29 | L"Ustawienia AltDrag", 30 | L"Ogólne", 31 | L"Mysz i klawiatura", 32 | L"Czarna lista", 33 | L"Zaawansowane", 34 | L"Informacje", 35 | L"Ustawienia ogólne", 36 | L"A&ktywuj okno podczas przesuwania.\nMożesz także wcisnąć Ctrl by aktywować okna.", 37 | L"&Naśladuj Aero Snap", 38 | L"&Przełączaj między nieaktywnymi oknami", 39 | L"&MDI support", 40 | L"Automatycznie przyciągaj do:", 41 | L"Wyłączone", 42 | L"Krawędzi ekranu", 43 | L"+ zew. krawędzi okien", 44 | L"+ wew. krawędzi okien", 45 | L"Język:", 46 | L"Autostart", 47 | L"Uruchom AltDrag przy &starcie systemu", 48 | L"&Ukryj w obszarze powiadomień", 49 | L"&Elevate to administrator privileges", 50 | L"Note that a UAC prompt will appear every time you log in, unless you disable UAC completely.", 51 | L"E&levate", 52 | L"Elevated", 53 | L"This will create a new instance of AltDrag which is running with administrator privileges. This allows AltDrag to manage other programs which are running with administrator privileges.\n\nYou will have to approve a UAC prompt from Windows to allow AltDrag to run with administrator privileges.", 54 | L"Elevation aborted.", 55 | L"Uwaga: Ustawienia są zapisywane i stosowane natychmiastowo!", 56 | L"Akcje myszy", 57 | L"Lewy przycisk:", 58 | L"Środkowy przycisk:", 59 | L"Prawy przycisk:", 60 | L"Czwarty przycisk:", 61 | L"Piąty przycisk:", 62 | L"Scroll:", 63 | L"&Lower windows by middle clicking on title bars", 64 | L"Move", 65 | L"Resize", 66 | L"Close", 67 | L"Minimize", 68 | L"Lower", 69 | L"AlwaysOnTop", 70 | L"Center", 71 | L"Nothing", 72 | L"Alt+Tab", 73 | L"Volume", 74 | L"Transparency", 75 | L"Skróty klawiszowe", 76 | L"L&ewy Alt", 77 | L"&Prawy Alt", 78 | L"Lewy &Win", 79 | L"Prawy W&in", 80 | L"Lewy &Ctrl", 81 | L"Prawy C&trl", 82 | L"Możesz dodać dowolny klawisz edytując plik ini!\nUżyj klawisza Shift by przyciągać okna do krawędzi innych okien.", 83 | L"Wyjątki", 84 | L"Wyjątki procesów:", 85 | L"Wyjątki okien:", 86 | L"Lista przyciągania:", 87 | L"Dokładny opis działania wyjątków dostępny na wiki!", 88 | L"Identyfikuj okno", 89 | L"Użyj powyższej funkcji do identyfikacji nazwy klasy okna by można było je dodać do jednej z powyższych list.", 90 | L"Ustawienia zaawansowane", 91 | L"&Włącz przyciąganie podczas zwykłego przesuwania okien.\nDziała w połączeniu z automatycznym przyciąganiem!", 92 | L"Nie jest to na 100% bezpieczne bo wymaga podczepiania się pod inne procesy itp.", 93 | L"A&utomatycznie sprawdzaj dostępność aktualizacji", 94 | L"Uw&zględniaj wersje testowe", 95 | L"&Sprawdź teraz", 96 | L"Ustawienia programu AltDrag są przechowywane w pliku AltDrag.ini. Jest kilka ustawień, które można ustawić jedynie poprzez samodzielną edycję tego pliku.", 97 | L"Otwórz plik &ini", 98 | L"AltDrag — Informacje", 99 | L"Wersja 1.0", 100 | L"Autorem jest Stefan Sundin", 101 | L"AltDrag to wolne i otwarte oprogramowanie!\nNakłaniam do jego rozpowszechniania!", 102 | L"&Dotuj", 103 | L"Translation credit", 104 | L"There was an error disabling AltDrag. This was most likely caused by Windows having already disabled AltDrag's hooks.\n\nIf this is the first time this has happened, you can safely ignore it and continue using AltDrag.\n\nIf this is happening repeatedly, you can read on the website wiki how to prevent this from happening again (look for 'AltDrag mysteriously stops working' on the About page).", 105 | }; 106 | -------------------------------------------------------------------------------- /tools/import_languages.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | #define UNICODE 11 | #define _UNICODE 12 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #define APP_NAME "AltDrag" 20 | #define APP_VERSION "1.0" 21 | 22 | #include "../localization/strings.h" 23 | #include "../localization/en_US/strings.h" 24 | #include "../include/localization.c" 25 | 26 | char *languages[] = { 27 | "en_US", 28 | "fr_FR", 29 | "pl_PL", 30 | "pt_BR", 31 | "sk_SK", 32 | "ru_RU", 33 | "zh_CN", 34 | "zh_TW", 35 | "it_IT", 36 | "de_DE", 37 | "es_ES", 38 | "gl_ES", 39 | "ca_ES", 40 | "ko_KR", 41 | }; 42 | 43 | void wcscpy_escape(wchar_t *dest, wchar_t *source) { 44 | // Copy from source to dest, escaping \n to \\n and " to \" 45 | for (; *source != '\0'; source++,dest++) { 46 | if (*source == '\n' || *source == '"') { 47 | *dest = '\\'; 48 | dest++; 49 | *dest = (*source == '\n')?'n':'"'; 50 | } 51 | else { 52 | *dest = *source; 53 | } 54 | } 55 | *dest = '\0'; 56 | } 57 | 58 | int main(int argc, char *argv[]) { 59 | char utf8_bom[3] = { 0xEF,0xBB,0xBF }; 60 | int i,j; 61 | for (i=1; i < ARRAY_SIZE(languages); i++) { 62 | char *code = languages[i]; 63 | wchar_t code_utf16[10]; 64 | int ret = MultiByteToWideChar(CP_UTF8, 0, code, -1, code_utf16, sizeof(code_utf16)); 65 | if (ret == 0) { 66 | wprintf(L"MultiByteToWideChar() failed. Something is wrong...\n"); 67 | } 68 | 69 | wchar_t ini[MAX_PATH], path[MAX_PATH]; 70 | GetModuleFileName(NULL, ini, ARRAY_SIZE(ini)); 71 | PathRemoveFileSpec(ini); 72 | wcscat(ini, L"\\"); 73 | wcscat(ini, code_utf16); 74 | wcscpy(path, ini); 75 | wcscat(ini, L"\\Translation.ini"); 76 | wcscat(path, L"\\strings.h"); 77 | LoadTranslation(ini); 78 | struct strings *l10n = &l10n_ini; 79 | 80 | char author[100]; 81 | ret = WideCharToMultiByte(CP_UTF8, 0, l10n->author, -1, author, sizeof(author), NULL, NULL); 82 | 83 | FILE *f = _wfopen(path, L"wb"); 84 | fwrite(utf8_bom, 1, sizeof(utf8_bom), f); // Write BOM 85 | fprintf(f, "/*\n\ 86 | "APP_NAME" "APP_VERSION" - localization by %s\n\ 87 | \n\ 88 | This program is free software: you can redistribute it and/or modify\n\ 89 | it under the terms of the GNU General Public License as published by\n\ 90 | the Free Software Foundation, either version 3 of the License, or\n\ 91 | (at your option) any later version.\n\ 92 | \n\ 93 | Do not edit this file! It is automatically generated from Translate.ini!\n\ 94 | */\n\ 95 | \n\ 96 | struct strings %s = {\n\ 97 | ", author, code); 98 | 99 | for (j=0; j < ARRAY_SIZE(l10n_mapping); j++) { 100 | wchar_t txt[3000]; 101 | // Get pointer to string 102 | wchar_t *str = *(wchar_t**) ((void*)l10n + ((void*)l10n_mapping[j].str - (void*)&l10n_ini)); 103 | // Escape 104 | wcscpy_escape(txt, str); 105 | // Convert to UTF-8 106 | char str_utf8[3000]; 107 | int ret = WideCharToMultiByte(CP_UTF8, 0, txt, -1, str_utf8, sizeof(str_utf8), NULL, NULL); 108 | if (ret == 0) { 109 | wprintf(L"WideCharToMultiByte() failed. Something is wrong...\n"); 110 | } 111 | // Print 112 | fprintf(f, " L\"%s\",\n", str_utf8); 113 | } 114 | fprintf(f, "};\n"); 115 | fclose(f); 116 | } 117 | 118 | wchar_t path[MAX_PATH]; 119 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 120 | PathRemoveFileSpec(path); 121 | wcscat(path, L"\\languages.h"); 122 | 123 | FILE *f = _wfopen(path, L"wb"); 124 | fwrite(utf8_bom, 1, sizeof(utf8_bom), f); // Write BOM 125 | fprintf(f, "// Do not edit this file! It is automatically generated!\n\n"); 126 | 127 | for (i=0; i < ARRAY_SIZE(languages); i++) { 128 | fprintf(f, "#include \"%s/strings.h\"\n", languages[i]); 129 | } 130 | fprintf(f, "\nstruct strings *languages[] = {\n"); 131 | for (i=0; i < ARRAY_SIZE(languages); i++) { 132 | fprintf(f, " &%s,\n", languages[i]); 133 | } 134 | fprintf(f, "};\n\nstruct strings *l10n = &en_US;\n"); 135 | 136 | return 0; 137 | } 138 | -------------------------------------------------------------------------------- /localization/ru_RU/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Neek Eoneof, Dmitry Trubin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings ru_RU = { 13 | L"ru-RU", 14 | L"Russian", 15 | L"Русский", 16 | L"Neek Eoneof, Dmitry Trubin", 17 | L"AltDrag", 18 | L"AltDrag (выключено)", 19 | L"Включить", 20 | L"Выключить", 21 | L"Спрятать иконку", 22 | L"Доступно обновление!", 23 | L"Настройки", 24 | L"О программе", 25 | L"Выход", 26 | L"Обнаружена новая версия!", 27 | L"Доступна новая версия. Прейти на сайт программы?", 28 | L"Нет доступных обновлений.", 29 | L"Настройки AltDrag", 30 | L"Основные", 31 | L"Мышь и клавиатура", 32 | L"Черный список", 33 | L"Дополнительные", 34 | L"О программе", 35 | L"Основные настройки", 36 | L"&Активировать окно при перетаскивании.\nИначе, с зажатой клавишей Ctrl.", 37 | L"&Имитировать Aero Snap", 38 | L"&Прокручивать содержимое неактивных окон", 39 | L"П&оддержка многодокументного интерфейса (MDI)", 40 | L"Автоматическая стыковка:", 41 | L"Отключена", 42 | L"К краям экрана", 43 | L"+ к окнам снаружи", 44 | L"+ к окнам изнутри", 45 | L"Язык:", 46 | L"Автозагрузка", 47 | L"&Запускать AltDrag при загрузке системы", 48 | L"Прятать иконку в &области уведомлений", 49 | L"&Дать программе полномочия администратора", 50 | L"Подтверждение UAC будет запрашиваться при каждом входе в систему, если не отключить UAC полностью.", 51 | L"П&овысить", 52 | L"Повышено", 53 | L"Новый экземпляр AltDrag будет запущен от имени администратора. Это позволит программе AltDrag управлять другими приложениями, запущенными от имени администратора.\n\nНеобходимо выполнить подтверждение UAC, чтёобы разрешить запуск AltDrag с полномочиями администратора.", 54 | L"Повышение полномочий отменено.", 55 | L"Внимание, настройки применяются немедленно!", 56 | L"Действия мыши", 57 | L"Левая кнопка:", 58 | L"Средняя кнопка:", 59 | L"Правая кнопка:", 60 | L"Кнопка мыши 4:", 61 | L"Кнопка мыши 5:", 62 | L"Колесо прокрутки:", 63 | L"&Перемещать окно на задний план кликом средней кнопки по заголовку", 64 | L"Переместить", 65 | L"Размер", 66 | L"Закрыть", 67 | L"Свернуть", 68 | L"На задний план", 69 | L"Поверх всех окон", 70 | L"Установить по центру", 71 | L"Ничего", 72 | L"Alt+Tab", 73 | L"Громкость", 74 | L"Прозрачность", 75 | L"Горячие клавиши", 76 | L"&Левый Alt", 77 | L"&Правый Alt", 78 | L"Левый &Win", 79 | L"Правый W&in", 80 | L"Левый &Ctrl", 81 | L"Правый C&trl", 82 | L"Вы можете добавить любую клавишу, изменив ini-файл.\nИспользуйте Shift для стыковки окон друг к другу.", 83 | L"Настройки черного списка", 84 | L"Черный список процессов:", 85 | L"Черный список:", 86 | L"Окна для стыковки:", 87 | L"Прочтите вики-статью на сайте с подробным описанием принципа работы черного списка!", 88 | L"Определить окно", 89 | L"Используйте эту функцию, чтобы определить имя класса окна и добавить его в списки выше.", 90 | L"Дополнительные настройки", 91 | L"Включить стыковку при перетаскавании окна за заголовок.\nРаботает в связке с автоматической стыковкой!", 92 | L"Имейте в виду, при включении этой функции, AltDrag может конфликтовать, например, с играми с системой защиты от жульничества.\n\nВключить стыковку?", 93 | L"&Автоматически проверять наличие обновлений", 94 | L"Проверять наличие &бета-версий", 95 | L"&Проверить", 96 | L"Настройки программы хранятся в файле AltDrag.ini. Некоторые настройки можно изменить только вручную через этот файл.", 97 | L"&Открыть .ini", 98 | L"О программе AltDrag", 99 | L"Версия 1.0", 100 | L"Разработал Stefan Sundin", 101 | L"AltDrag — бесплатная программа с открытым исходным кодом. Расскажите о ней друзьям!", 102 | L"&Помочь", 103 | L"Авторы перевода", 104 | L"Произошла ошибка при выключении AltDrag. Скорее всего это вызвано тем, что Windows уже отключила перехватчики AltDrag.\n\nЕсли это произошло впервые, вы можете проигнорировать это сообщение и продолжить пользоваться программой как обычно.\n\nЕсли это уже случалось ранее, решение проблемы можно найти в разделе 'AltDrag mysteriously stops working' вики-статьи About на сайте программы.", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/fr_FR/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Samy Mechiri 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings fr_FR = { 13 | L"fr-FR", 14 | L"French", 15 | L"Français", 16 | L"Samy Mechiri", 17 | L"AltDrag", 18 | L"AltDrag (désactivé)", 19 | L"Activer", 20 | L"Désactiver", 21 | L"Cacher l'icone", 22 | L"Mise-à-jour disponible!", 23 | L"Paramètres", 24 | L"A Propos", 25 | L"Quitter", 26 | L"Nouvelle version disponible!", 27 | L"Une nouvelle version est disponible. Aller sur le site web?", 28 | L"Pas de mise-à-jour disponible.", 29 | L"Configuration de AltDrag", 30 | L"Général", 31 | L"Souris et clavier", 32 | L"Liste noire", 33 | L"Avancé", 34 | L"A propos", 35 | L"Paramètres généraux", 36 | L"Activer les &fenêtres en les déplaçant.\nAppuyez sur Ctrl pour activer les fenêtres.", 37 | L"Imiter l'aimantation A&ero", 38 | L"&Défiler les fenêtres inactives", 39 | L"&MDI support", 40 | L"Aimanter les fenêtres:", 41 | L"Désactivé", 42 | L"Bords de l'écran", 43 | L"+ Extérieur des fenêtres", 44 | L"+ Intérieur des fenêtres", 45 | L"Langue:", 46 | L"Démarrage automatique", 47 | L"Déma&rrer AltDrag en se connectant", 48 | L"Cac&her l'icone de la barre d'outils", 49 | L"&Elevate to administrator privileges", 50 | L"Note that a UAC prompt will appear every time you log in, unless you disable UAC completely.", 51 | L"E&levate", 52 | L"Elevated", 53 | L"This will create a new instance of AltDrag which is running with administrator privileges. This allows AltDrag to manage other programs which are running with administrator privileges.\n\nYou will have to approve a UAC prompt from Windows to allow AltDrag to run with administrator privileges.", 54 | L"Elevation aborted.", 55 | L"Note: Les paramètres sont sauvés et appliqués instantanément!", 56 | L"Souris", 57 | L"Bouton gauche:", 58 | L"Bouton du milieu:", 59 | L"Bouton droit:", 60 | L"Bouton 4:", 61 | L"Bouton 5:", 62 | L"Scroll:", 63 | L"&Lower windows by middle clicking on title bars", 64 | L"Move", 65 | L"Resize", 66 | L"Close", 67 | L"Minimize", 68 | L"Lower", 69 | L"AlwaysOnTop", 70 | L"Center", 71 | L"Nothing", 72 | L"Alt+Tab", 73 | L"Volume", 74 | L"Transparency", 75 | L"Activation", 76 | L"Alt &gauche", 77 | L"Alt &droit", 78 | L"&Windows gauche", 79 | L"W&indows droit", 80 | L"&Ctrl gauche", 81 | L"C&trl droit", 82 | L"Ajoutez les touches de votre choix en éditant le fichier ini!\nUtilisez shift pour aimanter les fenêtres les unes aux autres.", 83 | L"Liste noire", 84 | L"Processus à ignorer:", 85 | L"Fenêtres à ignorer:", 86 | L"Fenêtres à aimanter:", 87 | L"Lire le wiki sur le site web pour une explication complète sur le fonctionnement de la liste noire!", 88 | L"Identifer une fenêtre", 89 | L"Utilisez cette fonction pour identifier la classe d'une fenêtre afin de l'ajouter dans la liste des fenêtres à ignorer ou des fenêtres à aimanter ci-dessus.", 90 | L"Paramètres avancés", 91 | L"A&imenter les fenêtres déplacées normalement.\nFonctionne en plus de l'aimantation automatique!", 92 | L"Cette fonction n'est pas sûr à 100% car elle s'insère dans des processus étrangers et des choses de ce genre.", 93 | L"Chercher des mises-à-jours a&utomatiquement", 94 | L"Chercher des versions &beta", 95 | L"Vérifier la &mise-à-jour", 96 | L"Les paramètres de AltDrag sont sauvés dans le fichier AltDrag.ini. Certains paramètres ne sont modifiable qu'en éditant le fichier manuellement.", 97 | L"&Editer le fichier", 98 | L"A propos de AltDrag", 99 | L"Version 1.0", 100 | L"Crée par Stefan Sundin", 101 | L"AltDrag est un logiciel gratuit et open source!\nFaites en profiter vos amis!", 102 | L"&Donner", 103 | L"Translation credit", 104 | L"There was an error disabling AltDrag. This was most likely caused by Windows having already disabled AltDrag's hooks.\n\nIf this is the first time this has happened, you can safely ignore it and continue using AltDrag.\n\nIf this is happening repeatedly, you can read on the website wiki how to prevent this from happening again (look for 'AltDrag mysteriously stops working' on the About page).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/it_IT/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Hexaae 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings it_IT = { 13 | L"it-IT", 14 | L"Italian", 15 | L"Italiano", 16 | L"Hexaae", 17 | L"AltDrag", 18 | L"AltDrag (disattivato)", 19 | L"Attiva", 20 | L"Disattiva", 21 | L"Nascondi icona di notifica", 22 | L"È disponibile un aggiornamento!", 23 | L"Configura...", 24 | L"Info...", 25 | L"Esci", 26 | L"È stata trovata una nuova versione!", 27 | L"È disponibile una nuova versione. Vai al sito web?", 28 | L"Non è disponibile alcun aggiornamento.", 29 | L"Configurazione Altdrag", 30 | L"Generale", 31 | L"Mouse e tastiera", 32 | L"Lista nera", 33 | L"Avanzate", 34 | L"Info", 35 | L"Impostazioni generali", 36 | L"Seleziona la &finestra durante il trascinamento.\nPuoi anche premere Ctrl per attivare la finestra.", 37 | L"Mima Aero S&nap", 38 | L"&Scorri finestre inattive", 39 | L"Supporto &MDI", 40 | L"Aggancia automaticamente a:", 41 | L"Disattivato", 42 | L"Bordi dello schermo", 43 | L"+ esterno finestre", 44 | L"+ interno finestre", 45 | L"Lingua:", 46 | L"Avvio automatico", 47 | L"A&vvia AltDrag all'accesso", 48 | L"Nascon&di icona di notifica", 49 | L"&Eleva con privilegi amministratore", 50 | L"Nota che una richiesta UAC apparirà tutte le volte che accederai, a meno di disattivare completamente l'UAC.", 51 | L"E&leva", 52 | L"Elevato", 53 | L"Crea una nuova istanza di AltDrag con privilegi da amministratore. Assicura ad AltDrag di poter gestire gli altri programmi in esecuzione con privilegi da amministratore.\n\nDovrai confermare una richiesta UAC da parte di Windows per permettere ad AltDrag di essere avviato con privilegi da amministratore.", 54 | L"Elevazione annullata.", 55 | L"N.B.: le impostazioni sono applicate e salvate istantaneamente!", 56 | L"Azioni mouse", 57 | L"Tasto sinistro:", 58 | L"Tasto centrale:", 59 | L"Tasto destro:", 60 | L"Tasto mouse 4:", 61 | L"Tasto mouse 5:", 62 | L"Rotellina:", 63 | L"S&posta dietro le finestre premendo il tasto centrale sul titolo della barra.", 64 | L"Muovi finestra", 65 | L"Ingrandisci finestra", 66 | L"Chiudi finestra", 67 | L"Riduci a icona finestra", 68 | L"Sposta dietro finestra", 69 | L"Scambia Sempre sopra", 70 | L"Centra finestra su schermo", 71 | L"Niente", 72 | L"Alt+Tab", 73 | L"Volume", 74 | L"Trasparenza", 75 | L"Tasti di scelta rapida", 76 | L"Alt &sinistro", 77 | L"Alt &destro", 78 | L"&Win sinistro", 79 | L"W&in destro", 80 | L"&Ctrl sinistro", 81 | L"C&trl destro", 82 | L"Puoi aggiungere qualunque tasto modificando il file ini.\nUsa il tasto maiusc per agganciare una finestra all'altra.", 83 | L"Impostazioni lista nera", 84 | L"Processi in lista nera:", 85 | L"Lista nera:", 86 | L"Lista aggancio:", 87 | L"Leggi la wiki sul sito web per una spiegazione approfondita di come funziona la lista nera!", 88 | L"Indentifica finestra", 89 | L"Clicca l'icona per identificare la classname della finestra in modo da poterla aggiungere alla Lista nera o Lista aggancio sopra.", 90 | L"Impostazioni avanzate", 91 | L"A&ttiva l'aggancio muovendo le finestre normalmente.\nFunziona insieme all'aggancio automatico!", 92 | L"Nota che non è sicuro al 100% dato che questa funzionalità lavora tramite hooking in altri processi. Potrebbe essere rischioso quando si utilizzano giochi con protezione anti-cheat.\n\nSicuro di volerla attivare?", 93 | L"Verifica automaticamente gli a&ggiornamenti", 94 | L"Verifica presenza di versioni &beta", 95 | L"&Controlla ora", 96 | L"AltDrag salva le impostazioni in AltDrag.ini. Ci sono alcune cose che possono essere configurate solo tramite modifica manuale.", 97 | L"Apri file &ini", 98 | L"Informazioni su AltDrag", 99 | L"Versione 1.0", 100 | L"Creato da Stefan Sundin", 101 | L"AltDrag è un software libero e open source!\nSiete liberi di distribuirlo!", 102 | L"&Dona", 103 | L"Crediti traduzione", 104 | L"Errore durante la disattivazione di AltDrag. Probabilmente causato da Windows che aveva già disattivato l'hook di AltDrag.\n\nSe è la prima volta che succede puoi tranquillamente ignorarlo e continuare ad usare AltDrag.\n\nSe succede spesso, puoi leggere il sito web wiki su come evitare che si ripeta (cerca 'AltDrag mysteriously stops working' nella pagina About).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/gl_ES/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Jorge Amigo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings gl_ES = { 13 | L"gl-ES", 14 | L"Galician", 15 | L"Galego", 16 | L"Jorge Amigo", 17 | L"AltDrag", 18 | L"AltDrag (deshabilitado)", 19 | L"Habilitar", 20 | L"Deshabilitar", 21 | L"Non mostrar na bandexa", 22 | L"¡Actualización dispoñible!", 23 | L"Configurar", 24 | L"Acerca de", 25 | L"Saír", 26 | L"¡Atopada unha nova versión!", 27 | L"Está disponible unha nova versión. ¿Ir ó sitio web?", 28 | L"Non hai actualizacións dispoñibles.", 29 | L"Configuración de AltDrag", 30 | L"Xeral", 31 | L"Rato e teclado", 32 | L"Lista Negra", 33 | L"Avanzado", 34 | L"Acerca de", 35 | L"Configuración xeral", 36 | L"&Enfocar ventás ó arrastrar.\nTamén pódese pulsar Ctrl para enfocar ventás.", 37 | L"Imitar Aero Snap", 38 | L"&Desplazar páxina en ventás inactivas", 39 | L"&Soporte MDI", 40 | L"Automáticamente pegarse a:", 41 | L"Deshabilitado", 42 | L"Ós bordes da pantalla", 43 | L"+ exterior das ventás", 44 | L"+ interior das ventás", 45 | L"Idioma:", 46 | L"Inicio automático", 47 | L"Iniciar AltDrag ó iniciar sesión", 48 | L"&Non mostrar na bandexa", 49 | L"&Elevar a privilexios de administrador", 50 | L"Nótese que aparecerá unha mensaxe UAC cada volta que se inicie sesión, agás que se deshabilite UAC completamente.", 51 | L"Elevar", 52 | L"Elevado", 53 | L"Esto creará unha nova instancia de AltDrag que se executará con privilexios de administrador. Esto permite a AltDrag manexar outros programas que se executen con privilegios de administrador.\n\nA mensaxe UAC de Windows deberá ser aceptada para permitir que AltDrag se execute con privilegios de administrador.", 54 | L"Elevación cancelada.", 55 | L"Nota: A configuración sálvase e aplícase ó instante!", 56 | L"Acciones de rato", 57 | L"Botón esquerdo do rato:", 58 | L"Botón medio do rato:", 59 | L"Botón dereito do rato:", 60 | L"Botón 4 do rato:", 61 | L"Botón 5 do rato:", 62 | L"Roda de desplazamento:", 63 | L"&Enviar ó fondo as ventás ó pulsar co botón do medio nas súas barras de título", 64 | L"Mover ventá", 65 | L"Redimensionar ventá", 66 | L"Pechar ventá", 67 | L"Minimizar ventá", 68 | L"Enviar ó fondo a ventá", 69 | L"Activar sempre enriba", 70 | L"Centrar ventá en pantalla", 71 | L"Nada", 72 | L"Alt+Tab", 73 | L"Volumen", 74 | L"Transparencia", 75 | L"Teclas especiales:", 76 | L"Alt esquerda", 77 | L"Alt dereita", 78 | L"Win esquerda", 79 | L"Win dereita", 80 | L"Ctrl esquerda", 81 | L"Ctrl dereita", 82 | L"Pódese engadir calquera tecla editando o arquivo ini.\nUsa-la tecla Maiúsculas para pegar ventás unhas a outras.", 83 | L"Configuración da lista negra", 84 | L"Lista negra de procesos:", 85 | L"Lista negra:", 86 | L"Lista de pegado:", 87 | L"Ler a wiki no sitio web para unha explicación en detalle acerca de cómo funciona a lista negra!", 88 | L"Identificar ventá", 89 | L"Facer clic no icono para identifica-la clase dunha ventá e engadila ás listas negra ou de pegado de enriba.", 90 | L"Configuración avanzada", 91 | L"&Habilitar pegado de ventás ó mover normalmente.\nFunciona xunto co pegado de ventá automático!", 92 | L"Nótese que esto non é 100% seguro xa que esta opción funciona enganchándose a outros procesos. O seu uso pode ser arriscado cando se xogue a xogos con protección anti-trampas.\n\nEstá seguro de querer habilitar esta funcionalidad?", 93 | L"Buscar actualizacións automáticamente", 94 | L"Buscar versións beta", 95 | L"Buscar agora", 96 | L"A configuración de AltDrag almacénase en AltDrag.ini. Existen algunhas cousas que só se poden configurar editando este ficheiro manualmente.", 97 | L"Abri-lo ficheiro ini", 98 | L"Acerca de AltDrag", 99 | L"Versión 1.0", 100 | L"Creado por Stefan Sundin", 101 | L"¡AltDrag é software libre e de código aberto!\n¡Pode ser redistribuido libremente!", 102 | L"&Doar", 103 | L"Traducido por Jorge Amigo", 104 | L"Houbo un erro deshabilitando AltDrag. A causa máis probable é que Windows deshailitase os ganchos de AltDrag.\n\nSe ésta é a primeira vez que acontece, pode ignoralo e continuar usando AltDrag.\n\nSe esto ocurre habitualmente, pódese ler na wiki do sitio web cómo prevenir este comportamiento (hai que buscar 'AltDrag mysteriously stops working' na páxina de About).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/pt_BR/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Jucá Costa 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings pt_BR = { 13 | L"pt-BR", 14 | L"Brazilian Portuguese", 15 | L"Português (Brasil)", 16 | L"Jucá Costa", 17 | L"AltDrag", 18 | L"AltDrag (desativado)", 19 | L"Ativar", 20 | L"Desativar", 21 | L"Ocultar ícone", 22 | L"Atualização disponível!", 23 | L"Configuração", 24 | L"Sobre", 25 | L"Sair", 26 | L"Nova versão disponível!", 27 | L"Uma nova versão está disponível. Deseja ir à página de download?", 28 | L"Não há atualizações disponíveis.", 29 | L"Configuração do AltDrag", 30 | L"Geral", 31 | L"Teclado e mouse", 32 | L"Lista negra", 33 | L"Avançado", 34 | L"Sobre", 35 | L"Configurações gerais", 36 | L"A&tivar janelas ao arrastar. Você também pode\npressionar Ctrl para ativar janelas.", 37 | L"&Imitar o Aero Snap", 38 | L"&Rolar janelas inativas", 39 | L"Suporte a &MDI, interface de múltiplos documentos", 40 | L"Alinhar automaticamente a:", 41 | L"Desativado", 42 | L"Bordas da tela", 43 | L"+ exterior das janelas", 44 | L"+ interior das janelas", 45 | L"Idioma:", 46 | L"Início automático", 47 | L"&Iniciar o AltDrag quando fizer logon", 48 | L"&Ocultar ícone da área de notificação", 49 | L"&Elevar a privilégios de administrador", 50 | L"Note que a janela do Controle de Conta de Usuário aparecerá sempre que você fizer logon, a não ser que o Controle de Conta de Usuário esteja desativado completamente.", 51 | L"E&levar", 52 | L"Elevado", 53 | L"Isto criará uma nova instância do AltDrag que possuirá privilégios de administrador, permitindo que o AltDrag manipule outros programas que possuam privilégios de administrador.\n\nVocê deverá permitir o AltDrag na janela de confirmação do Controle de Conta de Usuário do Windows, para que o AltDrag seja executado com privilégios de administrador.", 54 | L"Elevação cancelada.", 55 | L"Nota: as configurações são salvas e aplicadas instantaneamente.", 56 | L"Ações do mouse", 57 | L"Botão esquerdo:", 58 | L"Botão do meio:", 59 | L"Botão direito:", 60 | L"Botão 4:", 61 | L"Botão 5:", 62 | L"Roda do mouse:", 63 | L"&Enviar janela para trás ao clicar na barra de título", 64 | L"Mover", 65 | L"Redimensionar", 66 | L"Fechar", 67 | L"Minimizar", 68 | L"Enviar para trás", 69 | L"Sempre visível", 70 | L"Centralizar", 71 | L"Nada", 72 | L"Alt+Tab", 73 | L"Volume", 74 | L"Transparência", 75 | L"Teclas de atalho", 76 | L"Alt &esquerdo", 77 | L"Alt &direito", 78 | L"&Windows esquerdo", 79 | L"W&indows direito", 80 | L"&Ctrl esquerdo", 81 | L"C&trl direito", 82 | L"Adicione mais teclas editando o arquivo ini.\nUtilize a tecla Shift para alinhar as janelas umas às outras.", 83 | L"Configurações da lista negra", 84 | L"Processos a ignorar:", 85 | L"Janelas a ignorar:", 86 | L"Janelas a alinhar:", 87 | L"Leia a wiki (em inglês) na nossa página para uma explicação detalhada de como a lista negra funciona.", 88 | L"Identificar janela", 89 | L"Utilize esta ferramenta para identificar a classe de uma janela, a fim de adicionar a uma das listas acima.", 90 | L"Configurações avançadas", 91 | L"A&tivar alinhamento quando mover normalmente uma janela. Funciona em conjunto com o alinhamento automático.", 92 | L"Note que isto não é totalmente seguro, pois faz injeções (hooks) em outros processos. Pode ser arriscado utilizar com jogos que tenham proteção anti-cheat.", 93 | L"Verificar se há novas at&ualizações automaticamente", 94 | L"Verificar versões &beta", 95 | L"&Verificar agora", 96 | L"As configurações do AltDrag são salvas no arquivo AltDrag.ini. Certas configurações só podem ser alteradas através da modificação manual desse arquivo.", 97 | L"Abrir arquivo &ini", 98 | L"Sobre o AltDrag", 99 | L"Versão 1.0", 100 | L"Criado por Stefan Sundin", 101 | L"AltDrag é um software grátis e de código aberto.\nDivulgue-o aos seus amigos!", 102 | L"&Doar", 103 | L"Créditos das traduções", 104 | L"Houve um erro ao desabilitar o AltDrag. Isto foi provavelmente causado pelo Windows ter alterados as injeções (hooks) do AltDrag.\n\nSe é a primeira vez que isto acontece, você pode ignorar esta mensagem com segurança e continuar a usar o AltDrag.\n\nSe isto acontece repetidamente, você pode ler em nossa wiki (em inglês) como evitar a repetição deste erro (procure por \"AltDrag mysteriously stops working\" na página \"About\").", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/ca_ES/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Àlfons Sánchez 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings ca_ES = { 13 | L"ca-ES", 14 | L"Catalan", 15 | L"Catalá", 16 | L"Àlfons Sánchez", 17 | L"AltDrag", 18 | L"AltDrag (desactivat)", 19 | L"Activat", 20 | L"Desactivat", 21 | L"Amaga safata", 22 | L"Actualització disponible!", 23 | L"Configurar", 24 | L"Quant a", 25 | L"Sortir", 26 | L"Nova versió trobada!", 27 | L"Una nova versió està disponible. Anar a la web?", 28 | L"Sense actualitzacions.", 29 | L"AltDrag Configuració", 30 | L"General", 31 | L"Ratolí i teclat", 32 | L"Llista negra", 33 | L"Avançat", 34 | L"Quant a", 35 | L"Paràmetres generals", 36 | L"En&focar finestres quan s'arrosseguen.\nPots premer també Ctrl per enfocar finestres.", 37 | L"Imita Aero S&nap", 38 | L"De&splaçament en finestres inactives", 39 | L"Suport d'&MDI", 40 | L"Automaticament s'adapta al desplaçar a:", 41 | L"Desactivat", 42 | L"Als contorns de les finestres", 43 | L"+ a l'exterior de les finestres", 44 | L"+ a l'interior de les finestres", 45 | L"Llenguatge:", 46 | L"Autoinici", 47 | L"Inicia Al&tDrag al arrencar", 48 | L"Amaga safata", 49 | L"&Eleva a privilegis d'administrador", 50 | L"Nota que un diàleg UAC apareixerà cada vegada que inicies sessió, a menys que desactives UAC completament.", 51 | L"E&levar", 52 | L"Elevat", 53 | L"Açò crearà una nova instància d'AltDrag que està en marxa amb privilegis d'administrador. Açò permet AltDrag gestionar altres programes que estan en marxa amb privilegis d'administrador.\n\nHauràs d'aprovar un diàleg UAC de Windows per permetre AltDrag que s'executi amb privilegis d'administrador.", 54 | L"Elevació interrompuda.", 55 | L"Note: Els paràmetres es desen i s'apliquen instantàniament!", 56 | L"Accions del ratolí", 57 | L"Botó esquerre del ratolí:", 58 | L"Botó del mig del ratolí:", 59 | L"Botó dret del ratolí:", 60 | L"Botó 4 del ratolí:", 61 | L"Botó 5 del ratolí:", 62 | L"Roda de desplaçament:", 63 | L"Envia finestres a&l fons fent clic al botó del mig en les barres de títol", 64 | L"Desplaçar finestra", 65 | L"Redimensionar finestra", 66 | L"Tancar finestra", 67 | L"Minimitzar finestra", 68 | L"Enviar finestra al fons", 69 | L"Commutar finestra dalt de tot", 70 | L"Centrar finestra en pantalla", 71 | L"Res", 72 | L"Alt+Tab", 73 | L"Volum", 74 | L"Transparència", 75 | L"Dreceres teclat:", 76 | L"Alt &esquerra", 77 | L"Alt d&reta", 78 | L"&Windows esquerra", 79 | L"W&indows dreta", 80 | L"&Ctrl esquerra", 81 | L"C&trl dreta", 82 | L"Pots afegir qualsevol tecla editant l'arxiu ini.\nUtilitza la tecla de majúscules per ajustar finestres entre elles.", 83 | L"Paràmetres de llista negra", 84 | L"Llista negra de processos:", 85 | L"Llista negra:", 86 | L"Llista d'adaptació automàtica:", 87 | L"Llig el wiki en la web per a una explicació de com funcionen les llistes negres!", 88 | L"Identificar finestra", 89 | L"Fes clic en la icona per identificar el nom de la classe d'una finestra i així podras afegir-la a la llista negra o a la d'adaptació automàtica.", 90 | L"Paràmetres avançats", 91 | L"Habilita adaptació quan m&eneges finestres.\nFunciona junt amb l'adaptació automàtica!", 92 | L"Nota: aquesta característica no és 100% segura ja que funciona enganxant altres processos. Açò pot ser arriscat en jocs amb protecció anti-trampes.\n\nEstàs segur de voler activar aquesta característica?", 93 | L"Comprova actualitzacions a&utomàticament", 94 | L"Comprova versions &beta", 95 | L"&Comprova ara", 96 | L"Els paràmetres d'AltDrag es desen en AltDrag.ini. Hi ha algunes coses que només pots configurar editant l'arxiu manualment.", 97 | L"Obrir arxiu &ini", 98 | L"Quant a AltDrag", 99 | L"Versió 1.0", 100 | L"Creat per Stefan Sundin", 101 | L"AltDrag és gratuït i programari de codi obert!\nEts lliure de redistribuïr-lo!", 102 | L"Fer &donació", 103 | L"Crèdits de traducció", 104 | L"Hi ha hagut un error desactivant AltDrag. Açò probablement ha passat perquè Windows ja ha desactivat els ganxos d'AltDrag.\n\nSi aquesta és la primera vegada que açò passa, pots ignorar-ho sense problema i continuar usant AltDrag.\n\nSi açò passa repetidament, pots llegir al wiki de la web com previndre que açò torne a passar (cerca 'AltDrag mysteriously stops working' en la pàgina de \"Quant a\").", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/es_ES/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Jorge Amigo 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings es_ES = { 13 | L"es-ES", 14 | L"Spanish", 15 | L"Español", 16 | L"Jorge Amigo", 17 | L"AltDrag", 18 | L"AltDrag (deshabilitado)", 19 | L"Habilitar", 20 | L"Deshabilitar", 21 | L"No mostrar en la bandeja", 22 | L"¡Actualización disponible!", 23 | L"Configurar", 24 | L"Acerca de", 25 | L"Salir", 26 | L"¡Encontrada una nueva versión!", 27 | L"Está disponible una nueva versión. ¿Ir al sitio web?", 28 | L"No hay actualizaciones disponibles.", 29 | L"Configuración de AltDrag", 30 | L"General", 31 | L"Ratón y teclado", 32 | L"Lista Negra", 33 | L"Avanzado", 34 | L"Acerca de", 35 | L"Configuración general", 36 | L"&Enfocar ventanas al arrastrar.\nTambién se puede pulsar Ctrl para enfocar ventanas.", 37 | L"Imitar Aero Snap", 38 | L"&Desplazar página en ventanas inactivas", 39 | L"&Soporte MDI", 40 | L"Automáticamente pegarse a:", 41 | L"Deshabilitado", 42 | L"A los bordes de la pantalla", 43 | L"+ exterior de las ventanas", 44 | L"+ interior de las ventanas", 45 | L"Idioma:", 46 | L"Inicio automático", 47 | L"Iniciar AltDrag al iniciar sesión", 48 | L"&No mostrar en la bandeja", 49 | L"&Elevar a privilegios de administrador", 50 | L"Nótese que aparecerá un mensaje UAC cada vez que se inicie sesión, a menos que se deshabilite UAC completamente.", 51 | L"Elevar", 52 | L"Elevado", 53 | L"Esto creará una nueva instancia de AltDrag que se ejecutará con privilegios de administrador. Esto permite a AltDrag manejar otros programas que se ejecuten con privilegios de administrador.\n\nEl mensaje UAC de Windows deberá ser aceptado para permitir que AltDrag se ejecute con privilegios de administrador.", 54 | L"Elevación cancelada.", 55 | L"Nota: La configuración se salva y se aplica al instante!", 56 | L"Acciones de ratón", 57 | L"Botón izquierdo del ratón:", 58 | L"Botón medio del ratón:", 59 | L"Botón derecho del ratón:", 60 | L"Botón 4 del ratón:", 61 | L"Botón 5 del ratón:", 62 | L"Rueda de desplazamiento:", 63 | L"&Enviar al fondo las ventanas al pulsar con el botón del medio en sus barras de título", 64 | L"Mover ventana", 65 | L"Redimensionar ventana", 66 | L"Cerrar ventana", 67 | L"Minimizar ventana", 68 | L"Enviar al fondo la ventana", 69 | L"Activar siempre encima", 70 | L"Centrar ventana en pantalla", 71 | L"Nada", 72 | L"Alt+Tab", 73 | L"Volumen", 74 | L"Transparencia", 75 | L"Teclas especiales:", 76 | L"Alt izquierda", 77 | L"Alt derecha", 78 | L"Win izquierda", 79 | L"Win derecha", 80 | L"Ctrl izquierda", 81 | L"Ctrl derecha", 82 | L"Se puede añadir cualquier tecla editando el archivo ini.\nUsar la tecla Mayúsculas para pegar ventanas unas a otras.", 83 | L"Configuración de la lista negra", 84 | L"Lista negra de procesos:", 85 | L"Lista negra:", 86 | L"Lista de pegado:", 87 | L"Leer la wiki en el sitio web para una explicación en detalle acerca de cómo funciona la lista negra!", 88 | L"Identificar ventana", 89 | L"Hacer clic en el icono para identificar la clase de una ventana y añadirla a las listas negra o de pegado de arriba.", 90 | L"Configuración avanzada", 91 | L"&Habilitar pegado de ventanas al mover normalmente.\nFunciona junto al pegado de ventanas automático!", 92 | L"Nótese que esto no es 100% seguro ya que esta opción funciona enganchándose a otros procesos. Su uso puede ser arriesgado cuando se juegue a juegos con protección anti-trampas.\n\nEstá seguro de querer habilitar esta funcionalidad?", 93 | L"Buscar actualizaciones automáticamente", 94 | L"Buscar versiones beta", 95 | L"Buscar ahora", 96 | L"La configuración de AltDrag se almacenan en AltDrag.ini. Existen algunas cosas que sólo se pueden configurar editando este fichero manualmente.", 97 | L"Abrir el fichero ini", 98 | L"Acerca de AltDrag", 99 | L"Versión 1.0", 100 | L"Creado por Stefan Sundin", 101 | L"¡AltDrag es software libre y de código abierto!\n¡Puede ser redistribuido libremente!", 102 | L"&Donar", 103 | L"Traducido por Jorge Amigo", 104 | L"Ha habido un error deshabilitando AltDrag. La causa más probable es que Windows haya deshailitado los ganchos de AltDrag.\n\nSi ésta es la primera vez que ocurre, puede ignorarlo y continuar usando AltDrag.\n\nSi esto ocurre habitualmente, se puede leer en la wiki del sitio web cómo prevenir este comportamiento (hay que buscar 'AltDrag mysteriously stops working' en la página de About).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/de_DE/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag 1.0 - localization by Markus Hentsch 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Do not edit this file! It is automatically generated from Translate.ini! 10 | */ 11 | 12 | struct strings de_DE = { 13 | L"de-DE", 14 | L"German", 15 | L"Deutsch", 16 | L"Markus Hentsch", 17 | L"AltDrag", 18 | L"AltDrag (deaktiviert)", 19 | L"Aktivieren", 20 | L"Deaktivieren", 21 | L"Symbol verstecken", 22 | L"Aktualisierung verfügbar!", 23 | L"Einstellungen", 24 | L"Über...", 25 | L"Beenden", 26 | L"Neue Version verfügbar!", 27 | L"Eine neue Version ist verfügbar. Zur Webseite wechseln?", 28 | L"Keine Aktualisierung verfügbar.", 29 | L"AltDrag Einstellungen", 30 | L"Allgemein", 31 | L"Maus und Tastatur", 32 | L"Blacklist", 33 | L"Erweitert", 34 | L"Über", 35 | L"Allgemeine Einstellungen", 36 | L"&Fenster beim Verschieben nach vorn bringen.\n(Dafür kann wahlweise auch Strg gedrückt werden)", 37 | L"Aero Snap &immitieren", 38 | L"Mausrad-&Scrollen in inaktiven Fenstern", 39 | L"&MDI Unterstützung", 40 | L"Fenster automatisch einrasten an:", 41 | L"Deaktiviert", 42 | L"Bildschirmkanten", 43 | L"+ Fenstern von außen", 44 | L"+ Fenstern von innen", 45 | L"Sprache:", 46 | L"Autostart", 47 | L"AltDrag bei der A&nmeldung starten", 48 | L"&Tray Symbol verstecken", 49 | L"als A&dministrator ausführen", 50 | L"Beachten Sie, dass jedes Mal nach dem Anmelden eine Benutzerkontenabfrage erscheint solange die Benutzerkontensteuerung aktiv ist.", 51 | L"Ad&min-Modus", 52 | L"Admin aktiv", 53 | L"Dies wird eine neue Instanz von AltDrag erstellen, die mit Administratorberechtigungen ausgeführt wird. Dies ermöglicht AltDrag andere Programme zu verwalten, die auch mit Administratorberechtigungen gestartet wurden.\n\nSie müssen eine Benutzerkontenabfrage bestätigen, wenn Sie AltDrag Administratorberechtigungen verleihen wollen.", 54 | L"Admin-Modus abgebrochen.", 55 | L"Hinweis: Änderungen werden sofort gespeichert und aktiv!", 56 | L"Mausbefehle", 57 | L"Linke Maustaste:", 58 | L"Mittlere Maustaste:", 59 | L"Rechte Maustaste:", 60 | L"Maustaste 4:", 61 | L"Maustaste 5:", 62 | L"Scrollrad:", 63 | L"&Mittlere Maustaste auf Titelleisten bringt Fenster in den Hintergrund", 64 | L"Fenster verschieben", 65 | L"Fenstergröße ändern", 66 | L"Fenster schließen", 67 | L"Fenster minimieren", 68 | L"Fenster in den Hintergrund", 69 | L"Immer im Vordergrund", 70 | L"Fenster zentrieren", 71 | L"Nichts", 72 | L"Alt+Tab", 73 | L"Lautstärke", 74 | L"Transparenz", 75 | L"Tastaturkürzel:", 76 | L"A< links", 77 | L"Al&t rechts", 78 | L"&Windows links", 79 | L"W&indows rechts", 80 | L"&Strg links", 81 | L"St&rg rechts", 82 | L"Weitere Tasten können in der ini Datei hinzugefügt werden.\nBenutzen Sie Shift um Fenster einrasten zu lassen.", 83 | L"Blacklist Einstellungen", 84 | L"Blacklist für Prozesse:", 85 | L"Blacklist:", 86 | L"Snaplist (Einrasten verhindern):", 87 | L"Eine umfassende Erklärung, wie die Blacklist funktioniert, finden Sie in der Wiki!", 88 | L"Fenster identifizieren", 89 | L"Klicken Sie auf das Symbol um den Klassennamen eines Fensters zu ermitteln, sodass dieser oben der Blacklist oder Snaplist hinzugefügt werden kann.", 90 | L"Erweiterte Einstellungen", 91 | L"&Einrasten beim normalen Verschieben von Fenstern.\nFunktioniert zusammen mit automatischem Einrasten!", 92 | L"Beachten Sie, dass diese Funktion nicht zu 100% sicher ist, da sie durch das Einhängen in andere Prozesse ermöglicht wird. Dies könnte bei Spielen riskant sein, die einen Anti-Cheat Schutz besitzen.\n\nSind Sie sich sicher, dass Sie diese Funktion aktivieren möchten?", 93 | L"A&utomatisch nach Aktualisierungen suchen", 94 | L"Auf &Beta-Versionen prüfen", 95 | L"&Jetzt prüfen", 96 | L"Die Einstellungen von AltDrag werden in AltDrag.ini gespeichert. Es gibt ein paar Dinge, die nur durch das Bearbeiten dieser Datei eingestellt werden können.", 97 | L"&ini Datei öffnen", 98 | L"Über AltDrag", 99 | L"Version 1.0", 100 | L"Erstellt von Stefan Sundin", 101 | L"AltDrag ist freie Open-Source Software!\nGeben Sie es ruhig weiter!", 102 | L"&Spenden", 103 | L"Übersetzungen", 104 | L"Beim Deaktivieren von AltDrag ist ein Fehler aufgetreten. Dies ist höchstwahrscheinlich darauf zurückzuführen, dass Windows bereits die Hooks von AltDrag deaktiviert hat.\n\nSollte dieser Fehler zum ersten Mal auftreten, können Sie diese Meldung ignorieren und AltDrag weiterhin normal nutzen.\n\nSollte der Fehler jedoch mehrfach auftreten, können Sie in der Wiki auf der Webseite nachlesen, wie dies verhindert werden kann (Suchen Sie nach 'AltDrag mysteriously stops working' auf der 'About'-Seite).", 105 | }; 106 | -------------------------------------------------------------------------------- /localization/ca_ES/Translation.ini: -------------------------------------------------------------------------------- 1 | ; Translation file for AltDrag 1.0 2 | ; ca-ES localization by Àlfons Sánchez 3 | ; Simply put this file in the same directory as AltDrag, then reload AltDrag. 4 | ; Please read the website for help: https://stefansundin.github.io/altdrag/doc/translate.html 5 | ; Use encoding UTF-16LE with BOM to be able to use Unicode 6 | 7 | [Translation] 8 | Code=ca-ES 9 | LangEnglish=Catalan 10 | Lang=Catalá 11 | Author=Àlfons Sánchez 12 | 13 | TrayEnabled=AltDrag 14 | TrayDisabled=AltDrag (desactivat) 15 | MenuEnable=Activat 16 | MenuDisable=Desactivat 17 | MenuHideTray=Amaga safata 18 | MenuUpdateAvailable=Actualització disponible! 19 | MenuConfigure=Configurar 20 | MenuAbout=Quant a 21 | MenuExit=Sortir 22 | 23 | UpdateBalloon=Nova versió trobada! 24 | UpdateDialog=Una nova versió està disponible. Anar a la web? 25 | UpdateLatest=Sense actualitzacions. 26 | 27 | ConfigTitle=AltDrag Configuració 28 | ConfigTabGeneral=General 29 | ConfigTabInput=Ratolí i teclat 30 | ConfigTabBlacklist=Llista negra 31 | ConfigTabAdvanced=Avançat 32 | ConfigTabAbout=Quant a 33 | 34 | GeneralBox=Paràmetres generals 35 | GeneralAutoFocus=En&focar finestres quan s'arrosseguen.\nPots premer també Ctrl per enfocar finestres. 36 | GeneralAero=Imita Aero S&nap 37 | GeneralInactiveScroll=De&splaçament en finestres inactives 38 | GeneralMDI=Suport d'&MDI 39 | GeneralAutoSnap=Automaticament s'adapta al desplaçar a: 40 | GeneralAutoSnap0=Desactivat 41 | GeneralAutoSnap1=Als contorns de les finestres 42 | GeneralAutoSnap2=+ a l'exterior de les finestres 43 | GeneralAutoSnap3=+ a l'interior de les finestres 44 | GeneralLanguage=Llenguatge: 45 | GeneralAutostartBox=Autoinici 46 | GeneralAutostart=Inicia Al&tDrag al arrencar 47 | GeneralAutostartHide=Amaga safata 48 | GeneralAutostartElevate=&Eleva a privilegis d'administrador 49 | GeneralAutostartElevateTip=Nota que un diàleg UAC apareixerà cada vegada que inicies sessió, a menys que desactives UAC completament. 50 | GeneralElevate=E&levar 51 | GeneralElevated=Elevat 52 | GeneralElevateTip=Açò crearà una nova instància d'AltDrag que està en marxa amb privilegis d'administrador. Açò permet AltDrag gestionar altres programes que estan en marxa amb privilegis d'administrador.\n\nHauràs d'aprovar un diàleg UAC de Windows per permetre AltDrag que s'executi amb privilegis d'administrador. 53 | GeneralElevationAborted=Elevació interrompuda. 54 | GeneralAutosave=Note: Els paràmetres es desen i s'apliquen instantàniament! 55 | 56 | InputMouseBox=Accions del ratolí 57 | InputMouseLMB=Botó esquerre del ratolí: 58 | InputMouseMMB=Botó del mig del ratolí: 59 | InputMouseRMB=Botó dret del ratolí: 60 | InputMouseMB4=Botó 4 del ratolí: 61 | InputMouseMB5=Botó 5 del ratolí: 62 | InputMouseScroll=Roda de desplaçament: 63 | InputMouseLowerWithMMB=Envia finestres a&l fons fent clic al botó del mig en les barres de títol 64 | 65 | InputActionMove=Desplaçar finestra 66 | InputActionResize=Redimensionar finestra 67 | InputActionClose=Tancar finestra 68 | InputActionMinimize=Minimitzar finestra 69 | InputActionLower=Enviar finestra al fons 70 | InputActionAlwaysOnTop=Commutar finestra dalt de tot 71 | InputActionCenter=Centrar finestra en pantalla 72 | InputActionNothing=Res 73 | InputActionAltTab=Alt+Tab 74 | InputActionVolume=Volum 75 | InputActionTransparency=Transparència 76 | 77 | InputHotkeysBox=Dreceres teclat: 78 | InputHotkeysLeftAlt=Alt &esquerra 79 | InputHotkeysRightAlt=Alt d&reta 80 | InputHotkeysLeftWinkey=&Windows esquerra 81 | InputHotkeysRightWinkey=W&indows dreta 82 | InputHotkeysLeftCtrl=&Ctrl esquerra 83 | InputHotkeysRightCtrl=C&trl dreta 84 | InputHotkeysMore=Pots afegir qualsevol tecla editant l'arxiu ini.\nUtilitza la tecla de majúscules per ajustar finestres entre elles. 85 | 86 | BlacklistBox=Paràmetres de llista negra 87 | BlacklistProcessBlacklist=Llista negra de processos: 88 | BlacklistBlacklist=Llista negra: 89 | BlacklistSnaplist=Llista d'adaptació automàtica: 90 | BlacklistExplanation=Llig el wiki en la web per a una explicació de com funcionen les llistes negres! 91 | BlacklistFindWindowBox=Identificar finestra 92 | BlacklistFindWindowExplanation=Fes clic en la icona per identificar el nom de la classe d'una finestra i així podras afegir-la a la llista negra o a la d'adaptació automàtica. 93 | 94 | AdvancedBox=Paràmetres avançats 95 | AdvancedHookWindows=Habilita adaptació quan m&eneges finestres.\nFunciona junt amb l'adaptació automàtica! 96 | AdvancedHookWindowsWarn=Nota: aquesta característica no és 100% segura ja que funciona enganxant altres processos. Açò pot ser arriscat en jocs amb protecció anti-trampes.\n\nEstàs segur de voler activar aquesta característica? 97 | AdvancedUpdateCheckOnStartup=Comprova actualitzacions a&utomàticament 98 | AdvancedUpdateBeta=Comprova versions &beta 99 | AdvancedUpdateCheckNow=&Comprova ara 100 | AdvancedIni=Els paràmetres d'AltDrag es desen en AltDrag.ini. Hi ha algunes coses que només pots configurar editant l'arxiu manualment. 101 | AdvancedOpenIni=Obrir arxiu &ini 102 | 103 | AboutBox=Quant a AltDrag 104 | AboutVersion=Versió 105 | AboutAuthor=Creat per Stefan Sundin 106 | AboutLicense=AltDrag és gratuït i programari de codi obert!\nEts lliure de redistribuïr-lo! 107 | AboutDonate=Fer &donació 108 | AboutTranslationCredit=Crèdits de traducció 109 | 110 | MiscUnhookError=Hi ha hagut un error desactivant AltDrag. Açò probablement ha passat perquè Windows ja ha desactivat els ganxos d'AltDrag.\n\nSi aquesta és la primera vegada que açò passa, pots ignorar-ho sense problema i continuar usant AltDrag.\n\nSi açò passa repetidament, pots llegir al wiki de la web com previndre que açò torne a passar (cerca 'AltDrag mysteriously stops working' en la pàgina de "Quant a"). 111 | -------------------------------------------------------------------------------- /include/update.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | #include 11 | 12 | const wchar_t const *update_urls[] = { 13 | L"https://update.stefansundin.com/altdrag/latest-stable.txt", 14 | L"https://stefansundin.github.io/altdrag/latest-stable.txt", 15 | L"https://stefansundin.com/altdrag-latest-stable.txt", 16 | L"" 17 | }; 18 | 19 | const wchar_t const *beta_update_urls[] = { 20 | L"https://update.stefansundin.com/altdrag/latest-beta.txt", 21 | L"https://stefansundin.github.io/altdrag/latest-beta.txt", 22 | L"https://stefansundin.com/altdrag-latest-beta.txt", 23 | L"" 24 | }; 25 | 26 | int update = 0; 27 | 28 | int OpenUrl(wchar_t *url) { 29 | int ret = (INT_PTR) ShellExecute(NULL, L"open", url, NULL, NULL, SW_SHOWDEFAULT); 30 | if (ret <= 32 && MessageBox(NULL,L"Failed to open browser. Copy url to clipboard?",APP_NAME,MB_ICONWARNING|MB_YESNO) == IDYES) { 31 | int size = (wcslen(url)+1)*sizeof(url[0]); 32 | wchar_t *data = LocalAlloc(LMEM_FIXED, size); 33 | memcpy(data, url, size); 34 | OpenClipboard(NULL); 35 | EmptyClipboard(); 36 | SetClipboardData(CF_UNICODETEXT, data); 37 | CloseClipboard(); 38 | LocalFree(data); 39 | } 40 | return ret; 41 | } 42 | 43 | DWORD WINAPI _CheckForUpdate(LPVOID arg) { 44 | int verbose = *(int*) arg; 45 | free(arg); 46 | 47 | // Check if we should check for beta 48 | wchar_t path[MAX_PATH], txt[10]; 49 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 50 | PathRemoveFileSpec(path); 51 | wcscat(path, L"\\"APP_NAME".ini"); 52 | GetPrivateProfileString(L"Update", L"Beta", L"0", txt, ARRAY_SIZE(txt), path); 53 | int beta = _wtoi(txt); 54 | 55 | // Check if we are connected to the internet 56 | DWORD flags; // Not really used 57 | int tries = 0; // Try at least ten times, sleep one second between each attempt 58 | while (InternetGetConnectedState(&flags,0) == FALSE) { 59 | tries++; 60 | if (!verbose) { 61 | Sleep(1000); 62 | } 63 | if (tries >= 10 || verbose) { 64 | if (verbose) { 65 | Error(L"InternetGetConnectedState()", L"No internet connection.\n\nPlease check for update manually on the website.", GetLastError()); 66 | } 67 | return 1; 68 | } 69 | } 70 | 71 | // Configure client 72 | HINTERNET http = InternetOpen(APP_NAME"/"APP_VERSION, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); 73 | if (http == NULL) { 74 | if (verbose) { 75 | Error(L"InternetOpen()", L"Could not establish connection.\n\nPlease check for update manually on the website.", GetLastError()); 76 | } 77 | return 1; 78 | } 79 | unsigned long timeout = 5000; 80 | InternetSetOption(http, INTERNET_OPTION_CONNECT_TIMEOUT, &timeout, sizeof(timeout)); 81 | 82 | short success = 0; 83 | int i = 0; 84 | const wchar_t const **urls = (beta ? beta_update_urls : update_urls); 85 | 86 | for (i=0; urls[i][0] != '\0'; i++) { 87 | const wchar_t const *url = urls[i]; 88 | 89 | // Open connection 90 | // DBG("Checking %s", url); 91 | HINTERNET file = InternetOpenUrl(http, url, NULL, 0, INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_NO_AUTH|INTERNET_FLAG_NO_AUTO_REDIRECT|INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_NO_UI, 0); 92 | if (file == NULL) { 93 | // Error(L"InternetOpenUrl(http) == NULL", L"", GetLastError()); 94 | continue; 95 | } 96 | 97 | // Read response 98 | char data[20]; 99 | DWORD numread; 100 | if (InternetReadFile(file,data,sizeof(data),&numread) == FALSE) { 101 | // Error(L"InternetReadFile(file) == NULL", L"", GetLastError()); 102 | InternetCloseHandle(file); 103 | continue; 104 | } 105 | data[numread] = '\0'; 106 | // Get response code 107 | wchar_t code[4]; 108 | DWORD len = sizeof(code); 109 | HttpQueryInfo(file, HTTP_QUERY_STATUS_CODE, &code, &len, NULL); 110 | // Close handle 111 | InternetCloseHandle(file); 112 | 113 | // Make sure the response is valid 114 | char header[] = "Version: "; 115 | if (wcscmp(code,L"200") || strstr(data,header) != data) { 116 | continue; 117 | } 118 | 119 | // We have found the version number 120 | success = 1; 121 | 122 | // New version available? 123 | char *latest = data+strlen(header); 124 | 125 | // Terminate newline, if any 126 | char *p; 127 | for (p=latest; *p != '\0'; p++) { 128 | if (*p == '\r' || *p == '\n') { 129 | *p = '\0'; 130 | break; 131 | } 132 | } 133 | 134 | // Compare version numbers 135 | int cmp = strcmp(latest, APP_VERSION); 136 | if (cmp > 0 || (beta && cmp != 0)) { 137 | update = 1; 138 | if (verbose) { 139 | SendMessage(g_hwnd, WM_COMMAND, SWM_UPDATE, 0); 140 | } 141 | else { 142 | wcsncpy(tray.szInfo, l10n->update_balloon, ARRAY_SIZE(tray.szInfo)); 143 | tray.uFlags |= NIF_INFO; 144 | UpdateTray(); 145 | tray.uFlags ^= NIF_INFO; 146 | } 147 | } 148 | else { 149 | update = 0; 150 | if (verbose) { 151 | MessageBox(NULL, l10n->update_nonew, APP_NAME, MB_ICONINFORMATION|MB_OK); 152 | } 153 | } 154 | break; 155 | } 156 | 157 | InternetCloseHandle(http); 158 | 159 | if (!success) { 160 | if (verbose) { 161 | MessageBox(NULL, L"Could not determine if an update is available.\n\nPlease check for update manually on the website.", APP_NAME, MB_ICONWARNING|MB_OK); 162 | } 163 | return 3; 164 | } 165 | 166 | return 0; 167 | } 168 | 169 | void CheckForUpdate(int p_verbose) { 170 | int *verbose = malloc(sizeof(p_verbose)); 171 | *verbose = p_verbose; 172 | HANDLE thread = CreateThread(NULL, 0, _CheckForUpdate, verbose, 0, NULL); 173 | CloseHandle(thread); 174 | } 175 | -------------------------------------------------------------------------------- /hookwindows_x64.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | #define UNICODE 11 | #define _UNICODE 12 | #define _WIN32_WINNT 0x0500 13 | #define _WIN32_IE 0x0600 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | // App 21 | #define APP_NAME L"AltDrag" 22 | 23 | // Boring stuff 24 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 25 | LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM); 26 | HINSTANCE g_hinst = NULL; 27 | HWND g_hwnd = NULL; 28 | 29 | // Cool stuff 30 | HINSTANCE hinstDLL = NULL; 31 | HHOOK keyhook = NULL; 32 | HHOOK msghook = NULL; 33 | 34 | // Include stuff 35 | #include "include/error.c" 36 | 37 | // Entry point 38 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow) { 39 | g_hinst = hInst; 40 | 41 | // Warn user 42 | if (szCmdLine[0] == '\0') { 43 | MessageBox(NULL, L"HookWindows_x64.exe is launched automatically by "APP_NAME" if you have enabled HookWindows. There is no need to launch it manually.\n\nIf you still want to do this, launch HookWindows_x64.exe with an argument (it can be anything) to bypass this dialog.\n\nKeep in mind that HookWindows_x64.exe will automatically exit if it can't find "APP_NAME" running.", L"HookWindows_x64.exe", MB_ICONINFORMATION|MB_OK); 44 | return 1; 45 | } 46 | 47 | // Look for previous instance and make sure AltDrag is running 48 | if (FindWindow(APP_NAME"-x64",NULL) != NULL 49 | || FindWindow(APP_NAME,NULL) == NULL) { 50 | return 0; 51 | } 52 | 53 | // Create window 54 | WNDCLASSEX wnd = { sizeof(WNDCLASSEX), 0, WindowProc, 0, 0, hInst, NULL, NULL, NULL, NULL, APP_NAME"-x64", NULL }; 55 | RegisterClassEx(&wnd); 56 | g_hwnd = CreateWindowEx(0, wnd.lpszClassName, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, hInst, NULL); 57 | 58 | // Start a timer that checks if AltDrag is still running every 10 seconds 59 | SetTimer(g_hwnd, 0, 10000, NULL); 60 | 61 | // Hook system 62 | HookSystem(); 63 | 64 | // Exit if msghook failed 65 | if (!msghook) { 66 | return 1; 67 | } 68 | 69 | // Message loop 70 | MSG msg; 71 | while (GetMessage(&msg,NULL,0,0)) { 72 | TranslateMessage(&msg); 73 | DispatchMessage(&msg); 74 | } 75 | return msg.wParam; 76 | } 77 | 78 | int HookSystem() { 79 | if (keyhook && msghook) { 80 | // System already hooked 81 | return 1; 82 | } 83 | 84 | // Load library 85 | if (!hinstDLL) { 86 | wchar_t path[MAX_PATH]; 87 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 88 | PathRemoveFileSpec(path); 89 | wcscat(path, L"\\hooks_x64.dll"); 90 | hinstDLL = LoadLibrary(path); 91 | if (hinstDLL == NULL) { 92 | Error(L"LoadLibrary('hooks_x64.dll')", L"This probably means that the file hooks_x64.dll is missing. You can try reinstalling "APP_NAME".", GetLastError()); 93 | return 1; 94 | } 95 | } 96 | 97 | HOOKPROC procaddr; 98 | if (!keyhook) { 99 | // Get address to keyboard hook (beware name mangling) 100 | procaddr = (HOOKPROC)GetProcAddress(hinstDLL, "LowLevelKeyboardProc"); 101 | if (procaddr == NULL) { 102 | Error(L"GetProcAddress('LowLevelKeyboardProc')", L"This probably means that the file hooks_x64.dll is from an old version or corrupt. You can try reinstalling "APP_NAME".", GetLastError()); 103 | return 1; 104 | } 105 | // Set up the keyboard hook 106 | keyhook = SetWindowsHookEx(WH_KEYBOARD_LL, procaddr, hinstDLL, 0); 107 | if (keyhook == NULL) { 108 | Error(L"SetWindowsHookEx(WH_KEYBOARD_LL)", L"Could not hook keyboard. Another program might be interfering.", GetLastError()); 109 | return 1; 110 | } 111 | } 112 | 113 | // Get address to message hook (beware name mangling) 114 | if (!msghook) { 115 | procaddr = (HOOKPROC)GetProcAddress(hinstDLL, "CallWndProc"); 116 | if (procaddr == NULL) { 117 | Error(L"GetProcAddress('CallWndProc')", L"This probably means that the file hooks_x64.dll is from an old version or corrupt. You can try reinstalling "APP_NAME".", GetLastError()); 118 | return 1; 119 | } 120 | // Set up the message hook 121 | msghook = SetWindowsHookEx(WH_CALLWNDPROC, procaddr, hinstDLL, 0); 122 | if (msghook == NULL) { 123 | Error(L"SetWindowsHookEx(WH_CALLWNDPROC)", L"Could not hook message hook. Another program might be interfering.", GetLastError()); 124 | return 1; 125 | } 126 | } 127 | 128 | // Success 129 | return 0; 130 | } 131 | 132 | int UnhookSystem() { 133 | if (!keyhook && !msghook) { 134 | // System not hooked 135 | return 1; 136 | } 137 | 138 | // Remove keyboard hook 139 | if (UnhookWindowsHookEx(keyhook) == 0) { 140 | #ifdef DEBUG 141 | Error(L"UnhookWindowsHookEx(keyhook)", L"Could not unhook keyboard. Try restarting "APP_NAME".", GetLastError()); 142 | #endif 143 | return 1; 144 | } 145 | keyhook = NULL; 146 | 147 | // Remove message hook 148 | if (UnhookWindowsHookEx(msghook) == 0) { 149 | #ifdef DEBUG 150 | Error(L"UnhookWindowsHookEx(msghook)", L"Could not unhook message hook. Try restarting "APP_NAME".", GetLastError()); 151 | #endif 152 | return 1; 153 | } 154 | msghook = NULL; 155 | 156 | // Tell dll file that we are unloading 157 | void (*Unload)() = (void*)GetProcAddress(hinstDLL, "Unload"); 158 | if (Unload == NULL) { 159 | #ifdef DEBUG 160 | Error(L"GetProcAddress('Unload')", L"This probably means that the file hooks_x64.dll is from an old version or corrupt. You can try reinstalling "APP_NAME".", GetLastError()); 161 | #endif 162 | } 163 | else { 164 | Unload(); 165 | } 166 | 167 | if (hinstDLL) { 168 | // Unload library 169 | if (FreeLibrary(hinstDLL) == 0) { 170 | #ifdef DEBUG 171 | Error(L"FreeLibrary()", L"Could not free hooks_x64.dll. Try restarting "APP_NAME".", GetLastError()); 172 | #endif 173 | return 1; 174 | } 175 | hinstDLL = NULL; 176 | } 177 | 178 | // Success 179 | return 0; 180 | } 181 | 182 | LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { 183 | if (msg == WM_DESTROY || msg == WM_QUERYENDSESSION) { 184 | showerror = 0; 185 | UnhookSystem(); 186 | PostQuitMessage(0); 187 | } 188 | else if (msg == WM_TIMER) { 189 | // Exit if AltDrag is not running 190 | if (FindWindow(APP_NAME,NULL) == NULL) { 191 | SendMessage(hwnd, WM_CLOSE, 0, 0); 192 | } 193 | } 194 | return DefWindowProc(hwnd, msg, wParam, lParam); 195 | } 196 | -------------------------------------------------------------------------------- /localization/en_US/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | AltDrag - en-US localization by Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | struct strings en_US = { 11 | /* === translation info === */ 12 | /* code */ L"en-US", 13 | /* lang_english */ L"English", 14 | /* lang */ L"English", 15 | /* author */ L"Stefan Sundin", 16 | 17 | /* === app === */ 18 | /* tray_enabled */ APP_NAME L"", 19 | /* tray_disabled */ APP_NAME L" (disabled)", 20 | 21 | /* menu */ 22 | /* enable */ L"Enable", 23 | /* disable */ L"Disable", 24 | /* hide */ L"Hide tray", 25 | /* update */ L"Update available!", 26 | /* config */ L"Configure", 27 | /* about */ L"About", 28 | /* exit */ L"Exit", 29 | 30 | /* update */ 31 | /* balloon */ L"New version found!", 32 | /* dialog */ L"A new version is available. Go to website?", 33 | /* nonew */ L"No update available.", 34 | 35 | /* === config === */ 36 | /* title */ APP_NAME L" Configuration", 37 | /* tabs */ 38 | /* general */ L"General", 39 | /* input */ L"Mouse and keyboard", 40 | /* blacklist */ L"Blacklist", 41 | /* advanced */ L"Advanced", 42 | /* about */ L"About", 43 | 44 | /* general tab */ 45 | /* box */ L"General settings", 46 | /* autofocus */ L"&Focus windows when dragging.\nYou can also press Ctrl to focus windows.", 47 | /* aero */ L"Mimic &Aero Snap", 48 | /* inactivescroll */ L"&Scroll inactive windows", 49 | /* mdi */ L"&MDI support", 50 | /* autosnap */ L"Automatically snap to:", 51 | /* autosnap0 */ L"Disabled", 52 | /* autosnap1 */ L"To screen borders", 53 | /* autosnap2 */ L"+ outside of windows", 54 | /* autosnap3 */ L"+ inside of windows", 55 | /* language */ L"Language:", 56 | /* autostart_box */ L"Autostart", 57 | /* autostart */ L"S&tart "APP_NAME" when logging on", 58 | /* autostart_hide */ L"&Hide tray", 59 | /* autostart_elevate */ L"&Elevate to administrator privileges", 60 | /* elevate_tip */ L"Note that a UAC prompt will appear every time you log in, unless you disable UAC completely.", 61 | /* elevate */ L"E&levate", 62 | /* elevated */ L"Elevated", 63 | /* elevate_tip */ L"This will create a new instance of "APP_NAME" which is running with administrator privileges. This allows "APP_NAME" to manage other programs which are running with administrator privileges.\n\nYou will have to approve a UAC prompt from Windows to allow "APP_NAME" to run with administrator privileges.", 64 | /* elevation_aborted */ L"Elevation aborted.", 65 | /* autosave */ L"Note: Settings are saved and applied instantly!", 66 | 67 | /* input tab */ 68 | /* mouse */ 69 | /* box */ L"Mouse actions", 70 | /* lmb */ L"Left mouse button:", 71 | /* mmb */ L"Middle mouse button:", 72 | /* rmb */ L"Right mouse button:", 73 | /* mb4 */ L"Mouse button 4:", 74 | /* mb5 */ L"Mouse button 5:", 75 | /* scroll */ L"Scroll wheel:", 76 | /* lowerwithmmb */ L"&Lower windows by middle clicking on title bars", 77 | 78 | /* actions */ 79 | /* move */ L"Move window", 80 | /* resize */ L"Resize window", 81 | /* close */ L"Close window", 82 | /* minimize */ L"Minimize window", 83 | /* lower */ L"Lower window", 84 | /* alwaysontop */ L"Toggle always on top", 85 | /* center */ L"Center window on screen", 86 | /* nothing */ L"Nothing", 87 | /* alttab */ L"Alt+Tab", 88 | /* volume */ L"Volume", 89 | /* transparency */ L"Transparency", 90 | 91 | /* hotkeys */ 92 | /* box */ L"Hotkeys", 93 | /* leftalt */ L"L&eft Alt", 94 | /* rightalt */ L"&Right Alt", 95 | /* leftwinkey */ L"Left &Winkey", 96 | /* rightwinkey */ L"Right W&inkey", 97 | /* leftctrl */ L"Left &Ctrl", 98 | /* rightctrl */ L"Right C&trl", 99 | /* more */ L"You can add any key by editing the ini file.\nUse the shift key to snap windows to each other.", 100 | 101 | /* blacklist tab */ 102 | /* box */ L"Blacklist settings", 103 | /* processblacklist */ L"Process blacklist:", 104 | /* blacklist */ L"Blacklist:", 105 | /* snaplist */ L"Snaplist:", 106 | /* explanation */ L"Read the website for a thorough explanation on how the blacklist works!", 107 | /* findwindow_box */ L"Identify window", 108 | /* _explanation */ L"Click the icon to identify the classname of a window so that you can add it to the Blacklist or Snaplist above.", 109 | 110 | /* advanced tab */ 111 | /* box */ L"Advanced settings", 112 | /* hookwindows */ L"&Enable snapping when normally moving windows.\nWorks in conjunction with automatic snapping!", 113 | /* hookwindows_warn */ L"Note that this is not 100% safe as this feature works by hooking into other processes. This might be risky to use when playing games with anti-cheat protection.\n\nAre you sure you want to enable this feature?", 114 | /* checkonstartup */ L"A&utomatically check for updates", 115 | /* beta */ L"Check for &beta versions", 116 | /* checknow */ L"&Check now", 117 | /* ini */ APP_NAME L"'s settings are saved in "APP_NAME".ini. There are a few things that you can only configure by editing the file manually.", 118 | /* openini */ L"Open &ini file", 119 | 120 | /* about tab */ 121 | /* box */ L"About "APP_NAME, 122 | /* version */ L"Version "APP_VERSION, 123 | /* author */ L"Created by Stefan Sundin", 124 | /* license */ APP_NAME L" is free and open source software!\nFeel free to redistribute!", 125 | /* donate */ L"&Donate", 126 | /* translation_credit */ L"Translation credit", 127 | 128 | /* === misc === */ 129 | /* unhook_error */ L"There was an error disabling "APP_NAME". This was most likely caused by Windows having already disabled "APP_NAME"'s hooks.\n\nIf this is the first time this has happened, you can safely ignore it and continue using "APP_NAME".\n\nIf this is happening repeatedly, you can read on the website how to prevent this from happening again (look for '"APP_NAME" mysteriously stops working' in the documentation).", 130 | }; 131 | -------------------------------------------------------------------------------- /config/window.rc: -------------------------------------------------------------------------------- 1 | // Generated by ResEdit 1.5.11 2 | // Copyright (C) 2006-2012 3 | // http://www.resedit.net 4 | 5 | #include 6 | #include 7 | #include 8 | #include "resource.h" 9 | 10 | 11 | 12 | 13 | // 14 | // Dialog resources 15 | // 16 | IDD_ABOUTPAGE DIALOGEX 0, 0, 220, 190 17 | STYLE DS_3DLOOK | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_CHILDWINDOW | WS_SYSMENU 18 | CAPTION "About" 19 | FONT 8, "Ms Shell Dlg", 400, 0, 1 20 | { 21 | CONTROL "https://stefansundin.com/", IDC_STATIC, "SysLink", 0x50020000, 75, 50, 130, 10 22 | GROUPBOX "About", IDC_ABOUT_BOX, 3, 1, 212, 105 23 | ICON IDI_BIGICON, IDC_STATIC, 15, 15, 45, 42, SS_ICON | SS_REALSIZEIMAGE 24 | LTEXT "Version", IDC_VERSION, 75, 15, 130, 8, SS_LEFT 25 | CONTROL "https://stefansundin.github.io/altdrag/", IDC_STATIC, "SysLink", 0x50020000, 75, 25, 130, 10 26 | LTEXT "Created by Stefan Sundin", IDC_AUTHOR, 75, 40, 130, 8, SS_LEFT 27 | LTEXT "Free and open source software!", IDC_LICENSE, 10, 65, 195, 20, SS_LEFT 28 | DEFPUSHBUTTON "Donate", IDC_DONATE, 10, 85, 45, 14 29 | GROUPBOX "Translations", IDC_TRANSLATIONS_BOX, 3, 111, 212, 72 30 | EDITTEXT IDC_TRANSLATIONS, 10, 120, 200, 60, WS_VSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | ES_READONLY 31 | } 32 | 33 | 34 | 35 | IDD_ADVANCEDPAGE DIALOGEX 0, 0, 220, 190 36 | STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU 37 | CAPTION "Advanced" 38 | FONT 8, "Ms Shell Dlg", 400, 0, 1 39 | { 40 | AUTOCHECKBOX "HookWindows", IDC_HOOKWINDOWS, 10, 15, 195, 27, BS_TOP | BS_MULTILINE 41 | AUTOCHECKBOX "Update", IDC_CHECKONSTARTUP, 10, 65, 195, 8 42 | AUTOCHECKBOX "Beta", IDC_BETA, 10, 80, 195, 8 43 | PUSHBUTTON "Check", IDC_CHECKNOW, 10, 95, 58, 14 44 | PUSHBUTTON "Open", IDC_OPENINI, 10, 160, 58, 14 45 | GROUPBOX "Advanced", IDC_ADVANCED_BOX, 3, 1, 212, 120 46 | GROUPBOX "AltDrag.ini", IDC_STATIC, 3, 125, 212, 58 47 | LTEXT "AltDrag.ini", IDC_INI, 10, 135, 200, 25, SS_LEFT 48 | } 49 | 50 | 51 | 52 | IDD_BLACKLISTPAGE DIALOGEX 0, 0, 220, 190 53 | STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_CHILDWINDOW | WS_SYSMENU 54 | CAPTION "Blacklist" 55 | FONT 8, "Ms Shell Dlg", 400, 0, 1 56 | { 57 | EDITTEXT IDC_PROCESSBLACKLIST, 10, 25, 190, 14, ES_AUTOHSCROLL 58 | EDITTEXT IDC_BLACKLIST, 10, 52, 190, 14, ES_AUTOHSCROLL 59 | EDITTEXT IDC_SNAPLIST, 10, 79, 190, 14, ES_AUTOHSCROLL 60 | EDITTEXT IDC_NEWRULE, 30, 160, 171, 14, ES_AUTOHSCROLL 61 | GROUPBOX "Blacklist", IDC_BLACKLIST_BOX, 3, 1, 212, 120 62 | LTEXT "ProcessBlacklist:", IDC_PROCESSBLACKLIST_HEADER, 10, 15, 190, 8, SS_LEFT 63 | LTEXT "Blacklist:", IDC_BLACKLIST_HEADER, 10, 42, 190, 8, SS_LEFT 64 | LTEXT "Snaplist:", IDC_SNAPLIST_HEADER, 10, 69, 190, 8, SS_LEFT 65 | CONTROL "Read the website for a thorough explanation on how the blacklist works!", IDC_BLACKLIST_EXPLANATION, "SysLink", 0x50020000, 10, 97, 195, 20 66 | GROUPBOX "Identify window", IDC_FINDWINDOW_BOX, 3, 125, 212, 58 67 | LTEXT "WindowFinder", IDC_FINDWINDOW_EXPLANATION, 10, 135, 195, 25, SS_LEFT 68 | ICON IDI_FIND, IDC_FINDWINDOW, 12, 161, 21, 20, SS_ICON | SS_NOTIFY | SS_REALSIZEIMAGE 69 | } 70 | 71 | 72 | 73 | IDD_GENERALPAGE DIALOGEX 0, 0, 220, 190 74 | STYLE DS_3DLOOK | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_CHILDWINDOW | WS_SYSMENU 75 | EXSTYLE WS_EX_WINDOWEDGE 76 | CAPTION "General" 77 | FONT 8, "Ms Shell Dlg", 400, 0, 1 78 | { 79 | AUTOCHECKBOX "AutoFocus", IDC_AUTOFOCUS, 10, 13, 195, 18, BS_TOP | BS_MULTILINE 80 | AUTOCHECKBOX "Aero", IDC_AERO, 10, 31, 195, 8 81 | AUTOCHECKBOX "InactiveScroll", IDC_INACTIVESCROLL, 10, 43, 195, 8 82 | COMBOBOX IDC_AUTOSNAP, 10, 75, 100, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 83 | COMBOBOX IDC_LANGUAGE, 10, 100, 100, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 84 | AUTOCHECKBOX "Autostart", IDC_AUTOSTART, 10, 137, 195, 8 85 | AUTOCHECKBOX "Hide tray", IDC_AUTOSTART_HIDE, 10, 150, 195, 8 86 | LTEXT "AutoSnap:", IDC_AUTOSNAP_HEADER, 10, 65, 195, 8, SS_LEFT 87 | LTEXT "Language:", IDC_LANGUAGE_HEADER, 10, 90, 195, 8, SS_LEFT 88 | GROUPBOX "General", IDC_GENERAL_BOX, 3, 1, 212, 120 89 | GROUPBOX "Autostart", IDC_AUTOSTART_BOX, 3, 125, 212, 53 90 | CONTROL "Note: Instant!", IDC_AUTOSAVE, WC_STATIC, NOT WS_GROUP | SS_LEFTNOWORDWRAP, 3, 180, 216, 8 91 | AUTOCHECKBOX "Elevate", IDC_AUTOSTART_ELEVATE, 10, 163, 140, 8 92 | DEFPUSHBUTTON "Elevate", IDC_ELEVATE, 153, 160, 58, 14 93 | AUTOCHECKBOX "MDI", IDC_MDI, 10, 55, 195, 8 94 | } 95 | 96 | 97 | 98 | IDD_INPUTPAGE DIALOGEX 0, 0, 220, 190 99 | STYLE DS_3DLOOK | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_CHILDWINDOW | WS_SYSMENU 100 | CAPTION "Input" 101 | FONT 8, "Ms Shell Dlg", 400, 0, 1 102 | { 103 | LTEXT "LMB:", IDC_LMB_HEADER, 10, 13, 85, 8, SS_LEFT 104 | LTEXT "MMB:", IDC_MMB_HEADER, 10, 28, 85, 8, SS_LEFT 105 | LTEXT "RMB:", IDC_RMB_HEADER, 10, 43, 85, 8, SS_LEFT 106 | LTEXT "MB4:", IDC_MB4_HEADER, 10, 58, 85, 8, SS_LEFT 107 | LTEXT "MB5:", IDC_MB5_HEADER, 10, 73, 85, 8, SS_LEFT 108 | LTEXT "Scroll:", IDC_SCROLL_HEADER, 10, 88, 85, 8, SS_LEFT 109 | COMBOBOX IDC_LMB, 105, 10, 97, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 110 | COMBOBOX IDC_MMB, 105, 25, 97, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 111 | COMBOBOX IDC_RMB, 105, 40, 97, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 112 | COMBOBOX IDC_MB4, 105, 55, 97, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 113 | COMBOBOX IDC_MB5, 105, 70, 97, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 114 | COMBOBOX IDC_SCROLL, 105, 85, 97, 30, WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS 115 | AUTOCHECKBOX "LeftAlt", IDC_LEFTALT, 10, 137, 60, 8 116 | AUTOCHECKBOX "RightAlt", IDC_RIGHTALT, 10, 150, 60, 8 117 | AUTOCHECKBOX "LeftWinkey", IDC_LEFTWINKEY, 71, 137, 72, 8 118 | AUTOCHECKBOX "RightWinkey", IDC_RIGHTWINKEY, 71, 150, 72, 8 119 | AUTOCHECKBOX "LeftCtrl", IDC_LEFTCTRL, 145, 137, 65, 8 120 | AUTOCHECKBOX "RightCtrl", IDC_RIGHTCTRL, 145, 150, 65, 8 121 | LTEXT "ini file", IDC_HOTKEYS_MORE, 10, 162, 200, 25, SS_LEFT 122 | GROUPBOX "Mouse", IDC_MOUSE_BOX, 3, 1, 212, 120 123 | GROUPBOX "Hotkeys", IDC_HOTKEYS_BOX, 3, 125, 212, 58 124 | AUTOCHECKBOX "LowerWithMMB", IDC_LOWERWITHMMB, 10, 100, 175, 16, BS_TOP | BS_MULTILINE 125 | } 126 | 127 | 128 | 129 | // 130 | // Cursor resources 131 | // 132 | IDI_FIND CURSOR "../media/find.cur" 133 | 134 | 135 | 136 | // 137 | // Icon resources 138 | // 139 | IDI_BIGICON ICON "../media/icon-big.ico" 140 | 141 | 142 | IDI_FIND ICON "../media/find.ico" 143 | -------------------------------------------------------------------------------- /localization/en_US/Translation.ini: -------------------------------------------------------------------------------- 1 | ; Translation file for AltDrag 1.0 2 | ; en-US localization by Stefan Sundin 3 | ; Simply put this file in the same directory as AltDrag, then reload AltDrag. 4 | ; Please read the website for help: https://stefansundin.github.io/altdrag/doc/translate.html 5 | ; Use encoding UTF-16LE with BOM to be able to use Unicode 6 | 7 | [Translation] 8 | Code=en-US 9 | LangEnglish=English 10 | Lang=English 11 | Author=Stefan Sundin 12 | 13 | TrayEnabled=AltDrag 14 | TrayDisabled=AltDrag (disabled) 15 | MenuEnable=Enable 16 | MenuDisable=Disable 17 | MenuHideTray=Hide tray 18 | MenuUpdateAvailable=Update available! 19 | MenuConfigure=Configure 20 | MenuAbout=About 21 | MenuExit=Exit 22 | 23 | UpdateBalloon=New version found! 24 | UpdateDialog=A new version is available. Go to website? 25 | UpdateLatest=No update available. 26 | 27 | ConfigTitle=AltDrag Configuration 28 | ConfigTabGeneral=General 29 | ConfigTabInput=Mouse and keyboard 30 | ConfigTabBlacklist=Blacklist 31 | ConfigTabAdvanced=Advanced 32 | ConfigTabAbout=About 33 | 34 | GeneralBox=General settings 35 | GeneralAutoFocus=&Focus windows when dragging.\nYou can also press Ctrl to focus windows. 36 | GeneralAero=Mimic Aero S&nap 37 | GeneralInactiveScroll=&Scroll inactive windows 38 | GeneralMDI=&MDI support 39 | GeneralAutoSnap=Automatically snap to: 40 | GeneralAutoSnap0=Disabled 41 | GeneralAutoSnap1=To screen borders 42 | GeneralAutoSnap2=+ outside of windows 43 | GeneralAutoSnap3=+ inside of windows 44 | GeneralLanguage=Language: 45 | GeneralAutostartBox=Autostart 46 | GeneralAutostart=S&tart AltDrag when logging on 47 | GeneralAutostartHide=&Hide tray 48 | GeneralAutostartElevate=&Elevate to administrator privileges 49 | GeneralAutostartElevateTip=Note that a UAC prompt will appear every time you log in, unless you disable UAC completely. 50 | GeneralElevate=E&levate 51 | GeneralElevated=Elevated 52 | GeneralElevateTip=This will create a new instance of AltDrag which is running with administrator privileges. This allows AltDrag to manage other programs which are running with administrator privileges.\n\nYou will have to approve a UAC prompt from Windows to allow AltDrag to run with administrator privileges. 53 | GeneralElevationAborted=Elevation aborted. 54 | GeneralAutosave=Note: Settings are saved and applied instantly! 55 | 56 | InputMouseBox=Mouse actions 57 | InputMouseLMB=Left mouse button: 58 | InputMouseMMB=Middle mouse button: 59 | InputMouseRMB=Right mouse button: 60 | InputMouseMB4=Mouse button 4: 61 | InputMouseMB5=Mouse button 5: 62 | InputMouseScroll=Scroll wheel: 63 | InputMouseLowerWithMMB=&Lower windows by middle clicking on title bars 64 | 65 | InputActionMove=Move window 66 | InputActionResize=Resize window 67 | InputActionClose=Close window 68 | InputActionMinimize=Minimize window 69 | InputActionLower=Lower window 70 | InputActionAlwaysOnTop=Toggle always on top 71 | InputActionCenter=Center window on screen 72 | InputActionNothing=Nothing 73 | InputActionAltTab=Alt+Tab 74 | InputActionVolume=Volume 75 | InputActionTransparency=Transparency 76 | 77 | InputHotkeysBox=Hotkeys: 78 | InputHotkeysLeftAlt=L&eft Alt 79 | InputHotkeysRightAlt=&Right Alt 80 | InputHotkeysLeftWinkey=Left &Winkey 81 | InputHotkeysRightWinkey=Right W&inkey 82 | InputHotkeysLeftCtrl=Left &Ctrl 83 | InputHotkeysRightCtrl=Right C&trl 84 | InputHotkeysMore=You can add any key by editing the ini file.\nUse the shift key to snap windows to each other. 85 | 86 | BlacklistBox=Blacklist settings 87 | BlacklistProcessBlacklist=Process blacklist: 88 | BlacklistBlacklist=Blacklist: 89 | BlacklistSnaplist=Snaplist: 90 | BlacklistExplanation=Read <a href="https://stefansundin.github.io/altdrag/doc/blacklist.html">the wiki</a> on the website for a thorough explanation of how the blacklist works! 91 | BlacklistFindWindowBox=Identify window 92 | BlacklistFindWindowExplanation=Click the icon to identify the classname of a window so that you can add it to the Blacklist or Snaplist above. 93 | 94 | AdvancedBox=Advanced settings 95 | AdvancedHookWindows=&Enable snapping when normally moving windows.\nWorks in conjunction with automatic snapping! 96 | AdvancedHookWindowsWarn=Note that this is not 100% safe as this feature works by hooking into other processes. This might be risky to use when playing games with anti-cheat protection.\n\nAre you sure you want to enable this feature? 97 | AdvancedUpdateCheckOnStartup=A&utomatically check for updates 98 | AdvancedUpdateBeta=Check for &beta versions 99 | AdvancedUpdateCheckNow=&Check now 100 | AdvancedIni=AltDrag's settings are saved in AltDrag.ini. There are a few things that you can only configure by editing the file manually. 101 | AdvancedOpenIni=Open &ini file 102 | 103 | AboutBox=About AltDrag 104 | AboutVersion=Version 105 | AboutAuthor=Created by Stefan Sundin 106 | AboutLicense=AltDrag is free and open source software!\nFeel free to redistribute! 107 | AboutDonate=&Donate 108 | AboutTranslationCredit=Translation credit 109 | 110 | MiscUnhookError=There was an error disabling AltDrag. This was most likely caused by Windows having already disabled AltDrag's hooks.\n\nIf this is the first time this has happened, you can safely ignore it and continue using AltDrag.\n\nIf this is happening repeatedly, you can read on the website how to prevent this from happening again (look for 'AltDrag mysteriously stops working' in the documentation). 111 | -------------------------------------------------------------------------------- /localization/strings.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | struct strings { 11 | wchar_t *code; 12 | wchar_t *lang_english; 13 | wchar_t *lang; 14 | wchar_t *author; 15 | 16 | // tray 17 | wchar_t *tray_enabled; 18 | wchar_t *tray_disabled; 19 | 20 | // menu 21 | wchar_t *menu_enable; 22 | wchar_t *menu_disable; 23 | wchar_t *menu_hide; 24 | wchar_t *menu_update; 25 | wchar_t *menu_config; 26 | wchar_t *menu_about; 27 | wchar_t *menu_exit; 28 | 29 | // update 30 | wchar_t *update_balloon; 31 | wchar_t *update_dialog; 32 | wchar_t *update_nonew; 33 | 34 | // config 35 | wchar_t *title; 36 | wchar_t *tab_general; 37 | wchar_t *tab_input; 38 | wchar_t *tab_blacklist; 39 | wchar_t *tab_advanced; 40 | wchar_t *tab_about; 41 | 42 | // general 43 | wchar_t *general_box; 44 | wchar_t *general_autofocus; 45 | wchar_t *general_aero; 46 | wchar_t *general_inactivescroll; 47 | wchar_t *general_mdi; 48 | wchar_t *general_autosnap; 49 | wchar_t *general_autosnap0; 50 | wchar_t *general_autosnap1; 51 | wchar_t *general_autosnap2; 52 | wchar_t *general_autosnap3; 53 | wchar_t *general_language; 54 | wchar_t *general_autostart_box; 55 | wchar_t *general_autostart; 56 | wchar_t *general_autostart_hide; 57 | wchar_t *general_autostart_elevate; 58 | wchar_t *general_autostart_elevate_tip; 59 | wchar_t *general_elevate; 60 | wchar_t *general_elevated; 61 | wchar_t *general_elevate_tip; 62 | wchar_t *general_elevation_aborted; 63 | wchar_t *general_autosave; 64 | 65 | // input 66 | // mouse 67 | wchar_t *input_mouse_box; 68 | wchar_t *input_mouse_lmb; 69 | wchar_t *input_mouse_mmb; 70 | wchar_t *input_mouse_rmb; 71 | wchar_t *input_mouse_mb4; 72 | wchar_t *input_mouse_mb5; 73 | wchar_t *input_mouse_scroll; 74 | wchar_t *input_mouse_lowerwithmmb; 75 | // actions 76 | wchar_t *input_actions_move; 77 | wchar_t *input_actions_resize; 78 | wchar_t *input_actions_close; 79 | wchar_t *input_actions_minimize; 80 | wchar_t *input_actions_lower; 81 | wchar_t *input_actions_alwaysontop; 82 | wchar_t *input_actions_center; 83 | wchar_t *input_actions_nothing; 84 | wchar_t *input_actions_alttab; 85 | wchar_t *input_actions_volume; 86 | wchar_t *input_actions_transparency; 87 | // hotkeys 88 | wchar_t *input_hotkeys_box; 89 | wchar_t *input_hotkeys_leftalt; 90 | wchar_t *input_hotkeys_rightalt; 91 | wchar_t *input_hotkeys_leftwinkey; 92 | wchar_t *input_hotkeys_rightwinkey; 93 | wchar_t *input_hotkeys_leftctrl; 94 | wchar_t *input_hotkeys_rightctrl; 95 | wchar_t *input_hotkeys_more; 96 | 97 | // blacklist 98 | wchar_t *blacklist_box; 99 | wchar_t *blacklist_processblacklist; 100 | wchar_t *blacklist_blacklist; 101 | wchar_t *blacklist_snaplist; 102 | wchar_t *blacklist_explanation; 103 | wchar_t *blacklist_findwindow_box; 104 | wchar_t *blacklist_findwindow_explanation; 105 | 106 | // advanced 107 | wchar_t *advanced_box; 108 | wchar_t *advanced_hookwindows; 109 | wchar_t *advanced_hookwindows_warn; 110 | wchar_t *advanced_checkonstartup; 111 | wchar_t *advanced_beta; 112 | wchar_t *advanced_checknow; 113 | wchar_t *advanced_ini; 114 | wchar_t *advanced_openini; 115 | 116 | // about 117 | wchar_t *about_box; 118 | wchar_t *about_version; 119 | wchar_t *about_author; 120 | wchar_t *about_license; 121 | wchar_t *about_donate; 122 | wchar_t *about_translation_credit; 123 | 124 | /* misc */ 125 | wchar_t *unhook_error; 126 | }; 127 | 128 | struct strings l10n_ini; 129 | 130 | struct { 131 | wchar_t **str; 132 | wchar_t *name; 133 | } l10n_mapping[] = { 134 | { &l10n_ini.code, L"Code" }, 135 | { &l10n_ini.lang_english, L"LangEnglish" }, 136 | { &l10n_ini.lang, L"Lang" }, 137 | { &l10n_ini.author, L"Author" }, 138 | 139 | { &l10n_ini.tray_enabled, L"TrayEnabled" }, 140 | { &l10n_ini.tray_disabled, L"TrayDisabled" }, 141 | { &l10n_ini.menu_enable, L"MenuEnable" }, 142 | { &l10n_ini.menu_disable, L"MenuDisable" }, 143 | { &l10n_ini.menu_hide, L"MenuHideTray" }, 144 | { &l10n_ini.menu_update, L"MenuUpdateAvailable" }, 145 | { &l10n_ini.menu_config, L"MenuConfigure" }, 146 | { &l10n_ini.menu_about, L"MenuAbout" }, 147 | { &l10n_ini.menu_exit, L"MenuExit" }, 148 | { &l10n_ini.update_balloon, L"UpdateBalloon" }, 149 | { &l10n_ini.update_dialog, L"UpdateDialog" }, 150 | { &l10n_ini.update_nonew, L"UpdateLatest" }, 151 | 152 | { &l10n_ini.title, L"ConfigTitle" }, 153 | { &l10n_ini.tab_general, L"ConfigTabGeneral" }, 154 | { &l10n_ini.tab_input, L"ConfigTabInput" }, 155 | { &l10n_ini.tab_blacklist, L"ConfigTabBlacklist" }, 156 | { &l10n_ini.tab_advanced, L"ConfigTabAdvanced" }, 157 | { &l10n_ini.tab_about, L"ConfigTabAbout" }, 158 | 159 | { &l10n_ini.general_box, L"GeneralBox" }, 160 | { &l10n_ini.general_autofocus, L"GeneralAutoFocus" }, 161 | { &l10n_ini.general_aero, L"GeneralAero" }, 162 | { &l10n_ini.general_inactivescroll, L"GeneralInactiveScroll" }, 163 | { &l10n_ini.general_mdi, L"GeneralMDI" }, 164 | { &l10n_ini.general_autosnap, L"GeneralAutoSnap" }, 165 | { &l10n_ini.general_autosnap0, L"GeneralAutoSnap0" }, 166 | { &l10n_ini.general_autosnap1, L"GeneralAutoSnap1" }, 167 | { &l10n_ini.general_autosnap2, L"GeneralAutoSnap2" }, 168 | { &l10n_ini.general_autosnap3, L"GeneralAutoSnap3" }, 169 | { &l10n_ini.general_language, L"GeneralLanguage" }, 170 | { &l10n_ini.general_autostart_box, L"GeneralAutostartBox" }, 171 | { &l10n_ini.general_autostart, L"GeneralAutostart" }, 172 | { &l10n_ini.general_autostart_hide, L"GeneralAutostartHide" }, 173 | { &l10n_ini.general_autostart_elevate, L"GeneralAutostartElevate" }, 174 | { &l10n_ini.general_autostart_elevate_tip, L"GeneralAutostartElevateTip" }, 175 | { &l10n_ini.general_elevate, L"GeneralElevate" }, 176 | { &l10n_ini.general_elevated, L"GeneralElevated" }, 177 | { &l10n_ini.general_elevate_tip, L"GeneralElevateTip" }, 178 | { &l10n_ini.general_elevation_aborted, L"GeneralElevationAborted" }, 179 | { &l10n_ini.general_autosave, L"GeneralAutosave" }, 180 | 181 | { &l10n_ini.input_mouse_box, L"InputMouseBox" }, 182 | { &l10n_ini.input_mouse_lmb, L"InputMouseLMB" }, 183 | { &l10n_ini.input_mouse_mmb, L"InputMouseMMB" }, 184 | { &l10n_ini.input_mouse_rmb, L"InputMouseRMB" }, 185 | { &l10n_ini.input_mouse_mb4, L"InputMouseMB4" }, 186 | { &l10n_ini.input_mouse_mb5, L"InputMouseMB5" }, 187 | { &l10n_ini.input_mouse_scroll, L"InputMouseScroll" }, 188 | { &l10n_ini.input_mouse_lowerwithmmb, L"InputMouseLowerWithMMB" }, 189 | 190 | { &l10n_ini.input_actions_move, L"InputActionMove" }, 191 | { &l10n_ini.input_actions_resize, L"InputActionResize" }, 192 | { &l10n_ini.input_actions_close, L"InputActionClose" }, 193 | { &l10n_ini.input_actions_minimize, L"InputActionMinimize" }, 194 | { &l10n_ini.input_actions_lower, L"InputActionLower" }, 195 | { &l10n_ini.input_actions_alwaysontop, L"InputActionAlwaysOnTop" }, 196 | { &l10n_ini.input_actions_center, L"InputActionCenter" }, 197 | { &l10n_ini.input_actions_nothing, L"InputActionNothing" }, 198 | { &l10n_ini.input_actions_alttab, L"InputActionAltTab" }, 199 | { &l10n_ini.input_actions_volume, L"InputActionVolume" }, 200 | { &l10n_ini.input_actions_transparency, L"InputActionTransparency" }, 201 | 202 | { &l10n_ini.input_hotkeys_box, L"InputHotkeysBox" }, 203 | { &l10n_ini.input_hotkeys_leftalt, L"InputHotkeysLeftAlt" }, 204 | { &l10n_ini.input_hotkeys_rightalt, L"InputHotkeysRightAlt" }, 205 | { &l10n_ini.input_hotkeys_leftwinkey, L"InputHotkeysLeftWinkey" }, 206 | { &l10n_ini.input_hotkeys_rightwinkey, L"InputHotkeysRightWinkey" }, 207 | { &l10n_ini.input_hotkeys_leftctrl, L"InputHotkeysLeftCtrl" }, 208 | { &l10n_ini.input_hotkeys_rightctrl, L"InputHotkeysRightCtrl" }, 209 | { &l10n_ini.input_hotkeys_more, L"InputHotkeysMore" }, 210 | 211 | { &l10n_ini.blacklist_box, L"BlacklistBox" }, 212 | { &l10n_ini.blacklist_processblacklist, L"BlacklistProcessBlacklist" }, 213 | { &l10n_ini.blacklist_blacklist, L"BlacklistBlacklist" }, 214 | { &l10n_ini.blacklist_snaplist, L"BlacklistSnaplist" }, 215 | { &l10n_ini.blacklist_explanation, L"BlacklistExplanation" }, 216 | { &l10n_ini.blacklist_findwindow_box, L"BlacklistFindWindowBox" }, 217 | { &l10n_ini.blacklist_findwindow_explanation, L"BlacklistFindWindowExplanation" }, 218 | 219 | { &l10n_ini.advanced_box, L"AdvancedBox" }, 220 | { &l10n_ini.advanced_hookwindows, L"AdvancedHookWindows" }, 221 | { &l10n_ini.advanced_hookwindows_warn, L"AdvancedHookWindowsWarn" }, 222 | { &l10n_ini.advanced_checkonstartup, L"AdvancedUpdateCheckOnStartup" }, 223 | { &l10n_ini.advanced_beta, L"AdvancedUpdateBeta" }, 224 | { &l10n_ini.advanced_checknow, L"AdvancedUpdateCheckNow" }, 225 | { &l10n_ini.advanced_ini, L"AdvancedIni" }, 226 | { &l10n_ini.advanced_openini, L"AdvancedOpenIni" }, 227 | 228 | { &l10n_ini.about_box, L"AboutBox" }, 229 | { &l10n_ini.about_version, L"AboutVersion" }, 230 | { &l10n_ini.about_author, L"AboutAuthor" }, 231 | { &l10n_ini.about_license, L"AboutLicense" }, 232 | { &l10n_ini.about_donate, L"AboutDonate" }, 233 | { &l10n_ini.about_translation_credit, L"AboutTranslationCredit" }, 234 | 235 | { &l10n_ini.unhook_error, L"MiscUnhookError" }, 236 | }; 237 | -------------------------------------------------------------------------------- /installer.nsi: -------------------------------------------------------------------------------- 1 | ; Copyright (C) 2015 Stefan Sundin 2 | ; 3 | ; This program is free software: you can redistribute it and/or modify 4 | ; it under the terms of the GNU General Public License as published by 5 | ; the Free Software Foundation, either version 3 of the License, or 6 | ; (at your option) any later version. 7 | 8 | ; For silent install you can use these switches: /S /L=es-ES /D=C:\installdir 9 | 10 | 11 | !define APP_NAME "AltDrag" 12 | !define APP_VERSION "1.1" 13 | !define APP_URL "https://stefansundin.github.io/altdrag/" 14 | 15 | 16 | ; Libraries 17 | 18 | !include "MUI2.nsh" 19 | !include "Sections.nsh" 20 | !include "LogicLib.nsh" 21 | !include "FileFunc.nsh" 22 | !include "WinVer.nsh" 23 | 24 | 25 | ; General 26 | 27 | Name "${APP_NAME} ${APP_VERSION}" 28 | OutFile "bin\${APP_NAME}-${APP_VERSION}.exe" 29 | InstallDir "$APPDATA\${APP_NAME}\" 30 | InstallDirRegKey HKCU "Software\${APP_NAME}" "Install_Dir" 31 | RequestExecutionLevel user 32 | ShowInstDetails hide 33 | ShowUninstDetails show 34 | SetCompressor /SOLID lzma 35 | 36 | 37 | ; Interface 38 | 39 | !define MUI_LANGDLL_REGISTRY_ROOT HKCU 40 | !define MUI_LANGDLL_REGISTRY_KEY "Software\${APP_NAME}" 41 | !define MUI_LANGDLL_REGISTRY_VALUENAME "Language" 42 | !define MUI_FINISHPAGE_RUN 43 | !define MUI_FINISHPAGE_RUN_FUNCTION "Launch" 44 | 45 | 46 | ; Pages 47 | 48 | Page custom PageUpgrade PageUpgradeLeave 49 | !define MUI_PAGE_CUSTOMFUNCTION_PRE SkipPage 50 | !define MUI_PAGE_CUSTOMFUNCTION_SHOW HideBackButton 51 | !insertmacro MUI_PAGE_DIRECTORY 52 | !insertmacro MUI_PAGE_INSTFILES 53 | Page custom PageAltShift 54 | Page custom PageLowLevelHooksTimeout 55 | !define MUI_PAGE_CUSTOMFUNCTION_SHOW MaybeDisableBackButton 56 | !insertmacro MUI_PAGE_FINISH 57 | 58 | !insertmacro MUI_UNPAGE_CONFIRM 59 | !insertmacro MUI_UNPAGE_INSTFILES 60 | 61 | 62 | ; Variables 63 | 64 | Var UpgradeState 65 | Var SkipAltShiftPage 66 | Var SkipLowLevelHooksTimeoutPage 67 | 68 | 69 | ; Languages 70 | 71 | !include "localization\installer.nsh" 72 | !insertmacro MUI_RESERVEFILE_LANGDLL 73 | 74 | !macro Lang lang id 75 | ${If} $LANGUAGE == ${id} 76 | WriteINIStr "$INSTDIR\${APP_NAME}.ini" "General" "Language" "${lang}" 77 | ${EndIf} 78 | !macroend 79 | 80 | !macro SetLang lang1 lang2 id 81 | ${If} ${lang1} == ${lang2} 82 | ; Beautiful NSIS-way of doing $LANGUAGE = ${id} 83 | IntOp $LANGUAGE 0 + ${id} 84 | ${EndIf} 85 | !macroend 86 | 87 | 88 | ; Functions 89 | 90 | !macro AddTray un 91 | Function ${un}AddTray 92 | ; Add tray icon if program is running 93 | FindWindow $0 "${APP_NAME}" "" 94 | IntCmp $0 0 done 95 | DetailPrint "Adding tray icon." 96 | System::Call "user32::RegisterWindowMessage(t 'AddTray') i .r1" 97 | SendMessage $0 $1 0 0 /TIMEOUT=500 98 | done: 99 | FunctionEnd 100 | !macroend 101 | !insertmacro AddTray "" 102 | !insertmacro AddTray "un." 103 | 104 | !macro CloseApp un 105 | Function ${un}CloseApp 106 | ; Close app if running 107 | FindWindow $0 "${APP_NAME}" "" 108 | IntCmp $0 0 done 109 | DetailPrint "Attempting to close running ${APP_NAME}..." 110 | SendMessage $0 ${WM_CLOSE} 0 0 /TIMEOUT=500 111 | waitloop: 112 | Sleep 10 113 | FindWindow $0 "${APP_NAME}" "" 114 | IntCmp $0 0 closed waitloop waitloop 115 | closed: 116 | Sleep 100 ; Sleep a little extra to let Windows do its thing 117 | ; If HookWindows is enabled, sleep even longer 118 | ReadINIStr $0 "$INSTDIR\${APP_NAME}.ini" "Advanced" "HookWindows" 119 | ${If} $0 == "1" 120 | Sleep 1000 121 | ${EndIf} 122 | done: 123 | FunctionEnd 124 | !macroend 125 | !insertmacro CloseApp "" 126 | !insertmacro CloseApp "un." 127 | 128 | ; Used when upgrading to skip the directory page 129 | Function SkipPage 130 | ${If} $UpgradeState == ${BST_CHECKED} 131 | Abort 132 | ${EndIf} 133 | FunctionEnd 134 | 135 | Function HideBackButton 136 | GetDlgItem $0 $HWNDPARENT 3 137 | ShowWindow $0 ${SW_HIDE} 138 | FunctionEnd 139 | 140 | Function DisableBackButton 141 | GetDlgItem $0 $HWNDPARENT 3 142 | EnableWindow $0 0 143 | FunctionEnd 144 | 145 | Function DisableCancelButton 146 | GetDlgItem $0 $HWNDPARENT 2 147 | EnableWindow $0 0 148 | FunctionEnd 149 | 150 | Function FocusNextButton 151 | GetDlgItem $0 $HWNDPARENT 1 152 | ${NSD_SetFocus} $0 153 | FunctionEnd 154 | 155 | Function DisableXButton 156 | ; Disables the close button in the title bar 157 | System::Call "user32::GetSystemMenu(i $HWNDPARENT, i 0) i .r1" 158 | System::Call "user32::EnableMenuItem(i $1, i 0xF060, i 1) v" 159 | FunctionEnd 160 | 161 | Function MaybeDisableBackButton 162 | ${If} $SkipAltShiftPage == "true" 163 | ${AndIf} $SkipLowLevelHooksTimeoutPage == "true" 164 | Call DisableBackButton 165 | ${EndIf} 166 | FunctionEnd 167 | 168 | Function Launch 169 | Exec "$INSTDIR\${APP_NAME}.exe" 170 | FunctionEnd 171 | 172 | 173 | ; Installer 174 | 175 | Section "" sec_app 176 | ; Close app if running 177 | Call CloseApp 178 | 179 | SetOutPath "$INSTDIR" 180 | 181 | ; Rename old ini file if it exists 182 | IfFileExists "${APP_NAME}.ini" 0 +3 183 | Delete "${APP_NAME}-old.ini" 184 | Rename "${APP_NAME}.ini" "${APP_NAME}-old.ini" 185 | 186 | ; Delete files that existed in earlier versions 187 | Delete /REBOOTOK "$INSTDIR\info.txt" ; existed in <= 0.9 188 | Delete /REBOOTOK "$INSTDIR\Config.exe" ; existed in 1.0b1 189 | 190 | ; Install files 191 | File "bin\${APP_NAME}.exe" 192 | File "${APP_NAME}.ini" 193 | File "bin\hooks.dll" 194 | File /nonfatal "bin\HookWindows_x64.exe" 195 | File /nonfatal "bin\hooks_x64.dll" 196 | 197 | !insertmacro Lang "en-US" ${LANG_ENGLISH} 198 | !insertmacro Lang "fr-FR" ${LANG_FRENCH} 199 | !insertmacro Lang "pl-PL" ${LANG_POLISH} 200 | !insertmacro Lang "pt-BR" ${LANG_PORTUGUESEBR} 201 | !insertmacro Lang "ru-RU" ${LANG_RUSSIAN} 202 | !insertmacro Lang "sk-SK" ${LANG_SLOVAK} 203 | !insertmacro Lang "zh-CN" ${LANG_SIMPCHINESE} 204 | !insertmacro Lang "it-IT" ${LANG_ITALIAN} 205 | !insertmacro Lang "de-DE" ${LANG_GERMAN} 206 | !insertmacro Lang "ca-ES" ${LANG_CATALAN} 207 | ; Add new translations here! 208 | 209 | ; Update registry 210 | WriteRegStr HKCU "Software\${APP_NAME}" "Install_Dir" "$INSTDIR" 211 | WriteRegStr HKCU "Software\${APP_NAME}" "Version" "${APP_VERSION}" 212 | 213 | ; Create uninstaller 214 | WriteUninstaller "Uninstall.exe" 215 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "UninstallString" '"$INSTDIR\Uninstall.exe"' 216 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "QuietUninstallString" '"$INSTDIR\Uninstall.exe" /S' 217 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayName" "${APP_NAME}" 218 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayIcon" '"$INSTDIR\${APP_NAME}.exe"' 219 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayVersion" "${APP_VERSION}" 220 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "HelpLink" "${APP_URL}" 221 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "Publisher" "Stefan Sundin" 222 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "InstallLocation" "$INSTDIR\" 223 | WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "NoModify" 1 224 | WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "NoRepair" 1 225 | 226 | ; Compute size for uninstall information 227 | ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 228 | IntFmt $0 "0x%08X" $0 229 | WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "EstimatedSize" "$0" 230 | SectionEnd 231 | 232 | Section "" sec_shortcut 233 | CreateShortCut "$SMPROGRAMS\${APP_NAME}.lnk" "$INSTDIR\${APP_NAME}.exe" "" "$INSTDIR\${APP_NAME}.exe" 0 234 | SectionEnd 235 | 236 | 237 | ; Alt+Shift notification 238 | Function PageAltShift 239 | ${If} $SkipAltShiftPage == "true" 240 | Abort 241 | ${EndIf} 242 | 243 | nsDialogs::Create 1018 244 | !insertmacro MUI_HEADER_TEXT "$(L10N_ALTSHIFT_TITLE)" "$(L10N_ALTSHIFT_SUBTITLE)" 245 | ${NSD_CreateLabel} 0 0 100% 143 "$(L10N_ALTSHIFT_HEADER)" 246 | ${NSD_CreateButton} 0 162 92u 17u "$(L10N_ALTSHIFT_BUTTON)" 247 | Pop $0 248 | ${NSD_OnClick} $0 OpenKeyboardSettings 249 | 250 | ; Disable buttons 251 | Call DisableXButton 252 | Call DisableCancelButton 253 | 254 | nsDialogs::Show 255 | FunctionEnd 256 | 257 | Function OpenKeyboardSettings 258 | Exec "rundll32.exe shell32.dll,Control_RunDLL input.dll,,{C07337D3-DB2C-4D0B-9A93-B722A6C106E2}{HOTKEYS}" 259 | FunctionEnd 260 | 261 | 262 | ; LowLevelHooksTimeout notification 263 | Var AdjustLowLevelHooksTimeoutButton 264 | Var RevertLowLevelHooksTimeoutButton 265 | 266 | Function PageLowLevelHooksTimeout 267 | ${If} $SkipLowLevelHooksTimeoutPage == "true" 268 | Abort 269 | ${EndIf} 270 | 271 | nsDialogs::Create 1018 272 | !insertmacro MUI_HEADER_TEXT "$(L10N_HOOKTIMEOUT_TITLE)" "$(L10N_HOOKTIMEOUT_SUBTITLE)" 273 | ${NSD_CreateLabel} 0 0 100% 142 "$(L10N_HOOKTIMEOUT_HEADER)" 274 | 275 | ${NSD_CreateButton} 0 162 100u 17u "$(L10N_HOOKTIMEOUT_APPLYBUTTON)" 276 | Pop $AdjustLowLevelHooksTimeoutButton 277 | ${NSD_OnClick} $AdjustLowLevelHooksTimeoutButton AdjustLowLevelHooksTimeout 278 | 279 | ${NSD_CreateButton} 200 162 100u 17u "$(L10N_HOOKTIMEOUT_REVERTBUTTON)" 280 | Pop $RevertLowLevelHooksTimeoutButton 281 | ${NSD_OnClick} $RevertLowLevelHooksTimeoutButton RevertLowLevelHooksTimeout 282 | EnableWindow $RevertLowLevelHooksTimeoutButton 0 283 | 284 | ${NSD_CreateLabel} 0 195 100% 30 "$(L10N_HOOKTIMEOUT_FOOTER)" 285 | 286 | ; Disable buttons 287 | Call DisableXButton 288 | Call DisableCancelButton 289 | ${If} $SkipAltShiftPage == "true" 290 | Call DisableBackButton 291 | ${EndIf} 292 | 293 | ClearErrors 294 | ReadRegDWORD $0 HKCU "Control Panel\Desktop" "LowLevelHooksTimeout" 295 | IfErrors done 296 | 297 | ${NSD_CreateLabel} 0 140 100% 20 "$(L10N_HOOKTIMEOUT_ALREADYAPPLIED)" 298 | Pop $0 299 | CreateFont $1 "MS Shell Dlg" 7 700 300 | SendMessage $0 ${WM_SETFONT} $1 0 301 | 302 | EnableWindow $AdjustLowLevelHooksTimeoutButton 0 303 | EnableWindow $RevertLowLevelHooksTimeoutButton 1 304 | 305 | done: 306 | nsDialogs::Show 307 | FunctionEnd 308 | 309 | Function AdjustLowLevelHooksTimeout 310 | WriteRegDWORD HKCU "Control Panel\Desktop" "LowLevelHooksTimeout" 5000 311 | EnableWindow $AdjustLowLevelHooksTimeoutButton 0 312 | EnableWindow $RevertLowLevelHooksTimeoutButton 1 313 | Call FocusNextButton ; Otherwise Alt shortcuts won't work 314 | FunctionEnd 315 | 316 | Function RevertLowLevelHooksTimeout 317 | DeleteRegValue HKCU "Control Panel\Desktop" "LowLevelHooksTimeout" 318 | EnableWindow $AdjustLowLevelHooksTimeoutButton 1 319 | EnableWindow $RevertLowLevelHooksTimeoutButton 0 320 | Call FocusNextButton ; Otherwise Alt shortcuts won't work 321 | FunctionEnd 322 | 323 | 324 | ; Detect previous installation 325 | Var Upgradebox 326 | Var Uninstallbox 327 | 328 | Function PageUpgrade 329 | IfFileExists $INSTDIR +2 330 | Abort 331 | 332 | nsDialogs::Create 1018 333 | !insertmacro MUI_HEADER_TEXT "$(L10N_UPGRADE_TITLE)" "$(L10N_UPGRADE_SUBTITLE)" 334 | ${NSD_CreateLabel} 0 0 100% 20u "$(L10N_UPGRADE_HEADER)" 335 | 336 | ${NSD_CreateRadioButton} 0 45 100% 10u "$(L10N_UPGRADE_UPGRADE)" 337 | Pop $Upgradebox 338 | ${NSD_Check} $Upgradebox 339 | ${NSD_CreateLabel} 16 62 100% 20u "$(L10N_UPGRADE_INI)" 340 | 341 | ${NSD_CreateRadioButton} 0 95 100% 10u "$(L10N_UPGRADE_INSTALL)" 342 | 343 | ${NSD_CreateRadioButton} 0 130 100% 10u "$(L10N_UPGRADE_UNINSTALL)" 344 | Pop $Uninstallbox 345 | 346 | ${NSD_CreateLabel} 0 160 100% 30u "Note: version 1.1 and later defaults to install to the user directory. If you are upgrading from a previous version, then you are recommended to first uninstall and then install from scratch. Otherwise you have to right click the installer and use 'Run as administrator'." 347 | 348 | nsDialogs::Show 349 | FunctionEnd 350 | 351 | Function PageUpgradeLeave 352 | ${NSD_GetState} $Uninstallbox $0 353 | ${If} $0 == ${BST_CHECKED} 354 | ExecShell "open" '"$INSTDIR\Uninstall.exe"' 355 | Quit 356 | ${EndIf} 357 | 358 | ${NSD_GetState} $Upgradebox $UpgradeState 359 | ${If} $UpgradeState == ${BST_CHECKED} 360 | !insertmacro UnselectSection ${sec_shortcut} 361 | ${EndIf} 362 | FunctionEnd 363 | 364 | 365 | Function .onInit 366 | Call AddTray 367 | 368 | ; Set language from command line 369 | ClearErrors 370 | ${GetParameters} $0 371 | IfErrors done2 372 | ${GetOptionsS} $0 "/L=" $0 373 | IfErrors done2 374 | 375 | !insertmacro SetLang $0 "en-US" ${LANG_ENGLISH} 376 | !insertmacro SetLang $0 "fr-FR" ${LANG_FRENCH} 377 | !insertmacro SetLang $0 "pl-PL" ${LANG_POLISH} 378 | !insertmacro SetLang $0 "pt-BR" ${LANG_PORTUGUESEBR} 379 | !insertmacro SetLang $0 "ru-RU" ${LANG_RUSSIAN} 380 | !insertmacro SetLang $0 "sk-SK" ${LANG_SLOVAK} 381 | !insertmacro SetLang $0 "zh-CN" ${LANG_SIMPCHINESE} 382 | !insertmacro SetLang $0 "it-IT" ${LANG_ITALIAN} 383 | !insertmacro SetLang $0 "de-DE" ${LANG_GERMAN} 384 | ; Add new translations here! 385 | 386 | WriteRegStr ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" "$LANGUAGE" 387 | done2: 388 | 389 | ; Check if special pages should appear 390 | StrCpy $SkipAltShiftPage "false" 391 | ClearErrors 392 | ReadRegStr $0 HKCU "Keyboard Layout\Toggle" "Language Hotkey" 393 | IfErrors done3 394 | ReadRegStr $1 HKCU "Keyboard Layout\Toggle" "Layout Hotkey" 395 | ${If} $0 != "1" 396 | ${AndIf} $1 != "1" 397 | StrCpy $SkipAltShiftPage "true" 398 | ${EndIf} 399 | done3: 400 | 401 | StrCpy $SkipLowLevelHooksTimeoutPage "false" 402 | ${If} ${AtMostWinVista} 403 | StrCpy $SkipLowLevelHooksTimeoutPage "true" 404 | ${EndIf} 405 | 406 | ; Display language selection 407 | !insertmacro MUI_LANGDLL_DISPLAY 408 | FunctionEnd 409 | 410 | 411 | ; Uninstaller 412 | 413 | Function un.onInit 414 | !insertmacro MUI_UNGETLANGUAGE 415 | Call un.AddTray 416 | FunctionEnd 417 | 418 | Section "Uninstall" 419 | Call un.CloseApp 420 | 421 | Delete /REBOOTOK "$INSTDIR\${APP_NAME}.exe" 422 | Delete /REBOOTOK "$INSTDIR\hooks.dll" 423 | Delete /REBOOTOK "$INSTDIR\HookWindows_x64.exe" 424 | Delete /REBOOTOK "$INSTDIR\hooks_x64.dll" 425 | Delete /REBOOTOK "$INSTDIR\${APP_NAME}.ini" 426 | Delete /REBOOTOK "$INSTDIR\${APP_NAME}-old.ini" 427 | Delete /REBOOTOK "$INSTDIR\Uninstall.exe" 428 | RMDir /REBOOTOK "$INSTDIR" 429 | 430 | Delete /REBOOTOK "$SMPROGRAMS\${APP_NAME}.lnk" 431 | 432 | DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${APP_NAME}" 433 | DeleteRegKey /ifempty HKCU "Software\${APP_NAME}" 434 | DeleteRegKey /ifempty HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" 435 | SectionEnd 436 | -------------------------------------------------------------------------------- /altdrag.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Stefan Sundin 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | */ 9 | 10 | #define UNICODE 11 | #define _UNICODE 12 | #define _WIN32_WINNT 0x0600 13 | #define _WIN32_IE 0x0600 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | // App 21 | #define APP_NAME L"AltDrag" 22 | #define APP_VERSION "1.1" 23 | #define APP_URL L"https://stefansundin.github.io/altdrag/" 24 | 25 | // Messages 26 | #define WM_TRAY WM_USER+1 27 | #define SWM_TOGGLE WM_APP+1 28 | #define SWM_HIDE WM_APP+2 29 | #define SWM_UPDATE WM_APP+3 30 | #define SWM_CONFIG WM_APP+4 31 | #define SWM_ABOUT WM_APP+5 32 | #define SWM_EXIT WM_APP+6 33 | 34 | // Boring stuff 35 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 36 | #define ENABLED() (keyhook || msghook) 37 | LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM); 38 | HINSTANCE g_hinst = NULL; 39 | HWND g_hwnd = NULL; 40 | UINT WM_TASKBARCREATED = 0; 41 | UINT WM_UPDATESETTINGS = 0; 42 | UINT WM_ADDTRAY = 0; 43 | UINT WM_HIDETRAY = 0; 44 | UINT WM_OPENCONFIG = 0; 45 | UINT WM_CLOSECONFIG = 0; 46 | wchar_t inipath[MAX_PATH]; 47 | 48 | // Cool stuff 49 | HINSTANCE hinstDLL = NULL; 50 | HHOOK keyhook = NULL; 51 | HHOOK msghook = NULL; 52 | BOOL x64 = FALSE; 53 | int vista = 0; 54 | int elevated = 0; 55 | 56 | // Include stuff 57 | #include "localization/strings.h" 58 | #include "localization/languages.h" 59 | #include "include/error.c" 60 | #include "include/localization.c" 61 | #include "include/languages.c" 62 | #include "include/tray.c" 63 | #include "include/update.c" 64 | #include "config/config.c" 65 | 66 | // Entry point 67 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, char *szCmdLine, int iCmdShow) { 68 | g_hinst = hInst; 69 | IsWow64Process(GetCurrentProcess(), &x64); 70 | 71 | // Get ini path 72 | GetModuleFileName(NULL, inipath, ARRAY_SIZE(inipath)); 73 | PathRemoveFileSpec(inipath); 74 | wcscat(inipath, L"\\"APP_NAME".ini"); 75 | wchar_t txt[10]; 76 | 77 | // Convert szCmdLine to argv and argc (max 10 arguments) 78 | char *argv[10]; 79 | int argc = 1; 80 | argv[0] = szCmdLine; 81 | while ((argv[argc]=strchr(argv[argc-1],' ')) != NULL) { 82 | *argv[argc] = '\0'; 83 | if (argc == ARRAY_SIZE(argv)) break; 84 | argv[argc++]++; 85 | } 86 | 87 | // Check arguments 88 | int i; 89 | int elevate=0, quiet=0, config=-1, multi=0; 90 | for (i=0; i < argc; i++) { 91 | if (!strcmp(argv[i],"-hide") || !strcmp(argv[i],"-h")) { 92 | // -hide = do not add tray icon, hide it if already running 93 | hide = 1; 94 | } 95 | else if (!strcmp(argv[i],"-quiet") || !strcmp(argv[i],"-q")) { 96 | // -quiet = do nothing if already running 97 | quiet = 1; 98 | } 99 | else if (!strcmp(argv[i],"-elevate") || !strcmp(argv[i],"-e")) { 100 | // -elevate = create a new instance with administrator privileges 101 | elevate = 1; 102 | } 103 | else if (!strcmp(argv[i],"-config") || !strcmp(argv[i],"-c")) { 104 | // -config = open config (with requested page) 105 | config = (i+1 < argc)?atoi(argv[i+1]):0; 106 | } 107 | else if (!strcmp(argv[i],"-multi")) { 108 | // -multi = allow multiple instances, used internally when elevating via config window 109 | multi = 1; 110 | } 111 | } 112 | 113 | // Check if elevated if in >= Vista 114 | OSVERSIONINFO vi = { sizeof(OSVERSIONINFO) }; 115 | GetVersionEx(&vi); 116 | vista = (vi.dwMajorVersion >= 6); 117 | if (vista) { 118 | HANDLE token; 119 | TOKEN_ELEVATION elevation; 120 | DWORD len; 121 | if (OpenProcessToken(GetCurrentProcess(),TOKEN_READ,&token) && GetTokenInformation(token,TokenElevation,&elevation,sizeof(elevation),&len)) { 122 | elevated = elevation.TokenIsElevated; 123 | } 124 | } 125 | 126 | // Register some messages 127 | WM_UPDATESETTINGS = RegisterWindowMessage(L"UpdateSettings"); 128 | WM_OPENCONFIG = RegisterWindowMessage(L"OpenConfig"); 129 | WM_CLOSECONFIG = RegisterWindowMessage(L"CloseConfig"); 130 | WM_ADDTRAY = RegisterWindowMessage(L"AddTray"); 131 | WM_HIDETRAY = RegisterWindowMessage(L"HideTray"); 132 | 133 | // Look for previous instance 134 | GetPrivateProfileString(L"Advanced", L"MultipleInstances", L"0", txt, ARRAY_SIZE(txt), inipath); 135 | if (!_wtoi(txt) && !multi) { 136 | HWND previnst = FindWindow(APP_NAME, NULL); 137 | if (previnst != NULL) { 138 | if (quiet) { 139 | return 0; 140 | } 141 | PostMessage(previnst, WM_UPDATESETTINGS, 0, 0); 142 | PostMessage(previnst, (hide && !config?WM_CLOSECONFIG:WM_OPENCONFIG), config, 0); 143 | PostMessage(previnst, (hide?WM_HIDETRAY:WM_ADDTRAY), 0, 0); 144 | return 0; 145 | } 146 | } 147 | 148 | // Check AlwaysElevate 149 | if (!elevated) { 150 | GetPrivateProfileString(L"Advanced", L"AlwaysElevate", L"0", txt, ARRAY_SIZE(txt), inipath); 151 | if (_wtoi(txt)) { 152 | elevate = 1; 153 | } 154 | 155 | // Handle request to elevate to administrator privileges 156 | if (elevate) { 157 | wchar_t path[MAX_PATH]; 158 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 159 | int ret = (INT_PTR) ShellExecute(NULL, L"runas", path, (hide?L"-hide":NULL), NULL, SW_SHOWNORMAL); 160 | if (ret > 32) { 161 | return 0; 162 | } 163 | } 164 | } 165 | 166 | // Language 167 | memset(&l10n_ini, 0, sizeof(l10n_ini)); 168 | UpdateLanguage(); 169 | 170 | // Create window 171 | WNDCLASSEX wnd = { sizeof(WNDCLASSEX), 0, WindowProc, 0, 0, hInst, NULL, NULL, (HBRUSH)(COLOR_WINDOW+1), NULL, APP_NAME, NULL }; 172 | RegisterClassEx(&wnd); 173 | g_hwnd = CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TOPMOST|WS_EX_LAYERED, wnd.lpszClassName, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, hInst, NULL); 174 | SetLayeredWindowAttributes(g_hwnd, 0, 1, LWA_ALPHA); // Almost transparent 175 | 176 | // Tray icon 177 | InitTray(); 178 | UpdateTray(); 179 | 180 | // Hook system 181 | HookSystem(); 182 | 183 | // Add tray if hook failed, even though -hide was supplied 184 | if (hide && !keyhook) { 185 | hide = 0; 186 | UpdateTray(); 187 | } 188 | 189 | // Check for update 190 | GetPrivateProfileString(L"Update", L"CheckOnStartup", L"0", txt, ARRAY_SIZE(txt), inipath); 191 | if (_wtoi(txt)) { 192 | CheckForUpdate(0); 193 | } 194 | 195 | // Open config if -config was supplied 196 | if (config != -1) { 197 | PostMessage(g_hwnd, WM_OPENCONFIG, config, 0); 198 | } 199 | 200 | // Message loop 201 | MSG msg; 202 | while (GetMessage(&msg,NULL,0,0)) { 203 | TranslateMessage(&msg); 204 | DispatchMessage(&msg); 205 | } 206 | return msg.wParam; 207 | } 208 | 209 | int HookSystem() { 210 | if (keyhook && msghook) { 211 | // System already hooked 212 | return 1; 213 | } 214 | 215 | // Load library 216 | if (!hinstDLL) { 217 | wchar_t path[MAX_PATH]; 218 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 219 | PathRemoveFileSpec(path); 220 | wcscat(path, L"\\hooks.dll"); 221 | hinstDLL = LoadLibrary(path); 222 | if (hinstDLL == NULL) { 223 | Error(L"LoadLibrary('hooks.dll')", L"This probably means that the file hooks.dll is missing. You can try reinstalling "APP_NAME".", GetLastError()); 224 | return 1; 225 | } 226 | } 227 | 228 | // Load keyboard hook 229 | HOOKPROC procaddr; 230 | if (!keyhook) { 231 | // Get address to keyboard hook (beware name mangling) 232 | procaddr = (HOOKPROC) GetProcAddress(hinstDLL, "LowLevelKeyboardProc@12"); 233 | if (procaddr == NULL) { 234 | Error(L"GetProcAddress('LowLevelKeyboardProc@12')", L"This probably means that the file hooks.dll is from an old version or corrupt. You can try reinstalling "APP_NAME".", GetLastError()); 235 | return 1; 236 | } 237 | // Set up the keyboard hook 238 | keyhook = SetWindowsHookEx(WH_KEYBOARD_LL, procaddr, hinstDLL, 0); 239 | if (keyhook == NULL) { 240 | Error(L"SetWindowsHookEx(WH_KEYBOARD_LL)", L"Could not hook keyboard. Another program might be interfering.", GetLastError()); 241 | return 1; 242 | } 243 | } 244 | 245 | // HookWindows 246 | wchar_t txt[10]; 247 | GetPrivateProfileString(L"Advanced", L"HookWindows", L"0", txt, ARRAY_SIZE(txt), inipath); 248 | if (!msghook && _wtoi(txt)) { 249 | // Get address to message hook (beware name mangling) 250 | procaddr = (HOOKPROC) GetProcAddress(hinstDLL, "CallWndProc@12"); 251 | if (procaddr == NULL) { 252 | Error(L"GetProcAddress('CallWndProc@12')", L"This probably means that the file hooks.dll is from an old version or corrupt. You can try reinstalling "APP_NAME".", GetLastError()); 253 | return 1; 254 | } 255 | // Set up the message hook 256 | msghook = SetWindowsHookEx(WH_CALLWNDPROC, procaddr, hinstDLL, 0); 257 | if (msghook == NULL) { 258 | Error(L"SetWindowsHookEx(WH_CALLWNDPROC)", L"Could not hook message hook. Another program might be interfering.", GetLastError()); 259 | return 1; 260 | } 261 | 262 | // x64 263 | if (x64) { 264 | wchar_t path[MAX_PATH]; 265 | GetModuleFileName(NULL, path, ARRAY_SIZE(path)); 266 | PathRemoveFileSpec(path); 267 | wcscat(path, L"\\HookWindows_x64.exe"); 268 | ShellExecute(NULL, L"open", path, L"nowarning", NULL, SW_SHOWNORMAL); 269 | } 270 | } 271 | 272 | // Success 273 | UpdateTray(); 274 | return 0; 275 | } 276 | 277 | // Force processes to unload hooks.dll by sending them a dummy message (HookWindows) 278 | // To be honest I don't really know if this makes a difference anymore 279 | BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { 280 | PostMessage(hwnd, WM_NULL, 0, 0); 281 | return TRUE; 282 | } 283 | 284 | int UnhookSystem() { 285 | if (!keyhook && !msghook) { 286 | // System not hooked 287 | return 1; 288 | } 289 | 290 | // Remove keyboard hook 291 | if (keyhook) { 292 | if (UnhookWindowsHookEx(keyhook) == 0) { 293 | #ifdef DEBUG 294 | Error(L"UnhookWindowsHookEx(keyhook)", L"Could not unhook keyboard. Try restarting "APP_NAME".", GetLastError()); 295 | #else 296 | if (showerror) { 297 | MessageBox(NULL, l10n->unhook_error, APP_NAME, MB_ICONINFORMATION|MB_OK|MB_TOPMOST|MB_SETFOREGROUND); 298 | } 299 | #endif 300 | } 301 | keyhook = NULL; 302 | } 303 | 304 | // Remove message hook 305 | if (msghook) { 306 | if (UnhookWindowsHookEx(msghook) == 0) { 307 | #ifdef DEBUG 308 | Error(L"UnhookWindowsHookEx(msghook)", L"Could not unhook message hook. Try restarting "APP_NAME".", GetLastError()); 309 | #endif 310 | } 311 | msghook = NULL; 312 | 313 | // Close HookWindows_x64.exe 314 | if (x64) { 315 | HWND window = FindWindow(L"AltDrag-x64", NULL); 316 | if (window != NULL) { 317 | PostMessage(window, WM_CLOSE, 0, 0); 318 | } 319 | } 320 | 321 | // Send dummy messages to all processes to make them unload hooks.dll 322 | EnumWindows(EnumWindowsProc, 0); 323 | } 324 | 325 | // Tell dll file that we are unloading 326 | void (*Unload)() = (void*) GetProcAddress(hinstDLL, "Unload"); 327 | if (Unload == NULL) { 328 | Error(L"GetProcAddress('Unload')", L"This probably means that the file hooks.dll is from an old version or corrupt. You can try reinstalling "APP_NAME".", GetLastError()); 329 | } 330 | else { 331 | Unload(); 332 | } 333 | 334 | // Unload library 335 | if (hinstDLL) { 336 | if (FreeLibrary(hinstDLL) == 0) { 337 | Error(L"FreeLibrary()", L"Could not free hooks.dll. Try restarting "APP_NAME".", GetLastError()); 338 | } 339 | hinstDLL = NULL; 340 | } 341 | 342 | // Success 343 | UpdateTray(); 344 | return 0; 345 | } 346 | 347 | void ToggleState() { 348 | if (ENABLED()) { 349 | UnhookSystem(); 350 | } 351 | else { 352 | SendMessage(g_hwnd, WM_UPDATESETTINGS, 0, 0); 353 | HookSystem(); 354 | } 355 | } 356 | 357 | LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { 358 | if (msg == WM_TRAY) { 359 | if (lParam == WM_LBUTTONDOWN || lParam == WM_LBUTTONDBLCLK) { 360 | ToggleState(); 361 | if (lParam == WM_LBUTTONDBLCLK && !(GetAsyncKeyState(VK_SHIFT)&0x8000)) { 362 | SendMessage(hwnd, WM_OPENCONFIG, 0, 0); 363 | } 364 | } 365 | else if (lParam == WM_MBUTTONDOWN) { 366 | ShellExecute(NULL, L"open", inipath, NULL, NULL, SW_SHOWNORMAL); 367 | } 368 | else if (lParam == WM_RBUTTONUP) { 369 | ShowContextMenu(hwnd); 370 | } 371 | else if (lParam == NIN_BALLOONUSERCLICK) { 372 | hide = 0; 373 | SendMessage(hwnd, WM_COMMAND, SWM_UPDATE, 0); 374 | } 375 | else if (lParam == NIN_BALLOONTIMEOUT) { 376 | if (hide) { 377 | RemoveTray(); 378 | } 379 | } 380 | } 381 | else if (msg == WM_UPDATESETTINGS) { 382 | UpdateLanguage(); 383 | // Reload hooks 384 | if (ENABLED()) { 385 | UnhookSystem(); 386 | HookSystem(); 387 | } 388 | // Reload config language 389 | if (!wParam && IsWindow(g_cfgwnd)) { 390 | SendMessage(g_cfgwnd, WM_UPDATESETTINGS, 0, 0); 391 | } 392 | } 393 | else if (msg == WM_ADDTRAY) { 394 | hide = 0; 395 | UpdateTray(); 396 | } 397 | else if (msg == WM_HIDETRAY) { 398 | hide = 1; 399 | RemoveTray(); 400 | } 401 | else if (msg == WM_OPENCONFIG && (lParam || !hide)) { 402 | OpenConfig(wParam); 403 | } 404 | else if (msg == WM_CLOSECONFIG) { 405 | CloseConfig(); 406 | } 407 | else if (msg == WM_TASKBARCREATED) { 408 | tray_added = 0; 409 | UpdateTray(); 410 | } 411 | else if (msg == WM_COMMAND) { 412 | int wmId=LOWORD(wParam), wmEvent=HIWORD(wParam); 413 | if (wmId == SWM_TOGGLE) { 414 | ToggleState(); 415 | } 416 | else if (wmId == SWM_HIDE) { 417 | hide = 1; 418 | RemoveTray(); 419 | } 420 | else if (wmId == SWM_UPDATE) { 421 | if (MessageBox(NULL,l10n->update_dialog,APP_NAME,MB_ICONINFORMATION|MB_YESNO|MB_TOPMOST|MB_SETFOREGROUND) == IDYES) { 422 | OpenUrl(APP_URL); 423 | } 424 | } 425 | else if (wmId == SWM_CONFIG) { 426 | SendMessage(hwnd, WM_OPENCONFIG, 0, 0); 427 | } 428 | else if (wmId == SWM_ABOUT) { 429 | SendMessage(hwnd, WM_OPENCONFIG, 4, 0); 430 | } 431 | else if (wmId == SWM_EXIT) { 432 | DestroyWindow(hwnd); 433 | } 434 | } 435 | else if (msg == WM_QUERYENDSESSION && msghook) { 436 | showerror = 0; 437 | UnhookSystem(); 438 | } 439 | else if (msg == WM_DESTROY) { 440 | showerror = 0; 441 | UnhookSystem(); 442 | RemoveTray(); 443 | PostQuitMessage(0); 444 | } 445 | else if (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN) { 446 | // Hide cursorwnd if clicked on, this might happen if it wasn't hidden by hooks.c for some reason 447 | ShowWindow(hwnd, SW_HIDE); 448 | } 449 | return DefWindowProc(hwnd, msg, wParam, lParam); 450 | } 451 | --------------------------------------------------------------------------------