1
2
3
4
5
6
7
8
if(SetWindowDisplayAffinity(hWnd, WDA_MONITOR)==false)
{
    wchar_t buf[256];
    FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
        buf, (sizeof(buf) / sizeof(wchar_t)), NULL);
    AfxMessageBox(buf);
}
Edit

Pub: 01 Dec 2020 16:34 UTC

Views: 180