I have written a WPF application in C# which I would like to show every time the start menu is opened and hide again when the menu is closed. I would prefer to do this without polling the state of the start menu. So far I've tried listening to the SHELLHOOK messages but I'm not seeing anything useful there.
I Can't write you full code but here is the logic behind it,
First find the handle for the task bar using
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
also pass Shell_TrayWnd
as lpClassName
Activate the Start Menu by simulating click button.
Get the window handle of Start Menu
Use GetWindowLong
function to check it is open or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With