fix: Virtual desktop control support multiple monitor

This commit is contained in:
yuanyuanxiang
2025-08-03 18:12:05 +08:00
parent f95d30e0e6
commit cf03de5bc9
4 changed files with 41 additions and 39 deletions

View File

@@ -22,10 +22,10 @@ public:
void Create(HDC desktop, int _x, int _y, int w, int h) {
x = _x;
y = _y;
width = w;
height = h;
width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
hDcWindow = CreateCompatibleDC(desktop);
hBmpWindow = CreateCompatibleBitmap(desktop, w, h);
hBmpWindow = CreateCompatibleBitmap(desktop, width, height);
}
EnumHwndsPrintData& SetScreenDC(HDC dc) {
hDcScreen = dc;
@@ -154,7 +154,7 @@ public:
static BOOL CALLBACK EnumHwndsPrint(HWND hWnd, LPARAM lParam)
{
AUTO_TICK_C(50);
AUTO_TICK_C(100);
if (FALSE == PaintWindow(hWnd, (EnumHwndsPrintData*)lParam)) {
char text[_MAX_PATH] = {};
GetWindowText(hWnd, text, sizeof(text));