المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : right-click on windows taskbar



C++ Programming
07-19-2011, 04:40 PM
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.