Achieve window minimize effect - c#

When I minimize a window of a WPF application it gets minimized to Windows taskbar. I want to override this functionality to something like the minimize effect generated by IDM download finished Window which goes to left bottom of the screen but doesnot minimize to taskbar.
Adding a screenshot for better understanding.
How do I achieve this? Need some inputs to start.

Related

Cycle through open windows in C# using ALT+TAB/ESC and have the current window in focus and forced to be maximized (if already minimized to taskbar)?

I am writing a small application to automatically rotate through open windows on Windows 7/8.1/10 PC's. I have written the majority of the code and it is working well except I cannot figure out or find out what key presses to use to cycle through open applications.
I have tried SendKeys.Send("%{Tab 2}"); but this seems to only actually press the TAB button once as it keeps switching between the same two windows (even though more are open).
I have tried SendKeys.Send("%+{Esc}"); but this doesn't maximize windows that are minimized to the taskbar. It will effectively cycle through each open windows and bring them into focus (as evident by watching the white semi-transparent overlay on the taskbar item) but it won't show them on screen - I'm assuming because they started minimized. Only the maximized ones will show on screen when it's their turn.
Can anyone please assist? I'm sure it's a simple fix of maximizing the window it cycles to but I'm unsure how to implement this.
I haven't included the code of the entire application as I don't think it is relevant. If you do require it please let me know and I will add it.
Many thanks.

Minimise and maximise MetroWindow when ShowMessageAsync is being displayed

I am using Mah Apps Metro in a WPF application and showing messages to users with their async dialog messages.
At a particular point in the application I am erasing a removable device which could take some time, in the mean time showing the user the ShowProgressAsync dialog until it completes.
var controller = await this.ShowProgressAsync("Please wait", "Preforming secure erase, this could take some time...", false, mds);
During the time the dialog is on the screen, it is not possible to interact with the window's minimise and maximise buttons and it's also not possible to move the window.
Is there a way I am able to show the dialog to the user and allow them to minimise/maximise/move the window or will I be forever stuck with the application in the location the dialog was displayed until it is closed?
(side note: the grip in the bottom right corner of the window will allow me to manually resize the window, just not the buttons on the title bar)
Thanks
The MappApp dialog is modal, so you cannot touch anything in the background because this is its purpose. As far as I know (for now) you cannot made modifications on this scenario.

Change Minimize Animation

I have an application that minimizes to the system tray. That all works well, the problem is that when minimized the animation goes towards the left side of the screen.
Is there a way to change it so the animation goes towards the tray?
No. This animation is handled by Windows, and since you are invoking the Minimize routine on the window, Windows will automatically animate the window into the location where the window's button is on the taskbar. If you're looking for a "quick solution", there isn't one.
The most you could do is change the window's behavior so that when it's minimized, it actually closes instead. This would prevent the fly-down animation into the taskbar, and Windows would perform the window close animation instead, which may look more consistent with your application design. A lot of other tray icon programs handle it this way.
If you really want to change the window's animation, you will need to override any Windows window management features with your own, that way when the window is "minimized" (or closed), you can animate your window to appear to move into the notification area on the right.

Having a window with ShowInTaskbar, Topmost, but also a notification area icon

I have a program I want to be able to handle all three states:
Not showing in taskbar, acting just as a widget like the Windows sound, network programs etc
Showing in taskbar - but not Topmost. The window would still show the notification area icon, and should still behave in the same way as #1, but also show the window in the taskbar.
Showing in taskbar with topmost. The window should behave the same as #2, but now the window will show topmost. Note: it should still be capable of being minimised, in the same way that clicking on a taskbar icon minimises a program.
These are my criteria, and I have been working on having them all working nicely together, but I can't seem to get the last few tweaks ironed out. #1 is fine - I have sorted that out easily enough. #2 and #3 cause more issues.
My first question is, how does Windows handle the user clicking on a taskbar icon to get it to minimise/switch back to normal? As I'd prefer to emulate that with #2 and #3.
For #1 I currently hide the window simply by setting Window.Visibility to Visibility.Hidden. And to show the window, call Show() and then Activate().
Like I said, for #2 and #3, I'd like to copy what Windows does when the user clicks on the taskbar icon. Can I do that? Or would I have to find another way to do this?
1- this is called thumbnail buttons
You can check http://elegantcode.com/2010/12/17/wpf-adding-thumbnail-buttons-to-windows-7-task-bar/ OR http://shareourideas.com/2010/12/19/windows-7-taskbar-thumbnail-buttons-in-wpf/ OR http://msdn.microsoft.com/en-us/library/ff699128.aspx
2- there is property called TopMost in the Window class.
3- for the taskbar icon
you can use this library it is easy to use and powerful http://www.codeproject.com/Articles/22876/WPF-Taskbar-Notifier-A-WPF-Taskbar-Notification-Wi
4- to minimize and maximize you can simply use
this.WindowState = FormWindowState.Maximized;
* that is all the info you need to create your application as you want, if you face any problems read the articles well if the problem still there find where is the problem exactly and ask again.
hope this help...

Clean up/Refresh Tray Area in C#

When either hiding my tray icon and closing the application, half the time my application's tray icon gets 'stuck'. Meaning doesn't leave until you mess around in the tray area.
I know that to clean up during closing I can do trayIcon.Dispose() but that only works for when i close my C# application, and not for when I hide (trayIcon.Visible = false) it.
Does anyone know of a hack, or anyway at all, that can be used to refresh the tray area, or just make sure my icon actually stops displaying?
Refreshing the Taskbar Notification Area in C#

Categories

Resources