right-click on windows taskbar
-
I need to right-click on the windows taskbar on the button of a particular application and then select one of the actions in the menu (maximize,restore,close/exit). Have been trying to get a handle to the taskbar as follows: HWND hDesktop = GetDesktopWindow(); HWND hTray = FindWindowEx( hDesktop, NULL, _T("Shell_TrayWnd"), NULL ); HWND hReBar = FindWindowEx( hTray, NULL, _T("ReBarWindow32") , NULL ); HWND hTask = FindWindowEx( hReBar, NULL, _T("MSTaskSwWClass") , NULL ); HWND hToolbar = FindWindowEx( hTask, NULL, _T("ToolbarWindow32") , NULL ); But I dont know what to do beyond that or if I am actually getting the correct handle.
-
I need to right-click on the windows taskbar on the button of a particular application and then select one of the actions in the menu (maximize,restore,close/exit). Have been trying to get a handle to the taskbar as follows: HWND hDesktop = GetDesktopWindow(); HWND hTray = FindWindowEx( hDesktop, NULL, _T("Shell_TrayWnd"), NULL ); HWND hReBar = FindWindowEx( hTray, NULL, _T("ReBarWindow32") , NULL ); HWND hTask = FindWindowEx( hReBar, NULL, _T("MSTaskSwWClass") , NULL ); HWND hToolbar = FindWindowEx( hTask, NULL, _T("ToolbarWindow32") , NULL ); But I dont know what to do beyond that or if I am actually getting the correct handle.
To do this you can find the Window that you need to work on. Then send it the WM_SYSCOMMAND[^] message. For example to send the restore command -
SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
Here
hWnd
is the handle returned byFindWindow
.«_Superman_» _I love work. It gives me something to do between weekends.
-
To do this you can find the Window that you need to work on. Then send it the WM_SYSCOMMAND[^] message. For example to send the restore command -
SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
Here
hWnd
is the handle returned byFindWindow
.«_Superman_» _I love work. It gives me something to do between weekends.
What I want to do is to right-click on a Button on the TaskBar corresponding to a particular running application and then select one of the actions from the Menu that shows. Any suggestions?
-
I need to right-click on the windows taskbar on the button of a particular application and then select one of the actions in the menu (maximize,restore,close/exit). Have been trying to get a handle to the taskbar as follows: HWND hDesktop = GetDesktopWindow(); HWND hTray = FindWindowEx( hDesktop, NULL, _T("Shell_TrayWnd"), NULL ); HWND hReBar = FindWindowEx( hTray, NULL, _T("ReBarWindow32") , NULL ); HWND hTask = FindWindowEx( hReBar, NULL, _T("MSTaskSwWClass") , NULL ); HWND hToolbar = FindWindowEx( hTask, NULL, _T("ToolbarWindow32") , NULL ); But I dont know what to do beyond that or if I am actually getting the correct handle.