Prevent window from snapping to screen edges [duplicate] - c#

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do you disable Aero Snap in an application?
Is there a way to prevent a WPF window from snapping to screen edges (i.e. Aero snap)?
I know this can be disabled by the user in the OS, but I want to prevent only my window from getting rearranged.
For example, modal windows do not get snapped like that. I imagine it can be set for a WPF window as well, but I do not know how.

There's no direct way of doing this except you set ResizeMode="NoResize" and implement the resize behavior manually or EXTREME SOLUTION could be (on an application basis) modifying a shortcut to your .exe, on the Compatibility tab, check "Disable desktop composition".

Related

How to make Windows form applications Responsive to multiple screen resolutions? [duplicate]

This question already has answers here:
How to make the UI responsive in Winforms [closed]
(2 answers)
How to make size of Window responsive for every type of screen resolution using Windows form [closed]
(1 answer)
Closed 4 years ago.
I have created an Application in Visual Studio 2015 using C# as a P.L. I created it in my laptop whose resolution is 1920 * 1080 (as recommended). It runs smoothly on may laptop, the designs are meant to be as expected. But when I try to run it to another any screen resolution it just zoomed out and the designs, windows form components are not visible, inshort the GUI got crashed. I don't used any of those Flowlayout panel. Is there any setting or configurations on my project that i need to do to fix my problem ?
You may set the application windows form size to maximized so that it will fit in all resolutions by Set the System.Windows.Forms.Form.WindowState to FormWindowState.Maximized and then used flow layout/dock combinations to handle manual resizing
Please refer this video

How would I go about drawing a rectangular selection on-screen when the mouse is dragged and then getting a screenshot of the selected area? [duplicate]

This question already has answers here:
.NET Equivalent of Snipping Tool
(3 answers)
Closed 5 years ago.
I'm looking for a way to draw a rectangular selection-visualiser, basically similar to Gyazo.
If any of you are familiar with iOS jailbreaking and have used Snapper 2 before, I'm trying to do that but for Windows. For those of you who aren't, it allows you to select an area you want for a screenshot and then keeps it on top of everything else, allowing you to drag it around, save it etc. It's really useful for phone numbers, WiFi passwords among other things.
The only issue is that I don't know how I'd go about drawing a selection area and grabbing an image of it.
Any help would be appreciated.
Windows since 7 has the Snipping tool. It might be close enough to the droid you are looking for: https://support.microsoft.com/en-us/help/13776/windows-use-snipping-tool-to-capture-screenshots
If you mean .NET with C#, there is Graphics.CopyFromScreen. Note that it does not work from Windows services - a interactive session is required and Services are barred from those by default since Vista.
One issues is having this thing be drawn "on top". Generally the topmost game is one you and the user can only loose. Everything that is able to win it is either part of Windows itself. Or uses a "intercept GPU output, draw something on top" approach, wich is not trivial.

Change cursor while mouse dragging [duplicate]

This question already has answers here:
How can i change the cursor (image) in the whole windows OS
(3 answers)
Closed 7 years ago.
I would like to implement the next construction in .NET in a WPF application.
There is a window, and in it there is a little picture, e.g.: 16×16.
If i move the mouse above the picture, and pressed the left button (without release), the cursor will change to this picture until i release the button.
Between the press and release i would like to drag out this cursor image outside the application window.
How can i implement this feature without modifying system registry values?
Thanks in advance,
Peter
You cannot change the Windows cursor without changing the registry. This has been discussed before: How can i change the cursor (image) in the whole windows OS

C# or C++ frozen pane that shrinks desktop [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How does Microsoft One Note 2010 implement a window that is docked to the desktop?
I was wondering how one would go about making a program (in C# or C++) that would have a frozen pane and shrink the active area of the rest of the screen. A good example of this is the Facebook client chat program in full screen mode because it is always on top as well as shrinks the area of the screen that is active, including shrinking the desktop. What I'm trying to achieve is the green bar in the picture below that can never go away:
(note please ignore the red circle in the photo below, the only picture I could find of what I'm trying to do was from a meme about how on all military sites they have a suicide hotline because the systems are all so slow, they make you want to kill yourself)
It's documented on MSDN as an "AppBar": http://msdn.microsoft.com/en-us/library/windows/desktop/cc144177%28v=vs.85%29.aspx
It's a regular Win32 window anchored to one edge of the screen and also reduces the area for other windows to maximize into.

How to find Windows Taskbar location and size? [duplicate]

This question already has answers here:
How do I get the taskbar's position and size?
(10 answers)
Closed 9 years ago.
I have created an application that runs in the system tray. When the user single- clicks the try icon, a small form comes up in the bottom right corner of the screen, i.e. right above the system tray. The form is basically "sticky" to the tray.
Here is my question: How do I accomplish the same thing, even if the user has the taskbar docked somewhere else? Like at the top of the screen, or one of the sides?
It shouldn't be hard, since I figure all I have to do is find out where the taskbar is. Is it at the bottom, the top, or one of the sides. But I can't find any documentation anywhere, that explains how to get the location and position of the taskbar.
Any one has any idea about this ?
It's a window, so find it's HWND and then get the window coordinates. The class name you're looking for is "TrayNotifyWnd".

Categories