tdesktop/Telegram/SourceFiles/platform/win/windows_app_user_model_id.h
2023-09-22 11:50:41 +04:00

49 lines
1.1 KiB
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/platform/win/base_windows_h.h"
namespace Platform {
namespace AppUserModelId {
void CleanupShortcut();
void CheckPinned();
[[nodiscard]] const std::wstring &Id();
bool ValidateShortcut();
[[nodiscard]] const PROPERTYKEY &Key();
[[nodiscard]] const std::wstring &MyExecutablePath();
struct UniqueFileId {
std::uint64_t part1 = 0;
std::uint64_t part2 = 0;
[[nodiscard]] bool valid() const {
return part1 || part2;
}
[[nodiscard]] explicit operator bool() const {
return valid();
}
[[nodiscard]] friend inline auto operator<=>(
UniqueFileId a,
UniqueFileId b) = default;
[[nodiscard]] friend inline bool operator==(
UniqueFileId a,
UniqueFileId b) = default;
};
[[nodiscard]] UniqueFileId GetUniqueFileId(LPCWSTR path);
[[nodiscard]] UniqueFileId MyExecutablePathId();
} // namespace AppUserModelId
} // namespace Platform