简体   繁体   中英

Windows XP/Vista/7 application that targets external monitor

I'm thinking to create a simple game that displays itself on the external monitor, if it's available.

I would be pleased to have this as simple as possible, in other words the programming handles the activation of the external monitor, and targets the gamewindow there automatically on start (by a commandline tool, api, ?). A mirror view would do fine as well.

Is this even possible? Would there be a good alternative, besides having (simpleminded) users having to set their monitor etc. by themselves?

I do not have a preferred language to work with; Java, C(++), C#, anything would do as long as it runs on Windows 7+.

Here are just a few examples of APIs related to multiple monitors / displays (pretty much, first relevant results of a Google search):

EnumDisplayMonitors will be a common point for most of these, the documentation of which is available at http://msdn.microsoft.com/en-us/library/dd162610%28VS.85%29.aspx :

The EnumDisplayMonitors function enumerates display monitors (including invisible pseudo-monitors associated with the mirroring drivers) that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context. EnumDisplayMonitors calls an application-defined MonitorEnumProc callback function once for each monitor that is enumerated. Note that GetSystemMetrics (SM_CMONITORS) counts only the display monitors.

See also ChangeDisplaySettingsEx , which can be used to configure the displays, including "Position of the device in a multi-monitor configuration."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM