diff --git a/WhatsappTray/Hook.cpp b/WhatsappTray/Hook.cpp index 13fdf69..20f59de 100644 --- a/WhatsappTray/Hook.cpp +++ b/WhatsappTray/Hook.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include // OpenProcess() #include // For ITaskbarList3 //#include // For dpi-scaling stuff @@ -201,6 +202,9 @@ DWORD WINAPI Init(LPVOID lpParam) return 5; } + // This is a good point to see if WhatsApp is fully initialized, because it sets the overlay-icon very late in the init-process. + std::async(&OnWhatsAppFullyInitialized); + return 0; } @@ -211,6 +215,8 @@ void OnWhatsAppFullyInitialized() { LogString("WhatsAppFullyInitialized"); + std::this_thread::sleep_for(std::chrono::seconds(5)); + // It is no longer necessary to block the ShowWindow()-function, so unblock it again... UnblockShowWindowFunction(); } @@ -889,8 +895,5 @@ HRESULT Rerouted_SetOverlayIcon() LogString("_setOverlayIconMemoryAddress=0x%llX", _setOverlayIconMemoryAddress); auto result = ((HRESULT(*)(ITaskbarList3*, HWND, HICON, LPCWSTR))_setOverlayIconMemoryAddress)(_pTaskbarList, hwnd, hIcon, NULL); - // This is a good point to see if WhatsApp is fully initialized, because it sets the overlay-icon very late in the init-process. - std::async(&OnWhatsAppFullyInitialized); - return result; } diff --git a/WhatsappTray/Version.rc2 b/WhatsappTray/Version.rc2 index 9442598..de714be 100644 --- a/WhatsappTray/Version.rc2 +++ b/WhatsappTray/Version.rc2 @@ -8,7 +8,7 @@ #define MAJOR 1 #define MINOR 9 #define PATCH 0 -#define IS_DEBUG 4 +#define IS_DEBUG 5 #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x)