-
Re: application?
ok this is my final code:
i dint add the ProccessId check yet tho.
completly resolved. thanks for your help arjay!
Code:
if(::GetWindow(hWnd, GW_OWNER) || !::IsWindowVisible(hWnd) || !(::GetWindowLong(hWnd, GWL_STYLE) & WS_CAPTION))
return TRUE;
HICON hIcon = (HICON)::SendMessage(hWnd, WM_GETICON, ICON_BIG, 0);
if(!hIcon)
hIcon = (HICON)::GetClassLong(hWnd, GCL_HICON);
HICON hIconSm = (HICON)::SendMessage(hWnd, WM_GETICON, ICON_SMALL, 0);
if(!hIconSm)
hIconSm = (HICON)::GetClassLong(hWnd, GCL_HICONSM);
int iX = GView.ImageList.Add(hIcon ? hIcon : hIconSm);
if(iX < 0)
return TRUE;
GView.ImageListSmall.Add(hIconSm ? hIconSm : hIcon);
LPTSTR sText = NULL;
int iY = ::GetWindowTextLength(hWnd) + 1;
if(iY > 1)
{
sText = new TCHAR[iY];
::GetWindowText(hWnd, sText, iY);
}
iY = GView.InsertItem(sText, iX);
if(iY >= 0)
if(::IsHungAppWindow(hWnd))
GView.SetItem(iY, 1, "Hanging");
else
GView.SetItem(iY, 1, "Running");
if(sText)
delete[] sText;
return TRUE;