diff --git a/WhatsappTray/Hook.cpp b/WhatsappTray/Hook.cpp index 0703231..012a1f6 100644 --- a/WhatsappTray/Hook.cpp +++ b/WhatsappTray/Hook.cpp @@ -70,9 +70,13 @@ LRESULT CALLBACK CallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam) // Deshalb denk ich es ist ok wenn ich hier den namen nicht prüfe. // NOTE: Ich mach es deshalb nicht weil das Fenster zu den zeitpunkt nicht auffindbar ist, was warscheinlich daran liegt das es bereits geschlossen wurde. - bool successfulSent = PostMessage(FindWindow(NAME, NAME), WM_WHAHTSAPP_CLOSING, 0, (LPARAM)msg->hwnd); - if (successfulSent) { - OutputDebugString(MODULE_NAME L"WM_WHAHTSAPP_CLOSING successful sent."); + // Ich machs jetz so dass ich wenn ich das Whatsapp-Fenster nicht finde auch schließe, wegen den oben genannten gruenden. + if (msg->hwnd == FindWindow(NULL, WHATSAPP_CLIENT_NAME) || FindWindow(NULL, WHATSAPP_CLIENT_NAME) == NULL) + { + bool successfulSent = PostMessage(FindWindow(NAME, NAME), WM_WHAHTSAPP_CLOSING, 0, (LPARAM)msg->hwnd); + if (successfulSent) { + OutputDebugString(MODULE_NAME L"WM_WHAHTSAPP_CLOSING successful sent."); + } } } diff --git a/WhatsappTray/RCa09256 b/WhatsappTray/RCa09256 deleted file mode 100644 index 7e9ab72..0000000 Binary files a/WhatsappTray/RCa09256 and /dev/null differ diff --git a/WhatsappTray/RCb09256 b/WhatsappTray/RCb09256 deleted file mode 100644 index 7e9ab72..0000000 Binary files a/WhatsappTray/RCb09256 and /dev/null differ diff --git a/WhatsappTray/WhatsappTray - Kopie.rc b/WhatsappTray/WhatsappTray - Kopie.rc deleted file mode 100644 index f4d6ced..0000000 --- a/WhatsappTray/WhatsappTray - Kopie.rc +++ /dev/null @@ -1,145 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUT DIALOGEX 0, 0, 199, 143 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About RBTray" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,75,122,50,14 - ICON IDI_RBTRAY,IDC_STATIC,7,7,20,20 - LTEXT "RBTray 4.3\r\nFreeware\r\n\r\nThis program is distributed under the terms of the GNU General Public License.\r\n\r\nCopyright © 1998-2011\r\n\r\nNikolay Redko\r\nhttp://rbtray.sourceforge.net/\r\n\r\nJ.D. Purcell\r\nhttp://www.moitah.net/",IDC_STATIC,38,7,151,108 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 192 - TOPMARGIN, 7 - BOTTOMMARGIN, 136 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_RBTRAY ICON "WhatsappTray.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,3,0,0 - PRODUCTVERSION 4,3,0,0 - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "RBTray" - VALUE "FileVersion", "4, 3, 0, 0" - VALUE "InternalName", "RBTray" - VALUE "LegalCopyright", "Copyright © 1998-2011 Nikolay Redko, J.D. Purcell" - VALUE "OriginalFilename", "RBTray.exe" - VALUE "ProductName", "RBTray" - VALUE "ProductVersion", "4, 3, 0, 0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/WhatsappTray/WhatsappTray.cpp b/WhatsappTray/WhatsappTray.cpp index cc93ac1..86a8c10 100644 --- a/WhatsappTray/WhatsappTray.cpp +++ b/WhatsappTray/WhatsappTray.cpp @@ -285,6 +285,7 @@ LRESULT CALLBACK HookWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) setHook(); break; case WM_ADDTRAY: + OutputDebugString(MODULE_NAME L"WM_ADDTRAY\n"); MinimizeWindowToTray((HWND)lParam); break; case WM_REMTRAY: @@ -310,7 +311,7 @@ LRESULT CALLBACK HookWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_WHAHTSAPP_CLOSING: // If Whatsapp is closing we want to close WhatsappTray as well. - //OutputDebugString(MODULE_NAME L"WM_WHAHTSAPP_CLOSING\n"); + OutputDebugString(MODULE_NAME L"WM_WHAHTSAPP_CLOSING\n"); DestroyWindow(_hwndWhatsappTray); break; case WM_DESTROY: diff --git a/WhatsappTray/WhatsappTray.rc b/WhatsappTray/WhatsappTray.rc index 46719bb..f32d85f 100644 --- a/WhatsappTray/WhatsappTray.rc +++ b/WhatsappTray/WhatsappTray.rc @@ -57,8 +57,8 @@ CAPTION "About WhatsappTray" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,75,159,50,14 - ICON IDI_WHATSAPPTRAY,IDC_STATIC,7,7,21,20 - LTEXT "WhatsappTray 1.3\r\nFreeware\r\n\r\nThis program is distributed under the terms of the GNU General Public License.\r\n\r\nCopyright © 1998-2017",IDC_STATIC,34,7,151,58 + ICON IDI_WHATSAPPTRAY,IDC_STATIC,7,7,20,20 + LTEXT "WhatsappTray 1.3.1\r\nFreeware\r\n\r\nThis program is distributed under the terms of the GNU General Public License.\r\n\r\nCopyright © 1998-2017",IDC_STATIC,34,7,151,58 LTEXT "Sebastian Amann\r\nhttps://github.com/D4koon",IDC_STATIC,34,69,151,25 LTEXT "Nikolay Redko\r\nhttp://rbtray.sourceforge.net/\r\n\r\nJ.D. Purcell\r\nhttp://www.moitah.net/",IDC_STATIC,34,93,151,42 END @@ -99,8 +99,8 @@ IDI_WHATSAPPTRAY ICON "WhatsappTray.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,3,0,0 - PRODUCTVERSION 1,3,0,0 + FILEVERSION 1,3,1,0 + PRODUCTVERSION 1,3,1,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -116,12 +116,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "WhatsappTray" - VALUE "FileVersion", "1.3.0.0" + VALUE "FileVersion", "1.3.1.0" VALUE "InternalName", "WhatsappTray" VALUE "LegalCopyright", "Copyright © 1998-2016 Sebastian Amann, Nikolay Redko, J.D. Purcell" VALUE "OriginalFilename", "WhatsappTray.exe" VALUE "ProductName", "WhatsappTray" - VALUE "ProductVersion", "1.3.0.0" + VALUE "ProductVersion", "1.3.1.0" END END BLOCK "VarFileInfo" diff --git a/setupBuildfile.iss b/setupBuildfile.iss new file mode 100644 index 0000000..3ea528b --- /dev/null +++ b/setupBuildfile.iss @@ -0,0 +1,44 @@ +; Script generated by the Inno Script Studio Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "WhatsappTray" +#define MyAppVersion "1.3.1" +#define MyAppURL "https://github.com/D4koon/WhatsappTray" +#define MyAppExeName "WhatsappTray.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{1237D679-445B-4101-B7EC-B5081C5FA4A3} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={pf}\{#MyAppName} +DefaultGroupName={#MyAppName} +OutputBaseFilename=WhatsappTrayV1.3.1 +Compression=lzma +SolidCompression=yes + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "WhatsappTray\x64\Release\WhatsappTray.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "WhatsappTray\x64\Release\Hook.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "README.md"; DestDir: "{app}"; Flags: ignoreversion +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent