From f86cf1bdc3a44dcb48c928c5ac4996ad2dfc5773 Mon Sep 17 00:00:00 2001 From: d4koon Date: Sat, 14 Nov 2020 19:28:49 +0100 Subject: [PATCH] Cleanup Shorten the gnu gpl licence-texts Use macro for logging in WhatsappTray.cpp Move logging functions in hook in seperate class --- WhatsappTray/AboutDialog.cpp | 22 +----- WhatsappTray/AboutDialog.h | 22 +----- WhatsappTray/AppData.cpp | 23 +------ WhatsappTray/AppData.h | 22 +----- WhatsappTray/Helper.cpp | 22 +----- WhatsappTray/Helper.h | 22 +----- WhatsappTray/Hook.cpp | 56 ++-------------- WhatsappTray/Hook.vcxproj | 2 + WhatsappTray/Hook.vcxproj.filters | 6 ++ WhatsappTray/Logger.cpp | 47 ++++--------- WhatsappTray/Logger.h | 27 ++------ WhatsappTray/Registry.cpp | 22 +----- WhatsappTray/Registry.h | 22 +----- WhatsappTray/SharedDefines.h | 22 +----- WhatsappTray/TrayManager.cpp | 22 +----- WhatsappTray/TrayManager.h | 22 +----- WhatsappTray/WhatsAppApi.cpp | 22 +----- WhatsappTray/WhatsAppApi.h | 22 +----- WhatsappTray/WhatsappTray.cpp | 108 +++++++++++++----------------- WhatsappTray/WinSockClient.cpp | 4 +- WhatsappTray/WinSockClient.h | 4 +- WhatsappTray/WinSockLogger.cpp | 26 +++++++ WhatsappTray/WinSockLogger.h | 19 ++++++ WhatsappTray/WinSockServer.cpp | 6 +- WhatsappTray/WinSockServer.h | 4 +- 25 files changed, 161 insertions(+), 435 deletions(-) create mode 100644 WhatsappTray/WinSockLogger.cpp create mode 100644 WhatsappTray/WinSockLogger.h diff --git a/WhatsappTray/AboutDialog.cpp b/WhatsappTray/AboutDialog.cpp index 5918748..25a1b79 100644 --- a/WhatsappTray/AboutDialog.cpp +++ b/WhatsappTray/AboutDialog.cpp @@ -1,23 +1,5 @@ -/* - * - * WhatsappTray - * Copyright (C) 1998-2018 Sebastian Amann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #include "stdafx.h" diff --git a/WhatsappTray/AboutDialog.h b/WhatsappTray/AboutDialog.h index 2d44db5..cb0e65b 100644 --- a/WhatsappTray/AboutDialog.h +++ b/WhatsappTray/AboutDialog.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #pragma once diff --git a/WhatsappTray/AppData.cpp b/WhatsappTray/AppData.cpp index 0277208..88c3699 100644 --- a/WhatsappTray/AppData.cpp +++ b/WhatsappTray/AppData.cpp @@ -1,23 +1,6 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2017 Sebastian Amann, Nikolay Redko, J.D. Purcell -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2018 - 2018 WhatsappTray Sebastian Amann */ + #include "stdafx.h" #include "AppData.h" diff --git a/WhatsappTray/AppData.h b/WhatsappTray/AppData.h index 2c29972..7054f03 100644 --- a/WhatsappTray/AppData.h +++ b/WhatsappTray/AppData.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2017 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2019 - 2020 WhatsappTray Sebastian Amann */ #pragma once #include "Enum.h" diff --git a/WhatsappTray/Helper.cpp b/WhatsappTray/Helper.cpp index c84474a..a18934d 100644 --- a/WhatsappTray/Helper.cpp +++ b/WhatsappTray/Helper.cpp @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #include "stdafx.h" #include "Helper.h" diff --git a/WhatsappTray/Helper.h b/WhatsappTray/Helper.h index a3c22c0..9e8100d 100644 --- a/WhatsappTray/Helper.h +++ b/WhatsappTray/Helper.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #pragma once diff --git a/WhatsappTray/Hook.cpp b/WhatsappTray/Hook.cpp index 6d0fd4c..600d1a2 100644 --- a/WhatsappTray/Hook.cpp +++ b/WhatsappTray/Hook.cpp @@ -1,31 +1,13 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2017 Sebastian Amann, Nikolay Redko, J.D. Purcell -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2017 WhatsappTray Sebastian Amann */ #include "SharedDefines.h" #include "WindowsMessage.h" -#include "WinSockClient.h" +#include "WinSockLogger.h" -#include #include #include +#include #include // OpenProcess() //#include // For dpi-scaling stuff @@ -75,13 +57,9 @@ static std::string WideToUtf8(const std::wstring& inputString); static std::string GetEnviromentVariable(const std::string& inputString); static POINT LParamToPoint(LPARAM lParam); static bool SendMessageToWhatsappTray(UINT message, WPARAM wParam = 0, LPARAM lParam = 0); -static void TraceString(std::string traceString); -static void TraceStream(std::ostringstream& traceBuffer); static void StartInitThread(); -#define LogString(logString, ...) TraceString(MODULE_NAME + std::string("::") + std::string(__func__) + ": " + string_format(logString, __VA_ARGS__)) - /** * @brief The entry point for the dll * @@ -183,7 +161,7 @@ static LRESULT APIENTRY RedirectedWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, L traceBuffer << "windowTitle='" << GetWindowTitle(hwnd) << "' "; traceBuffer << "hwnd=0x'" << std::uppercase << std::hex << hwnd << "' "; traceBuffer << "wParam=0x'" << std::uppercase << std::hex << wParam << "' "; - TraceStream(traceBuffer); + WinSockLogger::TraceStream(traceBuffer); } #endif @@ -447,28 +425,6 @@ static bool SendMessageToWhatsappTray(UINT message, WPARAM wParam, LPARAM lParam return PostMessage(FindWindow(NAME, NAME), message, wParam, lParam); } -static void TraceString(std::string traceString) -{ - SocketSendMessage(traceString.c_str()); - -//#ifdef _DEBUG -// OutputDebugStringA(traceString.c_str()); -//#endif -} - -static void TraceStream(std::ostringstream& traceBuffer) -{ - SocketSendMessage(traceBuffer.str().c_str()); - traceBuffer.clear(); - traceBuffer.str(std::string()); - -//#ifdef _DEBUG -// OutputDebugStringA(traceBuffer.str().c_str()); -// traceBuffer.clear(); -// traceBuffer.str(std::string()); -//#endif -} - /** * @brief Starts the hook-init in an seperate thread * @@ -489,7 +445,7 @@ void StartInitThread() // Check the return value for success. if (threadHandle == NULL) { - //OutputDebugStringA("Thread could not be created in Hook init-function-starter"); + MessageBox(NULL, "Hook.dll::StartInitThread: Thread could not be created.", "WhatsappTray (Hook.dll)", MB_OK); } // Close thread handle. NOTE(SAM): For now i do not clean up the thread handle because it shouldn't be such a big deal... diff --git a/WhatsappTray/Hook.vcxproj b/WhatsappTray/Hook.vcxproj index e8acb8c..f20ff52 100644 --- a/WhatsappTray/Hook.vcxproj +++ b/WhatsappTray/Hook.vcxproj @@ -110,10 +110,12 @@ + + diff --git a/WhatsappTray/Hook.vcxproj.filters b/WhatsappTray/Hook.vcxproj.filters index 409c8f7..0bd6470 100644 --- a/WhatsappTray/Hook.vcxproj.filters +++ b/WhatsappTray/Hook.vcxproj.filters @@ -13,6 +13,9 @@ Files + + Files + @@ -21,5 +24,8 @@ Files + + Files + \ No newline at end of file diff --git a/WhatsappTray/Logger.cpp b/WhatsappTray/Logger.cpp index c68836c..641a8ba 100644 --- a/WhatsappTray/Logger.cpp +++ b/WhatsappTray/Logger.cpp @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #include "stdafx.h" #include "Logger.h" @@ -90,7 +72,7 @@ bool Logger::App(std::string text, ...) { va_list argptr; va_start(argptr, text); - bool returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); + auto returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); va_end(argptr); return returnValue; } @@ -98,7 +80,7 @@ bool Logger::Fatal(std::string text, ...) { va_list argptr; va_start(argptr, text); - bool returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); + auto returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); va_end(argptr); return returnValue; } @@ -106,7 +88,7 @@ bool Logger::Error(std::string text, ...) { va_list argptr; va_start(argptr, text); - bool returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); + auto returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); va_end(argptr); return returnValue; } @@ -114,7 +96,7 @@ bool Logger::Warning(std::string text, ...) { va_list argptr; va_start(argptr, text); - bool returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); + auto returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); va_end(argptr); return returnValue; } @@ -122,7 +104,7 @@ bool Logger::Info(std::string text, ...) { va_list argptr; va_start(argptr, text); - bool returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); + auto returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); va_end(argptr); return returnValue; } @@ -130,30 +112,26 @@ bool Logger::Debug(std::string text, ...) { va_list argptr; va_start(argptr, text); - bool returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); + auto returnValue = LogVariadic(Loglevel::LOG_APP, text + "\n", argptr); va_end(argptr); return returnValue; } bool Logger::LogLine(Loglevel loglevel, std::string text, ...) { - bool returnvalue = false; - va_list argptr; va_start(argptr, text); - LogVariadic(loglevel, text + "\n", argptr); + auto returnValue = LogVariadic(loglevel, text + "\n", argptr); va_end(argptr); - return returnvalue; + return returnValue; } bool Logger::Log(Loglevel loglevel, std::string text, ...) { - bool returnvalue = false; - va_list argptr; va_start(argptr, text); - LogVariadic(loglevel, text, argptr); + auto returnvalue = LogVariadic(loglevel, text, argptr); va_end(argptr); return returnvalue; @@ -162,9 +140,8 @@ bool Logger::Log(Loglevel loglevel, std::string text, ...) bool Logger::LogVariadic(Loglevel loglevel, std::string logFormatString, va_list argptr) { const size_t buffersize = 5000; - int count = 0; char logStringBuffer[buffersize]; - count = vsnprintf(logStringBuffer, buffersize, logFormatString.c_str(), argptr); + auto count = vsnprintf(logStringBuffer, buffersize, logFormatString.c_str(), argptr); if (count > buffersize) { OutputDebugStringA("Error: The buffer was to small for the logstring. It has to be adusted in the code if that happens."); diff --git a/WhatsappTray/Logger.h b/WhatsappTray/Logger.h index 0b5177a..3adb783 100644 --- a/WhatsappTray/Logger.h +++ b/WhatsappTray/Logger.h @@ -1,28 +1,13 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #pragma once #include #include +#define LogInfo(logString, ...) Logger::Info(MODULE_NAME + std::string("::") + std::string(__func__) + ": " + string_format(logString, __VA_ARGS__)) +#define LogError(logString, ...) Logger::Error(MODULE_NAME + std::string("::") + std::string(__func__) + ": " + string_format(logString, __VA_ARGS__)) + enum class Loglevel { LOG_NONE, @@ -43,7 +28,6 @@ class Logger static std::ofstream logFile; bool Log(Loglevel loglevel, std::string text, ...); - bool LogLine(Loglevel loglevel, std::string text, ...); static bool LogVariadic(Loglevel loglevel, std::string text, va_list vadriaicList); static void ProcessLog(const Loglevel loglevel, const char* logTextBuffer); static std::string GetTimeString(const char* formatString, bool withMilliseconds = false); @@ -59,4 +43,5 @@ class Logger static bool Warning(std::string text, ...); static bool Info(std::string text, ...); static bool Debug(std::string text, ...); + static bool LogLine(Loglevel loglevel, std::string text, ...); }; diff --git a/WhatsappTray/Registry.cpp b/WhatsappTray/Registry.cpp index 98b4e53..a7fed40 100644 --- a/WhatsappTray/Registry.cpp +++ b/WhatsappTray/Registry.cpp @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #include "stdafx.h" diff --git a/WhatsappTray/Registry.h b/WhatsappTray/Registry.h index a1bb6a6..18ad4c6 100644 --- a/WhatsappTray/Registry.h +++ b/WhatsappTray/Registry.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #pragma once diff --git a/WhatsappTray/SharedDefines.h b/WhatsappTray/SharedDefines.h index cea84f8..ab56cee 100644 --- a/WhatsappTray/SharedDefines.h +++ b/WhatsappTray/SharedDefines.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #pragma once diff --git a/WhatsappTray/TrayManager.cpp b/WhatsappTray/TrayManager.cpp index d3bd45a..e81f88a 100644 --- a/WhatsappTray/TrayManager.cpp +++ b/WhatsappTray/TrayManager.cpp @@ -1,23 +1,5 @@ -/* - * - * WhatsappTray - * Copyright (C) 1998-2018 Sebastian Amann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #include "stdafx.h" diff --git a/WhatsappTray/TrayManager.h b/WhatsappTray/TrayManager.h index 8b9df75..ad417cd 100644 --- a/WhatsappTray/TrayManager.h +++ b/WhatsappTray/TrayManager.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #pragma once diff --git a/WhatsappTray/WhatsAppApi.cpp b/WhatsappTray/WhatsAppApi.cpp index 9b6f471..46dd10b 100644 --- a/WhatsappTray/WhatsAppApi.cpp +++ b/WhatsappTray/WhatsAppApi.cpp @@ -1,23 +1,5 @@ -/* - * - * WhatsappTray - * Copyright (C) 1998-2018 Sebastian Amann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2018 WhatsappTray Sebastian Amann */ #include "stdafx.h" diff --git a/WhatsappTray/WhatsAppApi.h b/WhatsappTray/WhatsAppApi.h index 48c1298..d0a9627 100644 --- a/WhatsappTray/WhatsAppApi.h +++ b/WhatsappTray/WhatsAppApi.h @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2018 Sebastian Amann -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ #pragma once diff --git a/WhatsappTray/WhatsappTray.cpp b/WhatsappTray/WhatsappTray.cpp index 1c81de2..7182b83 100644 --- a/WhatsappTray/WhatsappTray.cpp +++ b/WhatsappTray/WhatsappTray.cpp @@ -1,23 +1,5 @@ -/* -* -* WhatsappTray -* Copyright (C) 1998-2017 Sebastian Amann, Nikolay Redko, J.D. Purcell -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 1998 - 2017 WhatsappTray Sebastian Amann */ #include "stdafx.h" #include "WhatsappTray.h" @@ -72,7 +54,7 @@ static bool CreateWhatsappTrayWindow(); static void ExecuteMenu(); static bool SetHook(); static void UnRegisterHook(); -static void SetLaunchOnWindowsStartupSetting(bool value); +static void SetLaunchOnWindowsStartupSetting(const bool value); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { @@ -83,8 +65,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // For reading data from *.lnk files (shortcut files). See Helper::ResolveLnk() CoInitialize(nullptr); - Logger::Info(MODULE_NAME "::WinMain(): Starting WhatsappTray %s in %s CompileConfiguration.", Helper::GetProductAndVersion().c_str(), CompileConfiguration); - Logger::Info(MODULE_NAME "::WinMain(): CloseToTray=%d.", static_cast(AppData::CloseToTray.Get())); + LogInfo("Starting WhatsappTray %s in %s CompileConfiguration.", Helper::GetProductAndVersion().c_str(), CompileConfiguration); + LogInfo("CloseToTray=%d.", static_cast(AppData::CloseToTray.Get())); // Initialize WinSock-server, which is used to send log-messages from WhatsApp-hook to WhatsappTray SocketNotifyOnNewMessage([](std::string message) { @@ -128,7 +110,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { static UINT s_uTaskbarRestart; - //Logger::Info(MODULE_NAME "::WndProc() - Message Received msg='0x%X'", msg); + //LogInfo("Message Received msg='0x%X'", msg); switch (msg) { case WM_CREATE: { @@ -185,11 +167,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara AppData::ShowUnreadMessages.Set(!AppData::ShowUnreadMessages.Get()); } break; case IDM_RESTORE: { - Logger::Info(MODULE_NAME "::WndProc() - IDM_RESTORE"); + LogInfo("IDM_RESTORE"); _trayManager->RestoreWindowFromTray(_hwndWhatsapp); } break; case IDM_CLOSE: { - Logger::Info(MODULE_NAME "::WndProc() - IDM_CLOSE"); + LogInfo("IDM_CLOSE"); _trayManager->CloseWindowFromTray(_hwndWhatsapp); // Close WhatsappTray @@ -198,28 +180,28 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } } break; case WM_WA_MINIMIZE_BUTTON_PRESSED: { - Logger::Info(MODULE_NAME "::WndProc() - WM_WA_MINIMIZE_BUTTON_PRESSED"); + LogInfo("WM_WA_MINIMIZE_BUTTON_PRESSED"); if (AppData::CloseToTray.Get() == true) { - Logger::Info(MODULE_NAME "::WndProc() - Close to tray is true => Minimize WhatsApp to taskbar."); + LogInfo("Close to tray is true => Minimize WhatsApp to taskbar."); } else { - Logger::Info(MODULE_NAME "::WndProc() - Close to tray is false => Minimize WhatsApp to tray."); + LogInfo("Close to tray is false => Minimize WhatsApp to tray."); _trayManager->MinimizeWindowToTray(_hwndWhatsapp); } } break; case WM_WA_CLOSE_BUTTON_PRESSED: { - Logger::Info(MODULE_NAME "::WndProc() - WM_WA_CLOSE_BUTTON_PRESSED"); + LogInfo("WM_WA_CLOSE_BUTTON_PRESSED"); if (AppData::CloseToTray.Get() == true) { - Logger::Info(MODULE_NAME "::WndProc() - Close to tray is true => Minimize WhatsApp to tray."); + LogInfo("Close to tray is true => Minimize WhatsApp to tray."); _trayManager->MinimizeWindowToTray(_hwndWhatsapp); } else { - Logger::Info(MODULE_NAME "::WndProc() - Close to tray is false => Close WhatsApp and WhatsappTray."); + LogInfo("Close to tray is false => Close WhatsApp and WhatsappTray."); _trayManager->CloseWindowFromTray(_hwndWhatsapp); } } break; case WM_WA_KEY_PRESSED: { - Logger::Info(MODULE_NAME "::WndProc() - WM_WA_KEY_PRESSED wParam=%d", wParam); + LogInfo("WM_WA_KEY_PRESSED wParam=%d", wParam); if (wParam == 27) { // Esc-key was pressed @@ -227,14 +209,14 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } } break; case WM_WHAHTSAPP_CLOSING: { - Logger::Info(MODULE_NAME "::WndProc() - WM_WHAHTSAPP_CLOSING"); + LogInfo("WM_WHAHTSAPP_CLOSING"); // Whatsapp is closing // Close WhatsappTray SendMessage(_hwndWhatsappTray, WM_CLOSE, 0, 0); } break; case WM_WHATSAPP_TO_WHATSAPPTRAY_RECEIVED_WM_CLOSE: { - Logger::Info(MODULE_NAME "::" + std::string(__func__) + "() - WM_WHATSAPP_TO_WHATSAPPTRAY_RECEIVED_WM_CLOSE received"); + LogInfo("WM_WHATSAPP_TO_WHATSAPPTRAY_RECEIVED_WM_CLOSE received"); // This message means that WhatsApp received a WM_CLOSE-message. // This happens when Alt + F4 is pressed. @@ -247,12 +229,12 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara // NOTE: WM_WHATSAPPTRAY_TO_WHATSAPP_SEND_WM_CLOSE is a special message i made because WM_CLOSE is always blocked by the hook. PostMessage(_hwndWhatsapp, WM_WHATSAPPTRAY_TO_WHATSAPP_SEND_WM_CLOSE, 0, 0); - Logger::Info(MODULE_NAME "::WndProc() - WM_WHATSAPPTRAY_TO_WHATSAPP_SEND_WM_CLOSE sent"); + LogInfo("WM_WHATSAPPTRAY_TO_WHATSAPP_SEND_WM_CLOSE sent"); } } break; case WM_DESTROY: { - Logger::Info(MODULE_NAME "::WndProc() - WM_DESTROY"); + LogInfo("WM_DESTROY"); if (_trayManager != NULL) { _trayManager->RestoreAllWindowsFromTray(); @@ -269,11 +251,11 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara _winsockThread.join(); PostQuitMessage(0); - Logger::Info(MODULE_NAME "::WndProc() - QuitMessage posted."); + LogInfo("QuitMessage posted."); } break; case WM_WHATSAPP_API_NEW_MESSAGE: { - Logger::Info(MODULE_NAME "::WndProc() - WM_WHATSAPP_API_NEW_MESSAGE"); + LogInfo("WM_WHATSAPP_API_NEW_MESSAGE"); _messagesSinceMinimize++; if (AppData::ShowUnreadMessages.Get()) { @@ -303,10 +285,10 @@ static bool InitWhatsappTray() SetLaunchOnWindowsStartupSetting(AppData::LaunchOnWindowsStartup.Get()); if (AppData::StartMinimized.Get()) { - Logger::Info(MODULE_NAME "::WinMain() - Prepare for starting minimized."); + LogInfo("Prepare for starting minimized."); WhatsAppApi::NotifyOnFullInit([]() { - Logger::Info(MODULE_NAME "::WinMain() - NotifyOnFullInit"); + LogInfo("NotifyOnFullInit"); Sleep(2000); _trayManager->MinimizeWindowToTray(_hwndWhatsapp); // Remove event after the first execution @@ -325,7 +307,7 @@ static bool InitWhatsappTray() _trayManager->RegisterWindow(_hwndWhatsapp); if (SetHook() == false) { - Logger::Error(MODULE_NAME "::WinMain() - Error setting hook."); + LogError("Error setting hook."); return false; } @@ -346,7 +328,7 @@ static HWND StartWhatsapp() fs::path appPath = Helper::GetApplicationFilePath(); auto combinedPath = appPath / waStartPath; - Logger::Info(MODULE_NAME "::StartWhatsapp() - Starting WhatsApp from combinedPath:%s", combinedPath.string().c_str()); + LogInfo("Starting WhatsApp from combinedPath:%s", combinedPath.string().c_str()); // Shorten the path by converting to absoltue path. auto combinedPathCanonical = fs::canonical(combinedPath); @@ -355,13 +337,13 @@ static HWND StartWhatsapp() waStartPathString = waStartPath.string(); } - Logger::Info(MODULE_NAME "::StartWhatsapp() - Starting WhatsApp from canonical-path:'" + waStartPathString + "'"); + LogInfo("Starting WhatsApp from canonical-path:'" + waStartPathString + "'"); auto waStartPathStringExtension = waStartPathString.substr(waStartPathString.size() - 3); if (waStartPathStringExtension.compare("lnk") == 0) { waStartPathString = Helper::ResolveLnk(_hwndWhatsappTray, waStartPathString.c_str()); - Logger::Info(MODULE_NAME "::StartWhatsapp() - Resolved .lnk (Shortcut) to:'" + waStartPathString + "'"); + LogInfo("Resolved .lnk (Shortcut) to:'" + waStartPathString + "'"); } STARTUPINFO si; @@ -387,7 +369,7 @@ static HWND StartWhatsapp() &pi) // Pointer to PROCESS_INFORMATION structure ) { - Logger::Info(MODULE_NAME "::StartWhatsapp() - CreateProcess failed(%d).", GetLastError()); + LogInfo("CreateProcess failed(%d).", GetLastError()); return nullptr; } @@ -395,7 +377,7 @@ static HWND StartWhatsapp() auto result = WaitForInputIdle(pi.hProcess, 10000); if (result != 0) { - Logger::Info(MODULE_NAME "::StartWhatsapp() - WaitForInputIdle failed."); + LogInfo("WaitForInputIdle failed."); return nullptr; } @@ -412,11 +394,11 @@ static HWND StartWhatsapp() MessageBoxA(NULL, "WhatsApp-Window not found.", "WhatsappTray", MB_OK | MB_ICONERROR); return nullptr; } - Logger::Info(MODULE_NAME "::StartWhatsapp() - WhatsApp-Window not found. Wait 500ms and retry."); + LogInfo("WhatsApp-Window not found. Wait 500ms and retry."); Sleep(500); } - Logger::Info(MODULE_NAME "::StartWhatsapp() - WhatsApp-Window found."); + LogInfo("WhatsApp-Window found."); return _hwndWhatsapp; } @@ -438,19 +420,19 @@ static HWND FindWhatsapp() } auto windowTitle = Helper::GetWindowTitle(iteratedHwnd); - Logger::Info(MODULE_NAME "::FindWhatsapp() - Found window with title: '%s' hwnd=0x%08X", windowTitle.c_str(), reinterpret_cast(iteratedHwnd)); + LogInfo("Found window with title: '%s' hwnd=0x%08X", windowTitle.c_str(), reinterpret_cast(iteratedHwnd)); // It looks like as if the 'Whatsapp Voip'-window is first named 'Whatsapp' when Whatsapp is started and then changed shortly after to 'Whatsapp Voip'. // Because of that it can happen that the wrong window is set. // To prevent that it is checked if the window is visible because 'Whatsapp Voip'-window seems to be always hidden. NOTE: I Could also always check the window later before i use it... if (IsWindowVisible(iteratedHwnd) == false) { - Logger::Info(MODULE_NAME "::FindWhatsapp() - Window is not visible"); + LogInfo("Window is not visible"); continue; } // Also check length because compare also matches strings that are longer like 'WhatsApp Voip'. Not sure if that is true but i leave it for now... if (windowTitle.compare(WHATSAPP_CLIENT_NAME) != 0 && windowTitle.length() == strlen(WHATSAPP_CLIENT_NAME)) { - Logger::Info(MODULE_NAME "::FindWhatsapp() - Window name does not match"); + LogInfo("Window name does not match"); continue; } @@ -459,7 +441,7 @@ static HWND FindWhatsapp() auto filepath = Helper::GetFilepathFromProcessID(processId); - Logger::Info(MODULE_NAME "::FindWhatsapp() - Filepath is: '%s'", filepath.c_str()); + LogInfo("Filepath is: '%s'", filepath.c_str()); std::wstring filenameFromWindow = Helper::GetFilenameFromPath(Helper::Utf8ToWide(filepath)); std::wstring whatsappStartpathWide = Helper::Utf8ToWide(AppData::WhatsappStartpathGet()); @@ -468,11 +450,11 @@ static HWND FindWhatsapp() // NOTE: I do not compare the extension because when i start from an link, the name is WhatsApp.lnk whicht does not match the WhatsApp.exe // This could be improved by reading the real value from the .lnk but i think this should be fine for now. if (filenameFromWindow.compare(filenameFromSettings) != 0) { - Logger::Error(MODULE_NAME "::FindWhatsapp() - Filenames from window and from settings do not match."); + LogError("Filenames from window and from settings do not match."); continue; } - Logger::Info(MODULE_NAME "::FindWhatsapp() - Found match"); + LogInfo("Found match"); break; } @@ -488,8 +470,8 @@ static void TryClosePreviousWhatsappTrayInstance() // NOTE: This also matches the class-name of the window so we can be sure its our window and not for example an explorer-window with this name. _hwndWhatsappTray = FindWindow(NAME, NAME); if (_hwndWhatsappTray) { - Logger::Error(MODULE_NAME "::WinMain() - Found an already open instance of WhatsappTray. Trying to close the other instance."); - Logger::Error(MODULE_NAME "::WinMain() - If this error persists, try to close the other instance by hand using for example the taskmanager."); + LogError("Found an already open instance of WhatsappTray. Trying to close the other instance."); + LogError("If this error persists, try to close the other instance by hand using for example the taskmanager."); //if (strstr(lpCmdLine, "--exit")) { SendMessage(_hwndWhatsappTray, WM_CLOSE, 0, 0); @@ -538,7 +520,7 @@ static void ExecuteMenu() { HMENU hMenu = CreatePopupMenu(); if (!hMenu) { - Logger::Error(MODULE_NAME "::ExecuteMenu() - Error creating menu."); + LogError("Error creating menu."); MessageBox(NULL, "Error creating menu.", "WhatsappTray", MB_OK | MB_ICONERROR); return; } @@ -591,7 +573,7 @@ static void ExecuteMenu() static bool SetHook() { - Logger::Info(MODULE_NAME "::SetHook()"); + LogInfo("SetHook()"); // Damit nicht alle Prozesse gehookt werde, verwende ich jetzt die ThreadID des WhatsApp-Clients. DWORD processId; @@ -609,7 +591,7 @@ static bool SetHook() _putenv_s(WHATSAPPTRAY_LOAD_LIBRARY_TEST_ENV_VAR, WHATSAPPTRAY_LOAD_LIBRARY_TEST_ENV_VAR_VALUE); _hLib = LoadLibrary("Hook.dll"); if (_hLib == NULL) { - Logger::Error(MODULE_NAME "::SetHook() Error loading Hook.dll"); + LogError("Error loading Hook.dll"); MessageBox(NULL, MODULE_NAME "::SetHook() Error loading Hook.dll", "WhatsappTray", MB_OK | MB_ICONERROR); return false; } @@ -618,13 +600,13 @@ static bool SetHook() // NOTE: To see if the functions are visible use 'dumpbin /EXPORTS \Hook.dll' in the debugger-console auto CallWndRetProc = (HOOKPROC)GetProcAddress(_hLib, "CallWndRetProc"); if (CallWndRetProc == NULL) { - Logger::Error(MODULE_NAME "::SetHook() The function 'CallWndRetProc' was not found"); + LogError("The function 'CallWndRetProc' was not found"); return false; } _hWndProc = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC)CallWndRetProc, _hLib, threadId); if (_hWndProc == NULL) { - Logger::Error(MODULE_NAME "::SetHook() Error Creation Hook _hWndProc"); + LogError("Error Creation Hook _hWndProc"); UnRegisterHook(); return false; } @@ -643,7 +625,7 @@ static void UnRegisterHook() /* * @brief Sets the 'launch on windows startup'-setting. */ -static void SetLaunchOnWindowsStartupSetting(bool value) +static void SetLaunchOnWindowsStartupSetting(const bool value) { AppData::LaunchOnWindowsStartup.Set(value); diff --git a/WhatsappTray/WinSockClient.cpp b/WhatsappTray/WinSockClient.cpp index 524ffaa..67ba0ee 100644 --- a/WhatsappTray/WinSockClient.cpp +++ b/WhatsappTray/WinSockClient.cpp @@ -1,5 +1,7 @@ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ + // WinSockClient implementation -// #include "WinSockClient.h" diff --git a/WhatsappTray/WinSockClient.h b/WhatsappTray/WinSockClient.h index b1ad2a3..3602a91 100644 --- a/WhatsappTray/WinSockClient.h +++ b/WhatsappTray/WinSockClient.h @@ -1,5 +1,7 @@ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ + // WinSockClient header -// #pragma once diff --git a/WhatsappTray/WinSockLogger.cpp b/WhatsappTray/WinSockLogger.cpp new file mode 100644 index 0000000..6c3ef19 --- /dev/null +++ b/WhatsappTray/WinSockLogger.cpp @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ + +#include "WinSockLogger.h" + +void WinSockLogger::TraceString(const std::string traceString) +{ + SocketSendMessage(traceString.c_str()); + + //#ifdef _DEBUG + // OutputDebugStringA(traceString.c_str()); + //#endif +} + +void WinSockLogger::TraceStream(std::ostringstream& traceBuffer) +{ + SocketSendMessage(traceBuffer.str().c_str()); + traceBuffer.clear(); + traceBuffer.str(std::string()); + + //#ifdef _DEBUG + // OutputDebugStringA(traceBuffer.str().c_str()); + // traceBuffer.clear(); + // traceBuffer.str(std::string()); + //#endif +} \ No newline at end of file diff --git a/WhatsappTray/WinSockLogger.h b/WhatsappTray/WinSockLogger.h new file mode 100644 index 0000000..2bab2a7 --- /dev/null +++ b/WhatsappTray/WinSockLogger.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ + +#pragma once + +#include "WinSockClient.h" + +#include +#include +#include + +#define LogString(logString, ...) WinSockLogger::TraceString(MODULE_NAME + std::string("::") + std::string(__func__) + ": " + string_format(logString, __VA_ARGS__)) + +class WinSockLogger +{ +public: + static void TraceString(const std::string traceString); + static void TraceStream(std::ostringstream& traceBuffer); +}; diff --git a/WhatsappTray/WinSockServer.cpp b/WhatsappTray/WinSockServer.cpp index 91ab525..4136751 100644 --- a/WhatsappTray/WinSockServer.cpp +++ b/WhatsappTray/WinSockServer.cpp @@ -1,5 +1,7 @@ -// WinSockServer.cpp : Defines the entry point for the application. -// +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ + +// Implementation for the WinSock server. #include "stdafx.h" #include "WinSockServer.h" diff --git a/WhatsappTray/WinSockServer.h b/WhatsappTray/WinSockServer.h index d3874c1..eb683e0 100644 --- a/WhatsappTray/WinSockServer.h +++ b/WhatsappTray/WinSockServer.h @@ -1,5 +1,5 @@ -// WinSockServer.h : Include file for standard system include files, -// or project specific include files. +/* SPDX-License-Identifier: GPL-3.0-only */ +/* Copyright(C) 2020 - 2020 WhatsappTray Sebastian Amann */ #pragma once