Reputation: 6208
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.
Upvotes: 6
Views: 987
Reputation: 6490
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.
Upvotes: 2