How to show WIndows launcher menu

I need to activate the Windows start menu in place of the mouse.

I know that I can send CTRL + ESC or Win keys to a specific window and then move the window, but it still shows the menu at its original location for a short period of time (unless I set the hook, and this is overkill for the task).

I remember that there is a way to do this using some kind of dll call or sending some message to the shell or something like that.

T

+4
source share
2 answers

Do you get the same behavior if you β€œclick” a button more programmatically?

// Find the Start button HANDLE hScreenDC = GetDC(0); DWORD height = GetDeviceCaps(hScreenDC, VERTRES); ReleaseDC(0, hScreenDC); hTaskBarWnd = FindWindow("Shell_TrayWnd", 0); hStartButtonWnd = GetWindow(hTaskBarWnd, GW_CHILD); // Now simulate a press on the Start button SendMessage(hButtonWnd, WM_LBUTTONDOWN, MK_LBUTTON, LOWORD(5) + HIWORD(height - 20)); 

Otherwise, you can examine the Shell_TrayWnd window using WinSpy ++ or using a similar utility, perhaps the Start menu is a child window in the tray window.

+1
source
 [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr FindWindow (string lpClassName, string lpWindowName); [DllImport("user32.dll")] public static extern bool ShowWindow (IntPtr hWnd, ShowWindowCommand nCmdShow); int ShowCmd = 5; int HideCmd = 0; ShowWindow(FindWindow("DV2ControlHost", "Start menu"), ShowCmd); 

Should do the trick in Windows 7 at least. To hide again, use "HideCmd" instead of "ShowCmd".

+1
source

All Articles