Skip to content

Add wrapper/Rustic interface for multiple monitors in GDI #14

@alexchandel

Description

@alexchandel

Getting a handle and device context for the first monitor is relatively easy:

let h_wnd_screen = GetDesktopWindow();
let h_dc_screen = GetDC(h_wnd_screen);
// do stuff
ReleaseDC(h_wnd_screen, h_dc_screen);

Getting a handle and device context for the second monitor is worse than death:

struct monitor_enum_proc_data {
...
}
fn monitor_enum_proc(...) -> BOOL {
...
}
let data = monitor_enum_proc_data {
...
};
EnumDisplayMonitors(h_dc, lprc_clip, monitor_enum_proc, &data as LPARAM);
// call GetMonitorInfo() somewhere
// no end in sight

A simple helper function in gdi.rs, like Dc::get_monitor_window(usize) -> Dc, would go a long way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions