Prevent SettingsFlyout from reopening settings menu on dismiss - c#

In Windows 8.1 using SettingsFlyout from the SDK, is there a way to prevent the settings menu reappearing on dismiss?
To give a use case, the pane in question is a user sign out pane, accessible via. the charms menu however I also want to open it when the user taps their thumbnail - but it then makes no sense to reopen the charms menu!

In your call to show the pane, use ShowIndependent() instead of Show(). The Show() method should be used when launched from the Settings charm itself to keep the flow.

Related

Preserve notify icon autohide status when executable moves to another physical location

By default, Windows hides the notify icons in the taskbar, and user can see them by clicking on the arrow button. But user can drag those and drop them into the taskbar, so it'll be always visible. This preference will be saved for that executable.
However, my WPF app uses Squirrel.Windows for installation and update, and Squirrel.Windows creates a new executable (in a different path) for each update. So Windows will treat it as another executable, and that preference about notify icon is reset. (It hides again, even if user dragged it to taskbar in the previous version)
Is there any way I can preserve that preference of user across updates?
Maybe there's an identifier or something I can uniquely set? or any other ideas?
I'm currently using System.Windows.Forms.NotifyIcon on my WPF app. But I'm open to using alternatives if an alternative can help solving this issue.

Get state of show desktop toggle

How do I get the state of the Show-Desktop toggle?
Goal:
Show the taskbar when show desktop is toggled and desktop is shown
Hide the taskbar when show desktop is toggled and windows are restore
Problem:
I can toggle show desktop and I can show or hide the taskbar but I cannot find a way to determine the state of the "show desktop" toggle.
I'm working in C# in VS 2010 with .net 2.0 (if it has to have later version .net ok, but I suspect the answer is somewhere in win32 with a pinvoke. Just can't find it)
This app is for a touch screen where getting to a auto-hidden taskbar is nearly impossible. Normally the taskbar is hidden but users would like to get to it when they click show desktop. (i.e. please no non-constructive comments on windows doesn't want you to change the autohide state without user permission)
Semi-Solution that technically meets my project requirements but not the intent of them:
Show the start menu any time show desktop toggles. Of course the start menu disappears when you click anywhere else but... It was shown.
There are several tutorials on how to do this. Just Google

How can I prevent my C# application from opening new windows during context menu?

I'm working on some C# application to help myself learn C# a bit. I've been searching for a solution, but I can't seem to find one.
When my application minimizes, it shows a notifyicon in the system tray. When I right click it, a context menu pops up on the mouse. However, for each level of the menu and submenu, a blank window pops up on the taskbar until I exit that submenu or the contextmenu.
I don't know why, and I'd like to. I'd also like to know how to prevent that from happening.
Edit
Also, in Visual C# Studio 2010, when debugging, is there a way to determine exactly which form/part of the code I've focused on, so that I could click one of those windows to see what exactly it is?
How are you showing the ContextMenu? I suspect you are calling ContextMenu/ContextMenuStrip.Show(x,y) directly. That will cause it to show in the taskbar.
Instead, assign your ContextMenu/ContextMenuStrip to the ContextMenu/ContextMenuStrip property of your NotifyIcon rather than manually showing it in the mouse click handler. If it is used as part of ContextMenu/ContextMenuStrip property, it won't show in the taskbar.

Handle Rdp ActiveX minimize event

I've developed a simple .net form application where I've embedded the RdpClient ActiveX.
To reproduce the application, you have to:
'Add Reference' and select COM
include 'Microsoft Terminal Services Control Type Library'
select the ToolBox, 'Choose Items...' and go to 'COM Components' tab
look for 'Microsoft RDP Client Control - version 6' (this is the version I've used)
Now you can drop this Control on the form.
Handle the form Shown event with this code
axMsRdpClient6.FullScreen = true;
axMsRdpClient6.Server = "yourserver";
axMsRdpClient6.Connect();
Then when the rdpclient window appear, click the minimize button on the top bar.
My question is: why the event AxMSTSCLib.AxMsRdpClient7.OnRequestContainerMinimize is not fired when minimize button is clicked?
I need to handle when the user minimize the client to take peculiar actions (write log files, activate other windows application and so on).
I've found the answer in MSDN
This method will only be called if the container-handled full-screen mode is enabled - see
IMsTscAdvancedSettings::put_ContainerHandledFullScreen for more information.

Activating Modal Windows after switching to an application

We have a C# application which contains both modal and non-modal windows. It is possible for a user to have several non-modal windows open and open a modal window from one of these.
If the user switches to another application and then switches back to ours by clicking one of the non-modal windows (other than the one which opened the modal window) in the Task Bar, the non-modal window becomes activated but does not accept input because the modal window is open, but is behind other windows.
How can we ensure that no matter which of our windows the user switches back to, the one which is modal is the one which is actually activated? This is the behaviour exhibited by Microsoft Outlook, for example.
Any assistance would be appreciated.
Its certainly possible, but is really annoying to maintain. I regularly work on an application which mixes modal and non-modal windows. This is my strategy (which isn't 100% full-proof)
Set the modal windows TOPMOST when
possible.
When certain actions are
detected (like pressing windows-d button),
you have to manually set the window
back to topmost. I dont know why the windows go to the back, but the behavior is not consistent between windows XP, vista, 2003, etc.
Its really annoying maintaining the code that rearranges the windows. I would urge you to try to not mix modal and non-modal windows.
Edit
I forgot to mention that i use WTL and alot of native win32 functions. I also try to create windows which have parent / child relationship so that keyboard and mouse messages get REFLECTED as much as possible to the child windows.

Categories

Resources