Force a window to be always maximised - wpf

I have a WPF application that I want permanently maximised.
The application starts off maximised and that's fine.
I have set the ResizeMode="NoResize" and while this does prevent the window from being resized (by dragging the edges of the window), I find I can drag the title bar down, and the window will resize to a "Restore" state - i.e. partially filling the screen. At this point the window can't be resized (as I'd expect) or maximised once again (even if I drag the title bar back to the top of the screen)
Is there a setting that will just not allow the "restore" functionality and force the Window to always be maximised?
Edit
I've discovered this is actually a window setting, and if I turn off "Arrange windows automatically by dragging them to the corners of the screen" in Settings / System / Multitasking it prevents this (I also needed to remove the ResizeMode="NoResize" funnily enough otherwise dragging the title bar just drags the entire maximised window down).
However, I can still "Restore" it by double-clicking on the title bar. I can maximise once again by doing it again, but I don't want the user to be able to restore the window at all.
Strangely enough, doing it this way ResizeMode="NoResize" lets me restore a maximised window, but not maximise a restored normal window... I'd be happy with the other way around...

Related

WPF application cannot be fully maximized

I have an application with window properties set to
WindowState="Maximized" WindowStyle="None"
When I minimize it and maximize again, it not fill whole screen, so Windows start bar is visible and there is a strange margin on bottom and right of app window.
Problem exists only on Windows 10 LTSB 2016. On normal Windows 10 everything seems to be ok.
I tried to force set height and width related to screen resolution and force set Left and Top of window. Didn't help.
Make sure ResizeMode=ResizeMode.NoResize is set on your window, before you change to maximized window.

Detecting X11 window resize towards top/left

I'm working on a mapping application and I'm trying to get resizing in X11 working the way I'd like. Conceptually, I'd like my window to be a viewport onto some real-valued space where my data lives. When you resize the window, the size of your view onto this real-valued world should change accordingly.
What this means is that when resizing the window, rather than shrinking/stretching the data, more or less of the underlying window becomes visible. It's easy to handle the case when the window is resized by growing/shrinking on the bottom/right, but I'd like to handle the case when it's resized on the top/left as well.
This is trickier, because a top/left resize also moves the window's origin as well as it's dimensions. I need to detect the change in the origin so that I can compensate to keep my data centered as the window is resized.
Is there a robust way to get the absolute coordinates of a window in X11? The coordinates that X11 reports directly through ConfigureNotify and XWinAttributes are dodgy due to window manager reparenting.
In Xlib use XTranslateCoordinates to translate the coordinate (0,0) in your viewport window into coordinates of the root window. This also covers the case of a stacking window manager messing with your window position.

How to move WPF window above top of screen?

I have a window with the following:
Background="{x:Null}" AllowsTransparency="True" WindowStyle="None"
Dragging the window by hand beyond the left, right and bottom limits of the screen results in a predictably cropped window. However this behaviour is not the same for dragging it above the top limit. Instead of cropping, it pushes it back down as if there's an automatic If Window.Top < 0 Then Window.Top = 0.
This is probably in place so that users don't lose a Windows titlebar (which is the standard way to drag windows around, and losing sight of that effectively makes it undraggable). I don't need that as my entire window is draggable via Me.DragMove().
So, how do I let a window be dragged above the top limit of the screen?
(This is unrelated to Aero Snap which only occurs if the mouse touches the borders. I'm trying to move the window beyond visible bounds)
The DragMove function do not allow you to drag a window above the screen. You need to manually move the window, for example:
How do I move a wpf window into a negitive top value?

childWindow Full Screen Event tweak the Parent to also FullSCreen Mode

I have a ChildWindow which contains a ExpressionMediaPlayer inside it. When I click on the ChildWindow Media Player Full screen button it swiches the whole application to FullScreen Mode.
Is there a way to avoid it. I am not quite sure if this scenario is going to fall under SL security restrictions.
When I drag the ChildWindow(the position of ChildWindow changes) and click on the fullscreen
now the ChildWindow also changes it's position.
For example if I have dragged the ChildWindow 50px from Top and pressed the Full Screen button of of mediaPlayer (it contains) the Child Window also appears 50 pixels below the Screen Top.
But I want My ChildWindow to be FullScreen without having any Gap from LEFT,TOP,RIGHT or below.
Any help will be greatly appreciated.
Thanks,
Subhen
Silverlight only uses one of its two windows. The first is the normal window embedded in the Host application such as IE (or in windowless mode it co-operates with the host to draw directly on one of the host's windows in a give rectangle). The other window is a Fullscreen one.
When in full screen mode it moves all its rendering of its stack of content to the full screen window. You can't get Silverlight to render only some controls on the Fullscreen window, its an all or nothing proposition.
Creating a "fullscreenable" ChildWindow would be an interesting exercise. Probably a new templated control based on Childwindow with a new "Fullscreen" visual state (in a new state group) that hides the chrome and causes the content grid to stretch with Auto Width and Height.

How to detect that WPF window has been snapped in Windows 7

Windows 7 has the snapping feature which 'snaps' a window to the edges, and changes the one dimension of the window size to match the same dimension of the screen, and then choses another size for the other dimension.
I want to detect that it has happened so that in my WindowStyle.None window with custom chrome, I can implement the proper behavior for double clicking the titlebar.
The snapping does not alter the WindowState, so I cannot detect that it has happened. Since only one dimension of window is set to match the the screen, I can not distinquish between a snapped window and a user resized window. Does Win7 send out a specific message, or include a flag in the WM_xxxx messages when it causes a resize? Is the formula to the other dimension (not the one matching the screen) defined anywhere so that I can check if both dimensions match that of a snapped window?
have you tried using spy++ to watch window messages to see what gets sent in what order? maybe there's an extra mesage in there that windows is using.

Resources