]> repos.lx-s.de Git - winmute.git/commitdiff
#26 started translation table
authorlx-s <lx-s@users.noreply.github.com>
Thu, 2 Nov 2023 09:00:42 +0000 (10:00 +0100)
committerlx-s <lx-s@users.noreply.github.com>
Thu, 2 Nov 2023 09:00:42 +0000 (10:00 +0100)
Translations/strings.ods [new file with mode: 0644]
WinMute/WinMain.cpp

diff --git a/Translations/strings.ods b/Translations/strings.ods
new file mode 100644 (file)
index 0000000..e460ca7
Binary files /dev/null and b/Translations/strings.ods differ
index 6b7b566d90034a0d7d6d260e801ece552946fb34..80615e8c60636a200781ee3eec8f6c5854188219 100644 (file)
@@ -83,7 +83,8 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance,
       return FALSE;
    } else if (GetLastError() == ERROR_ALREADY_EXISTS) {
       ReleaseMutex(hMutex);
-      TaskDialog(nullptr,
+      TaskDialog(
+         nullptr,
          nullptr,
          PROGRAM_NAME,
          L"WinMute is already running",
@@ -101,31 +102,30 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance,
 
    HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
 
-   // <Init Common Controls>
    INITCOMMONCONTROLSEX initComCtrl;
    initComCtrl.dwSize = sizeof(INITCOMMONCONTROLSEX);
    initComCtrl.dwICC = ICC_LINK_CLASS;
    if (InitCommonControlsEx(&initComCtrl) == FALSE) {
-      TaskDialog(nullptr,
+      TaskDialog(
+         nullptr,
          nullptr,
          PROGRAM_NAME,
-         L"Failed to register extended window controls.",
-         L"Please try to restart the program.",
+         L"Failed to start WinMute.",
+         L"WinMute encountered a critical error while initializing and must shut down.",
          TDCBF_OK_BUTTON,
          TD_ERROR_ICON,
          nullptr);
+      WMLog::GetInstance().WriteWindowsError(L"InitCommonControlsEx", GetLastError());
       ReleaseMutex(hMutex);
       return FALSE;
-   }
-   // </Init Common Controls>
-
-   // <Init COM>
-   if (CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED) != S_OK) {
-      TaskDialog(nullptr,
+   } else if (CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED) != S_OK) {
+      WMLog::GetInstance().WriteWindowsError(L"CoInitializeEx", GetLastError());
+      TaskDialog(
+         nullptr,
          nullptr,
          PROGRAM_NAME,
-         L"Failed to initialize COM library.",
-         L"Please try to restart the program.",
+         L"Failed to start WinMute.",
+         L"WinMute encountered a critical error while initializing and must shut down.",
          TDCBF_OK_BUTTON,
          TD_ERROR_ICON,
          nullptr);