Screenshot Foreground Window - MONITORINFOEX struct missing #741
-
Hi, I'm hoping to screenshot the foreground window and I'm running into some problems matching the foreground window handle to the display's device on which the window primarily sits. Screenshotting the foreground window is quite doable (with help from some examples ) when dealing with a single-monitor environment using the win32 api: you can create a device context for the singe display, take a screenshot as given in the example, then However, the problem occurs when we need to isolate the display on which the window rests. A pure win32 way to do this would be something like this:
Using the MONITORINFOEX struct which includes the device name. However, dart's MONITORINFO struct does not include the device name, and no MONITORINFOEX struct exists in the dart ffi code as far as I can tell. (I do have a stupid workaround, which is to use device pixel area to match the monitor and device, but this will fail whenever user has 2 devices of same size.) Anyone have any suggestions here? How hard would it be to implement the MONITORINFOEX struct such that dart's GetMonitorInfo matches the win32 API? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Fixed in #743 EDIT: Just released |
Beta Was this translation helpful? Give feedback.
Fixed in #743
EDIT: Just released
v5.0.7
, which includes theMONITORINFOEX
struct.