Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
add color depth check
Browse files Browse the repository at this point in the history
  • Loading branch information
mq1n committed Jun 27, 2021
1 parent c802345 commit 647eb2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,16 @@ int main(int, char* argv[])
return TRUE;
}

const auto nColorDepth = GetDeviceCaps(hdcMonitor, BITSPIXEL) * GetDeviceCaps(hdcMonitor, PLANES);

std::cout <<
"\tMonitor: " << s_nIdx <<
" Primary: " << bool(monInfo.dwFlags & MONITORINFOF_PRIMARY) <<
" Color depth: " << nColorDepth <<
" Resolution: " << monInfo.rcMonitor.right << "x" << monInfo.rcMonitor.bottom <<
std::endl;

if (monInfo.rcMonitor.right > 1366 && monInfo.rcMonitor.bottom > 768)
if (monInfo.rcMonitor.right > 1366 && monInfo.rcMonitor.bottom > 768 && nColorDepth >= 8)
{
*pbHasAvailableMonitor = TRUE;
return TRUE;
Expand Down

0 comments on commit 647eb2d

Please sign in to comment.