win 10 dpi 缩放

win 10 dpi dwm 效果,影响最大的函数有

参考资料:https://blog.csdn.net/chenlycly/article/details/53142098

GetSystemMetrics(SM_CXSCREEN):786

GetSystemMetrics(SM_CYSCREEN):461

经过 win 10 dpi: 130% DWM缩放后的屏幕分辨率:  1024 x 600

-----------------------------------------------------------------------------------------------------

适用于:1024 x 600

MOUSEHOOKSTRUCT *mhookstruct; //鼠标HOOK结构体
mhookstruct = (MOUSEHOOKSTRUCT*)lParam;
POINT pt = mhookstruct->pt;

HDC dc_screen = GetDC(0); //获取 屏幕 dc

COLORREF color = GetPixel(dc_screen, dcX, dcY);

-----------------------------------------------------------------------------------------------------

适用于 786 x 461

//先记录一下当前的鼠标位置

POINT point;
GetCursorPos(&point);

mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE,  x2, y2, 0, 0)

-----------------------------------------------------------------------------------------------------

上一篇:python docopt模块详解


下一篇:python常用模块详解(一)