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)

 

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

 

posted @ 2019-04-05 16:33  personnel  阅读(244)  评论(0编辑  收藏  举报
友情链接:图片批量处理工具 gif动态图制作工具 制作电子相册 图片排版工具 制作淘宝主图视频 MKScript 鼠标键盘自动化脚本语言