I have a secondary monitor that I want to use exclusively to display information from a specific c# wpf application.
The normal windows desktop should not extend to this monitor, it should be impossible to move the mouse to it or somehow transfer input focus to this monitor. Nor should there ever be any error messages or other windows on that monitor, except for the single maximized window from the c# application.
This is necessary because the secondary monitor is used to display information not to the user in front of the pc, but to a remote location several meters away.
The approach I found to maximize a wpf app on a secondary monitor requires that the windows desktop is extended to that secondary monitor. If that monitor is not visible to the user, then this can get highly confusing if the mouse cursor is on that monitor, or an error message or main window is accidentally moved to it.
Is it possible to somehow get exclusive access to a monitor in wpf without extending the windows desktop to that monitor?
Related
I'm making a taskbar application by wpf on window.
When user shutdown, the application will be shown on standby screen with a message by using ShutdownBlockReasonCreate
If I open many programs, the application sometimes will move to bottom on standby screen like this
How can I move it to the top on this screen?
I don't think it is possible to control the order of this list programmatically.
Even if it was possible, you would have to ask yourself, what if two programs did this?
I'm creating a Windows Forms application in C# that utilizes the SlimDX(a managed wrapper of the Direct3D API) libraries. Problems arise when I try to take the application fullscreen(a state in which the main window covers the entire desktop area including the taskbar).
The Direct3D device window(main window) displays correctly. The taskbar and other overlapping windows are hidden entirely by the device window. The cursor, however, seems to belong to the window directly beneath the device window. This is evident in the appearance and behavior of the cursor. When I click on the device window focus is changed to the window beneath. This is unexpected behavior for any window.
Also, I am able to click items on the taskbar which will cause a change in focus.
I am changing the window style of the device window to 'TopMost and 'Popup'. Also, I am following the utility class found in the DirectX SDK. When I run a sample from the DX SDK, which uses Win32, this problem doesn't occur. Is it possible that the problem is related to my use of Windows Forms?
There is a lot of code involved in my application so I was hoping for theoretical responses as to why this problem might occur. I found a thread here that describes a problem when taking device fullscreen, however, the solution is unacceptable. It was suggested to use a 'windowed fullscreen mode'. Instead of modifying the adapter display mode for fullscreen, the device window would simply be resized to cover the entire screen. This solution would prevent the use of adapter formats, resolutions, and refresh rates that are available in fullscreen mode.
Any suggestions would be much appreciated!
The problem was due to the nature of controls found in Windows Forms. From MSDN:
A control can be selected and receive input focus if all the following are true: the Selectable value of ControlStyles is set to true, it is contained in another control, and all its parent controls are both visible and enabled.
The device window in my application belongs to a parent window and the parent window becomes nonvisible once fullscreen is enabled. Its possible that a conflict arose due to the 'focus rules' above. To test the theory I examined the return value from DeviceWindow.Focus()(derives from Control.Focus())...which returned false.
My solution was to create a form used for the sole purpose of fullscreen mode changes. Now, when I want to go fullscreen I reset the device with the handle to the new device window. All problems solved...
In applications like Skype, closing the window effectively minimizes to the taskbar on modern systems because notifications are shown directly on the taskbar overlay. In my case, I have a multi-window ecosystem. Is there a way to register some behavior assigned to a taskbar item that isn't part of the application lifecycle of a specific window? Are there ways to do this in .NET? WPF specifically?
Ideally this would be for a situation where starting the application doesn't create a window handle, just a process etc. Windows would be created contextually based on the usage. Resources would load on demand.
I'd like to be able to stop a computer outputting to the display or be able to hide this output temporarily. I've used a VNC application called AnyPlace that allows the controlling computer to hide the output to the monitor and stop keyboard input, but I can't work out how they did this.
As you can still control the computer from the remote app I'm assuming they don't just load an application with a black screen. I thought about doing this but I can't guarantee I'll be the topmost application apparently.
I need to be able to hide the screen whilst I use a control system to close on application and open another in the background and then restore the output.
Some programs use DPMS to force the monitor into power-saving mode. Others might use a HUD overlay to draw on top of the screen without actually having a window (these are frequently used alongside volume control keys, etc). In Windows, you can use the "window station / desktop" GUI containment APIs to switch to a whole other desktop temporarily.
How does one get the screen resolution of the current monitor? By "current monitor", I mean the one that the application starts on.
The reason I ask this is because I have two monitors, the secondary monitor is 1280x1024 and the primary is 1680x1050. The application, when it starts, stupidly sets its own height and width based on the primary monitor resolution. When the application launches on the secondary monitor, it overflows the resolution, which looks strange.
I know I could change/remove the code that sets the application's height/width, but I am also curious how one determines which monitor the application is showing on.
For what it's worth, I am not a proponent of applications that set their own height/width.
Use Screen.FromControl:
Screen.FromControl(this).Bounds
where this is the Form that you want to retrieve the Screen information for.