#pragma once #include #include #include #include #include #include struct memUsage { DWORDLONG totalPhys = 0, availPhys = 0, usedPhys = 0; DWORDLONG totalVir = 0, availVir = 0, usedVir = 0; DWORDLONG totalMem = 0, availMem = 0, usedMem = 0; double usedPhysPercent = 0, usedVirPercent = 0, usedMemPercent = 0; }; bool disableConsoleSelection(); bool enableConsoleSelection(); bool isWindowsTerminalHost(); void bindCrtToConsoleIO(); bool ensureNoSelectionConsole(bool detachWhenWT = true); void DisableComPort(const char* portName); void EnableComPort(const char* portName); bool isRunAsAdmin(); void restartAsAdmin(); QString getShortcutTarget(const QString& shortcutPath); QIcon getFileIcon(const QString& filePath, const QSize& size); bool restartProgram(bool asAdmin = false, bool exitCurrent = true, int delayMs = 0, const std::vector& extraArgs = {}); memUsage getMemUsage(); std::wstring getQuotedExePath(); bool setRegString(HKEY hKeyRoot, const std::wstring& subKey, const std::wstring& valueName, const std::wstring& value); bool deleteRegKeyRecursive(HKEY hKeyRoot, const std::wstring& subKey); bool registerProgId(); bool unregisterProgId(); bool associateExtension(const std::wstring& ext); bool disassociateExtension(const std::wstring& ext); bool setAsDefaultImageViewer(); bool unsetDefaultImageViewer(); bool isDefaultImageViewer();