GetPixel()返回0

问题遇到的现象和发生背景

GetPixel函数一直返回0

用代码块功能插入代码,请勿粘贴截图
#include <Windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>

POINT mp;
COLORREF clr;
HWND hWnd;
HDC hdc;

int main(void)
{
    for(;;)
    {
        if(KEY_DOWN('Q'))
            SetCursorPos(200, 700);
        if(KEY_DOWN('W'))
        {
            hWnd = FindWindow(NULL, "无标题 - 画图");
            hdc = ::GetDC(hWnd);
            GetCursorPos(&mp);
            COLORREF clr = ::GetPixel(hdc, mp.x, mp.y);
            if(clr == CLR_INVALID)
                printf("Invalid!\n");
            int r = GetRValue(clr);
            int g = GetGValue(clr);
            int b = GetBValue(clr);
            printf("Pos : (%ld,%ld) Color : %#lx (%d,%d,%d)\n", mp.x, mp.y, clr, r, g, b);

        }
        Sleep(10);
    }
    ::ReleaseDC(NULL, hdc);
}
运行结果及报错内容

一直输出颜色为(0,0,0)

我想要达到的结果

获得正确的颜色值

你检查一下hwnd是不是为空啊