emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x-display-pixel-width/height inconsistency


From: grischka
Subject: Re: x-display-pixel-width/height inconsistency
Date: Thu, 21 Mar 2013 01:58:38 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

The DC has nothing to do with monitors because monitors are just
different coordinates on the same (virtual) screen. (Obviously
since you can drag the window between monitors, even such that
it's partially on two monitors at the same time.)

To get the the size of the monitor where your window is (mostly)
on you can use:

    MONITORINFO mi;
    HMONITOR hMon;
    RECT s;

    hmon = MonitorFromWindow(your_hwnd, MONITOR_DEFAULTTONEAREST);
    mi.cbSize = sizeof(mi);
    if (GetMonitorInfoA(hMon, &mi)) {
        s = mi.rcMonitor;  // entire screen, or
        s = mi.rcWork; // without taskbar
    }

--- gr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]