[RAPPS] application-view refactor (#3003)

* [RAPPS] separate application-view from gui.cpp
* [RAPPS] make the code looks more clear
* [RAPPS] fix &  improve tab-order handle
* [RAPPS] now double-click / right-click & install an item will install exactly this app
* [RAPPS] add handling for DWORD timestamp for InstallDate
* [RAPPS] make the code setting column style more clear
* [RAPPS] change the owner of popup-menu
* [RAPPS] now the popup menu (the one when right-click listview) now belongs to application-view
This commit is contained in:
He Yang 2020-07-24 16:07:43 +08:00 committed by Mark Jansen
parent 10c0ff7416
commit e44c9b6630
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
11 changed files with 3257 additions and 2741 deletions

View file

@ -486,3 +486,40 @@ BOOL IsSystem64Bit()
bIsSys64ResultCached = TRUE; // next time calling this function, it will directly return bIsSys64Result
return bIsSys64Result;
}
INT GetSystemColorDepth()
{
DEVMODEW pDevMode;
INT ColorDepth;
pDevMode.dmSize = sizeof(pDevMode);
pDevMode.dmDriverExtra = 0;
if (!EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &pDevMode))
{
/* TODO: Error message */
return ILC_COLOR;
}
switch (pDevMode.dmBitsPerPel)
{
case 32: ColorDepth = ILC_COLOR32; break;
case 24: ColorDepth = ILC_COLOR24; break;
case 16: ColorDepth = ILC_COLOR16; break;
case 8: ColorDepth = ILC_COLOR8; break;
case 4: ColorDepth = ILC_COLOR4; break;
default: ColorDepth = ILC_COLOR; break;
}
return ColorDepth;
}
void UnixTimeToFileTime(DWORD dwUnixTime, LPFILETIME pFileTime)
{
// Note that LONGLONG is a 64-bit value
LONGLONG ll;
ll = Int32x32To64(dwUnixTime, 10000000) + 116444736000000000;
pFileTime->dwLowDateTime = (DWORD)ll;
pFileTime->dwHighDateTime = ll >> 32;
}