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

مشاهدة النسخة كاملة : Taskbar button text [modified]



C++ Programming
07-29-2011, 07:11 PM
I am trying to get the list of windows displayed in the windows taskbar and am doing so in the following manner:
HWND hDesktop = GetDesktopWindow(); HWND hTray = FindWindow(_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") , _T("Running Applications") ); long cnt = SendMessage(hToolbar, TB_BUTTONCOUNT,0,0); long pid,hprocess,text,len; WCHAR * buttontext[128]; GetWindowThreadProcessId(hToolbar(LPDWORD)pid); hprocess = (long)OpenProcess(PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_VM_OPERATION,0,pid); text = (long)VirtualAllocEx((HANDLE)hprocess,0,sizeof(buttontext),MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); for(int i=0;i-1) { ReadProcessMemory((HANDLE)hprocess, (LPCVOID)text,buttontext,sizeof(buttontext),NULL); wcout<span class="code-keyword">