12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #pragma once
- #include "openmpt/all/BuildSettings.hpp"
- #include <string>
- OPENMPT_NAMESPACE_BEGIN
- bool CreateShellFolderLink(const mpt::PathString &path, const mpt::PathString &target, const mpt::ustring &description = mpt::ustring());
- bool CreateShellFileLink(const mpt::PathString &path, const mpt::PathString &target, const mpt::ustring &description = mpt::ustring());
- mpt::const_byte_span GetResource(LPCTSTR lpName, LPCTSTR lpType);
- CString LoadResourceString(UINT nID);
- namespace Util
- {
-
- MPT_FORCEINLINE int GetDPIx(HWND hwnd)
- {
- HDC dc = ::GetDC(hwnd);
- int dpi = ::GetDeviceCaps(dc, LOGPIXELSX);
- ::ReleaseDC(hwnd, dc);
- return dpi;
- }
-
- MPT_FORCEINLINE int GetDPIy(HWND hwnd)
- {
- HDC dc = ::GetDC(hwnd);
- int dpi = ::GetDeviceCaps(dc, LOGPIXELSY);
- ::ReleaseDC(hwnd, dc);
- return dpi;
- }
-
- MPT_FORCEINLINE int ScalePixels(int pixels, HWND hwnd)
- {
- return MulDiv(pixels, GetDPIx(hwnd), 96);
- }
-
- MPT_FORCEINLINE int ScalePixelsInv(int pixels, HWND hwnd)
- {
- return MulDiv(pixels, 96, GetDPIx(hwnd));
- }
- }
- namespace Util
- {
- inline DWORD64 GetTickCount64()
- {
- #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
- return ::GetTickCount64();
- #else
- return ::GetTickCount();
- #endif
- }
- }
- OPENMPT_NAMESPACE_END
|