multiple-monitors

How do I get the dimensions (resolution) of each display?

帅比萌擦擦* 提交于 2019-12-06 00:04:54
问题 I need help on how to retrieve the resolutions of my screens, as shown in the image below. I found this documentation and it was really helpful. Here's the code that I tried, based on those docs: int numberOfScreens = GetSystemMetrics(SM_CMONITORS); int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); std::cout << "Number of monitors: " << numberOfScreens << "\n"; // returns 3 std::cout << "Width:" << width << "\n"; std::cout << "Height:" << height << "\n";

Simulate a monitor and get a video stream on windows

走远了吗. 提交于 2019-12-05 21:07:00
Is there a way for me to programatically set up a fake monitor in windows and get a video stream from it? Is there something in the win32 api that will allow me to do this? Thanks I think Windows desktop objects are your answer. Here's an example of an application that uses them: Unlike other virtual desktop utilities that implement their desktops by showing the windows that are active on a desktop and hiding the rest, Sysinternals Desktops uses a Windows desktop object for each desktop. Application windows are bound to a desktop object when they are created, so Windows maintains the

Output jFrame to second monitor if possible

梦想与她 提交于 2019-12-05 18:41:49
i have a jFrame on Swing in Java, and i want it to output to second monitor, if this monitor exists. I tried this (by this page) to get resolutions of displays GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); for (int j = 0; j < gs.length; j++) { GraphicsConfiguration[] gc = gs[j].getConfigurations(); for (int i = 0; i < gc.length; i++) { Rectangle gcBounds = gc[i].getBounds(); int xoffs = gcBounds.x; int yoffs = gcBounds.y; } } But then i watch in debugger to xoffs and yoffs for my first monitor (1360*768) xoffs = 1360

Ogre3D, Multiple Monitors, and the Mouse Cursor

只谈情不闲聊 提交于 2019-12-05 14:24:39
I am developing an application that requires multihead rendering in OpenGL. Right now, I can render to multiple screens, but the travel of my mouse cursor is limited to a single screen. However, I'd like to be able to use the mouse cursor on all of the rendered screens. Has anyone run into this same issue, and if so, how did you go about resolving it? I found a working solution for this. First, I had to instantiate my Ogre::RenderWindow objects in windowed mode rather than full-screen mode -- full-screen mode was emulated easy enough by instantiating the Ogre::RenderWindow objects without

How can I get an HMONITOR handle from a display device name?

◇◆丶佛笑我妖孽 提交于 2019-12-05 12:58:53
I want to obtain a monitor handle ( HMONITOR ) that can be used with the Windows multi-monitor APIs for a specific monitor attached to the system by index . For example, say I have three monitors attached to my system and forming part of my desktop; I want to get a handle to monitor 3. I already know how to get the device name for a specific monitor by index by calling the EnumDisplayDevices function. For example: HMONITOR MonitorFromIndex(int index /* (zero-indexed) */) { DISPLAY_DEVICE dd; dd.cb = sizeof(dd); if (EnumDisplayDevices(NULL, index, &dd, 0) != FALSE) { // We found a match; make

StartPosition is set to CenterPosition but my form is not centered

≯℡__Kan透↙ 提交于 2019-12-05 10:05:29
I'm using Visual Studio 2012. My form, when it opens doesn't center to the screen. I have the form's StartPosition set to CenterScreen , but it always starts in the top left corner of my left monitor (I have 2 monitors). Any ideas? Thanks try this way! namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); //Method 1. center at initilization this.StartPosition = FormStartPosition.CenterScreen; //Method 2. The manual way this.StartPosition = FormStartPosition.Manual; this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height)/2; this

window.open on second monitor

倖福魔咒の 提交于 2019-12-05 08:15:14
window.open('branchMonitoring/', 'Testing Dual Monitor', 'resizable=1, scrollbars=1, fullscreen=0, height=200, width=650, screenX=0 , left=1280, toolbar=0, menubar=0, status=1'); I used this code to open a new window on second monitor but the new window still opens on first monitor and cannot exceed the first monitor's boundary. I tried to change "left" to a higher value but still no luck. Please help me brothers. i am using latest google chrome browser and using windows 8 dual monitor. Please do note that this solution works for me when using FireFox browser. But I need to get it work on

Fullscreen mode on monitor A in dual-monitor setup breaks when moving windows from monitor B onto it

為{幸葍}努か 提交于 2019-12-05 02:46:29
I am building a Win7/8/10 x64 Direct3D11 desktop application that allows the user to switch between windowed and fullscreen mode (proper dedicated fullscreen mode, not just a maximized window*). On a dual-monitor setup I am encountering some issues. The switch itself is performed manually using IDXGISwapChain::SetFullscreenState and works as intended: The monitor that houses the lion's share of the window area (let's call it monitor A) goes into dedicated fullscreen mode while leaving the other (monitor B) as it was, allowing the user to interact normally with windows on B as well as the

Can I set on which monitor will application run through the Visual Studio appear?

廉价感情. 提交于 2019-12-05 02:16:11
I am using multiple monitors and I prefer to have my Visual Studio open in the center one and I would like the application that I am testing / running through Visual Studio open on either left or right side, rather than on top of my code. Do you think there is a way of doing that, that is automatic ? Can this be set somewhere in the options ? I know that one solution is to change the main monitor to the left, but that would make all apps start on the left rather than in the center. Unfortunately not. The application is positioned by the OS and is not an option that you can set from Visual

Duplicate Windows form on multiple screen in c#

半腔热情 提交于 2019-12-05 01:49:13
问题 I am developing a feedback system for an automotive company. On the billing desk, there is a dual monitor setup: one for a billing person and one for a customer who's giving feedback. My need is to duplicate a Windows form on both screens, as mirror images, So that the billing person can see what feedback the customer is giving. I am using the code below for display on the secondary screen: Screen[] sc; Form f = new Form(); sc = Screen.AllScreens; f.FormBorderStyle = FormBorderStyle.None; f