multiple-monitors

How do I determine which monitor a Swing mouse event occurs in?

霸气de小男生 提交于 2019-11-27 04:34:35
问题 I have a Java MouseListener on a component to detect mouse presses. How can I tell which monitor the mouse press occurred in? @Override public void mousePressed(MouseEvent e) { // I want to make something happen on the monitor the user clicked in } The effect I'm trying to achieve is: when the user presses the mouse button in my app, a popup window shows some info, until the mouse is released. I want to ensure this window is positioned where the user clicks, but I need to adjust the window

Going fullscreen on secondary monitor

安稳与你 提交于 2019-11-27 03:50:43
How can you program a dotNet Windows (or WPF) Application in order to let it going fullscreen on the secondary monitor? grantnz Extension method to Maximize a window to the secondary monitor (if there is one). Doesn't assume that the secondary monitor is System.Windows.Forms.Screen.AllScreens[2]; using System.Linq; using System.Windows; namespace ExtendedControls { static public class WindowExt { // NB : Best to call this function from the windows Loaded event or after showing the window // (otherwise window is just positioned to fill the secondary monitor rather than being maximised). public

How do I enable a second monitor in C#?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 03:41:48
Is it possible to enable a second monitor programatically and extend the Windows Desktop onto it in C#? It needs to do the equivalent of turning on the checkbox in the image below. MSDN Device Context Functions What you basically need to do: Use the EnumDisplayDevices() API call to enumerate the display devices on the system and look for those that don't have the DISPLAY_DEVICE_ATTACHED_TO_DESKTOP flag set (this will include any mirroring devices so not all will be physical displays.) Once you've found the display device you'll need to get a valid display mode to change it to, you can find

Restoring Window Size/Position With Multiple Monitors

限于喜欢 提交于 2019-11-27 02:58:33
Many posts around about restoring a WinForm position and size. Examples: www.stackoverflow.com/questions/92540/save-and-restore-form-position-and-size www.codeproject.com/KB/dialog/restoreposition.aspx?fid=1249382&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2595746 But I have yet to find code to do this with multiple monitors. That is, if I close my .NET Winform app with the window on monitor 2, I want it to save the windows size, location, and state to the application settings, so it could later restore to monitor 2 when I restart the app. It would be nice if, like in the codeproject

Programmatically changing the “presentation display mode”

不羁岁月 提交于 2019-11-27 01:42:32
问题 The presentation display modes are those you see when using the Windows + p shortcut: Computer Only Duplicate Extend Projector Only Do any API calls exist which allow one to switch between these display modes? I want to programmatically switch between monitor and HDMI TV (and do a bunch of other things simultaneously, hence Windows + p not being useful), but I'm hitting a brick wall. 回答1: In case the EnumDisplaySettingsEx and ChangeDisplaySettingsEx functions do not work for you, you can also

What needs to be done to make multiple screen support for Javascript happen?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 23:42:11
问题 As I was wondering about the multi-monitor/screen support of javascript i found the follwing stackexchange questions relevant for the topic: 2013 - 40k views: window.open() on a multi-monitor/dual-monitor system - where does window pop up? 2014 - 10 k views: window.open on second monitor 2016 - 42 views: How to show a webpage onto another monitor connected to it on click of a button? 2008 - 11 k views: Testing for multiple screens with javascript 2017 - ~1k views: https://webmasters

Programmatically determining individual screen widths/heights in Linux (w/Xinerama, TwinView, and/or BigDesktop)

假如想象 提交于 2019-11-26 23:12:30
问题 I'm developing a little side-project to display multiple wallpapers on multiple screens under GNOME (something that apparently can't be done by GNOME itself or anything else). I've figured out how to do the main part of it (using the ImageMagick components, for the curious); I'm trying to automate the configuration system. To do that, I need a way to determine the dimensions of the individual screens are. Can anyone give me a hint where to look for that? I presume the X server itself has the

Programmatically change screen resolution?

做~自己de王妃 提交于 2019-11-26 22:41:15
Is there a way to programmatically change the screen resolution or enable/disable multiple monitors in Windows XP? For example to change from 1024x768 with one monitor to 1280x104 on two monitors? I would be most interested in a win32 function to do this but anything that can be tied to a windows shortcut would suffice. Ferruccio You can use EnumDisplayDevices to figure out what displays you have available and EnumDisplaySettings to get a list of available resolutions for your displays. Use ChangeDisplaySettings to set the resolution you need. CMS Yes, but its not part of .NET. You will need

Specify monitor when opening file. (.bat)

爱⌒轻易说出口 提交于 2019-11-26 22:18:57
问题 The following .bat file below simply opens two text files overlaying them, but I'm wondering if it's possible to define a specific display source, or if anyone can assist in providing the correct parameters. @echo off START /max /wait NOTEPAD.EXE C:\test\screen1.txt START /max /wait NOTEPAD.EXE C:\test\screen2.txt What I'm trying to get: @echo off START /max /wait NOTEPAD.EXE C:\test\screen1.txt "monitor1" START /max /wait NOTEPAD.EXE C:\test\screen2.txt "monitor2" So the results I am trying

How can I get monitors numbers from Screen Resolution dialog in win7 programmatically?

断了今生、忘了曾经 提交于 2019-11-26 20:27:26
问题 When you press Identify button in Screen Resolution dialog then Windows shows you big white monitor numbers on each monitor. It was easy to find them programmatically together with monitor coordinates in Windows XP (with EnumDisplayDevices) but on Windows 7 it's broken. How can I do that? EnumDisplayDevices and GetMonitorInfo are not reliable anymore for that purpose in Windows 7. I tried GetMonitorInfo and then extracting monitor number from MONITORINFOEX.szDevice (I.E. \.\Display2) with no