Get state of show desktop toggle - c#

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

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.

WPF Menu Popup Placement

I have a UI design that I created to mimic the way that apps in Win10 look but in Win7 - 8. I created a Menu that drops down and has several buttons in it. When this drops down it's the height of the app itself. If the app happens to go behind the task bar the menu drop down opens up instead of down. Is there a way to change this behavior so that no matter where the app is located on a screen it will open down even if that means behind the taskbar.
Thanks

How to stop windows keyboard icon from showing

i have an app that is intended for a pc with a touchscreen display. I have a built in keyboard for the app. Every time i click a textBox windows displays the icon for me to open windows keyboard. How do i disable that from poping up in my app, BUT still let it pop up outside my app?
More info:
I have a kiosk style app, for employees to register gas consumption. and is all made for a tactil screen. When i click either a textBox or a comboBox the icon prompting me to open windows keyboard pops up. I want to stop that from happening since the app already has a keyboard. However, employees can still get access to regular windows, so when they do i want this pop up to happen naturally on the rest of the computer. So, i just want to stop this from happening in my app, and all the solutions i have came across are for windows in generally and not app specific. How to stop this icon from poping up in my app?

c# taskbar button switching/moving in multiple display environment

I've created a winforms application. All is running fine, also the taskbar button is created and shown in taskbar including the correct icon.
Whenever I move the form from one display to the second display, the taskbar button stays at the display from where the form was initial start.
I also compared the settings with another winforms application where the behaviour is correct. Means, the button is moving/switching/whatever to the active display where the form is moved to.
Hopefully it is just a small thing, but I came not across with it.
It is an OS feature.
For windows 7 there is no built-in support to show taskbar for your second monitor and your taskbar buttons will always show on first monitor taskbar.
For windows 8 you can open Taskbar properties and in Multiple displays settings, check Show taskbar on all displays and then set the value of Show taskbar bottons on: to Taskbar where window is open

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.

Categories

Resources