diff --git a/Deployment/Installer.nsi b/Deployment/Installer.nsi index ed7f8ff..35d81ca 100644 --- a/Deployment/Installer.nsi +++ b/Deployment/Installer.nsi @@ -7,7 +7,7 @@ !define PRODUCT_FULLNAME "KakaoTalk ADGuard" !define PRODUCT_NAME "KakaoTalkADGuard" !define PRODUCT_COMMENTS "AD removal tool for Windows KakaoTalk" -!define PRODUCT_VERSION "1.0.0.6" +!define PRODUCT_VERSION "1.0.0.7" !define BUILD_ARCH "x64" !define PRODUCT_PUBLISHER "loopback.kr" !define PRODUCT_REG_ROOTKEY "HKCU" @@ -58,9 +58,9 @@ FunctionEnd Section "Installer Section" SetOutPath $INSTDIR ${If} ${RunningX64} - File "..\Release\x64\${PRODUCT_NAME}.exe" + File /oname=${PRODUCT_NAME}.exe "..\Release\x64\${PRODUCT_NAME}.x64.exe" ${Else} - File "..\Release\win32\${PRODUCT_NAME}.exe" + File /oname=${PRODUCT_NAME}.exe "..\Release\win32\${PRODUCT_NAME}.x86.exe" ${EndIf} ; File "RestoreTrayIcon.exe" CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" diff --git a/KakaoTalkADGuard/KakaoTalkADGuard.aps b/KakaoTalkADGuard/KakaoTalkADGuard.aps index f25d518..a4e8aa8 100644 Binary files a/KakaoTalkADGuard/KakaoTalkADGuard.aps and b/KakaoTalkADGuard/KakaoTalkADGuard.aps differ diff --git a/KakaoTalkADGuard/KakaoTalkADGuard.rc b/KakaoTalkADGuard/KakaoTalkADGuard.rc index 5c4b8ad..e053c3a 100644 Binary files a/KakaoTalkADGuard/KakaoTalkADGuard.rc and b/KakaoTalkADGuard/KakaoTalkADGuard.rc differ diff --git a/KakaoTalkADGuard/KakaoTalkADGuard.vcxproj b/KakaoTalkADGuard/KakaoTalkADGuard.vcxproj index 1a504f3..63d13bb 100644 --- a/KakaoTalkADGuard/KakaoTalkADGuard.vcxproj +++ b/KakaoTalkADGuard/KakaoTalkADGuard.vcxproj @@ -112,6 +112,7 @@ true true true + $(OutDir)$(TargetName).$(PlatformTarget)$(TargetExt) @@ -140,6 +141,7 @@ true true true + $(OutDir)$(TargetName).$(PlatformTarget)$(TargetExt) diff --git a/KakaoTalkADGuard/main.cpp b/KakaoTalkADGuard/main.cpp index e5b63d2..af8242f 100644 --- a/KakaoTalkADGuard/main.cpp +++ b/KakaoTalkADGuard/main.cpp @@ -264,10 +264,22 @@ BOOL DeleteTrayIcon(NOTIFYICONDATA nid) { void ShowContextMenu(HWND hwnd, POINT pt) { HMENU hMenu; + WCHAR szAppName[MAX_LOADSTRING]; + WCHAR szVersion[MAX_LOADSTRING]; + WCHAR szFullAppName[MAX_LOADSTRING]; + szFullAppName[0] = L'\0'; + LoadStringW(hInst, IDS_APP_NAME, szAppName, MAX_LOADSTRING); + LoadStringW(hInst, IDS_APP_VERSION, szVersion, MAX_LOADSTRING); + wcscpy_s(szFullAppName, szAppName); + wcscat_s(szFullAppName, L" "); + wcscat_s(szFullAppName, szVersion); + if (bPortable) { hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TRAY_CONTEXTMENU_PORTABLE)); + ModifyMenuW(hMenu, ID__APP_TITLE, MF_BYCOMMAND | MF_STRING | MF_DISABLED, ID__APP_TITLE, (LPCWSTR) szFullAppName); } else { hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TRAY_CONTEXTMENU)); + ModifyMenuW(hMenu, ID__APP_TITLE, MF_BYCOMMAND | MF_STRING | MF_DISABLED, ID__APP_TITLE, (LPCWSTR)szFullAppName); } HMENU hSubMenu = GetSubMenu(hMenu, 0); SetForegroundWindow(hwnd); // our window must be foreground before calling TrackPopupMenu or the menu will not disappear when the user clicks away @@ -299,13 +311,26 @@ BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) { WCHAR windowText[256] = L""; GetClassName(hwnd, className, 256); GetWindowText(hwnd, windowText, 256); + RECT Recthwnd; if (wcscmp(className, L"EVA_ChildWindow") == 0) { if (wcsncmp(windowText, L"OnlineMainView_", 15) == 0) { // Expand chat widget to empty space SetWindowPos(hwnd, HWND_TOP, 0, 0, (RectKakaoTalkMain.right - RectKakaoTalkMain.left), (RectKakaoTalkMain.bottom - RectKakaoTalkMain.top - 32), SWP_NOMOVE); + } else if (wcscmp(windowText, L"") == 0) { + GetWindowRect(hwnd, &Recthwnd); + int width = Recthwnd.right - Recthwnd.left; + int height = Recthwnd.bottom - Recthwnd.top; + if (height <= 200 && width > height) { + ShowWindow(hwnd, SW_HIDE); + } } return TRUE; } + if (wcsncmp(windowText, L"LockModeView_", 13) == 0) { // Expand numpad in Lockdown mode + HWND hLockdownNumpad = FindWindowEx(hwnd, NULL, L"EVA_ChildWindow", L""); + if (hLockdownNumpad != NULL) + SetWindowPos(hwnd, HWND_TOP, 0, 0, (RectKakaoTalkMain.right - RectKakaoTalkMain.left), (RectKakaoTalkMain.bottom - RectKakaoTalkMain.top), SWP_NOMOVE); + } if (wcscmp(className, L"BannerAdWnd") == 0) { ShowWindow(hwnd, SW_HIDE); return TRUE; @@ -325,15 +350,23 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT message, UINT idEvent, DWORD dwTimer) { switch (idEvent) { case 1: // Remove KakaoTalk ADs // Find main handle - HWND hKakaoTalkMain = FindWindow(L"EVA_Window_Dblclk", L"카카오톡"); + HWND hKakaoTalkMain = NULL; + const WCHAR* kakaoTalkNames[] = {L"카카오톡", L"カカオトーク", L"KakaoTalk"}; + int numNames = sizeof(kakaoTalkNames) / sizeof(kakaoTalkNames[0]); + for (int i = 0; i < numNames; ++i) { + hKakaoTalkMain = FindWindow(L"EVA_Window_Dblclk", kakaoTalkNames[i]); + if (hKakaoTalkMain != NULL) + break; + } // Block banner AD HWND hKakaoTalkAd = FindWindow(L"EVA_Window_Dblclk", L""); RECT RectKakaoTalkAd; if (GetParent(hKakaoTalkAd) == hKakaoTalkMain) { GetWindowRect(hKakaoTalkAd, &RectKakaoTalkAd); + int width = RectKakaoTalkAd.right - RectKakaoTalkAd.left; int height = RectKakaoTalkAd.bottom - RectKakaoTalkAd.top; - if (height == 100) { + if (height <= 200 && width > height) { ShowWindow(hKakaoTalkAd, SW_HIDE); } } @@ -341,9 +374,8 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT message, UINT idEvent, DWORD dwTimer) { // Scan ADs recursive GetWindowRect(hKakaoTalkMain, &RectKakaoTalkMain); EnumChildWindows(hKakaoTalkMain, EnumChildProc, NULL); - EnumChildWindows(hKakaoTalkAd, EnumChildProc, NULL); - // Sanity check for Popup AD + // Block popup AD DWORD pid_main = 0; DWORD pid_popup = 0; HWND hPopupWnd = FindWindow(L"RichPopWnd", L""); @@ -351,6 +383,7 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT message, UINT idEvent, DWORD dwTimer) { GetWindowThreadProcessId(hPopupWnd, &pid_popup); if (pid_main == pid_popup) ShowWindow(hPopupWnd, SW_HIDE); + break; } } \ No newline at end of file diff --git a/KakaoTalkADGuard/resource.h b/KakaoTalkADGuard/resource.h index 716b5ad..3f7e076 100644 --- a/KakaoTalkADGuard/resource.h +++ b/KakaoTalkADGuard/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} -// Microsoft Visual C++에서 생성한 포함 파일입니다. -// KakaoTalkADGuard.rc에서 사용되고 있습니다. +// Microsoft Visual C++ generated include file. +// Used by KakaoTalkADGuard.rc // #define IDC_MYICON 2 #define IDD_KAKAOTALKADGUARD_DIALOG 102 @@ -13,6 +13,7 @@ #define IDC_KAKAOTALKADGUARD 109 #define IDC_KAKAOTALKADGUARD_RESTORETRAY 110 #define IDS_MSGBOX_RESTORETRAY 111 +#define IDS_APP_VERSION 112 #define IDR_MAINFRAME 128 #define IDR_TRAY_CONTEXTMENU 133 #define IDI_ICON1 134 @@ -30,6 +31,7 @@ #define IDM_STARTONSYSTEMSTARTUP 32780 #define ID__ 32781 #define IDM__TEST 32782 +#define ID__APP_TITLE 32783 #define IDC_STATIC -1 // Next default values for new objects diff --git a/README.md b/README.md index 6c0ddec..77c30a2 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,21 @@ AD removal tool for Windows KakaoTalk - On Windows with HiDPI, the trayicon menu is displayed in an abnormal position. -- If a KakaoTalk process is running on a regular user account that has been promoted to administrator privileges due to a KakaoTalk update, it is not possible to block ADs unless KakaoTalk ADGuard is also running as administrator privileges. - ## Preview ![Highlights](https://github.com/loopback-kr/KakaoTalkADGuard/assets/28856527/493bea2b-87c9-4792-9cfd-c534aec02b14) ## Release notes +### 1.0.0.7 + +Apr. 27, 2024 + +- Support for multilingual versions of KakaoTalk +- Changed banner AD blocking criteria +- Removed white box at lockdown mode +- Code refactoring + ### 1.0.0.6 Apr. 22, 2024