hi all,

i want to get the text of one of the items of the taskbar, i can't see what's wrong with my code, can anybody help?
i get the number of items without problems but i can´t get TabCtrl_GetItem to work....



Code:
HWND       hTaskBar;                
TC_ITEM    tc_item;
char tShTrayWnd[] = "Shell_TrayWnd";
char tRebarCtrl[] = "ReBarWindow32";
char tTaskSwClass[] = "MSTaskSwWClass";
char tSysTabCtrl[] = "SysTabControl32";
int tbiCount;
char  taskbuffer[256];


hTaskBar = FindWindowEx(0, 0, tShTrayWnd, NULL);

if (hTaskBar != NULL) {			 	    
    hTaskBar = FindWindowEx(hTaskBar, NULL, tRebarCtrl, NULL);
    
    if (hTaskBar != NULL) {
        hTaskBar = FindWindowEx(hTaskBar, NULL, tTaskSwClass, NULL);

        if (hTaskBar != NULL) {	
            hTaskBar = FindWindowEx(hTaskBar, NULL, tSysTabCtrl, NULL);					    
            tbiCount = SendMessage(hTaskBar, TCM_GETITEMCOUNT, 0, 0);
            if (tbiCount != 0)  {
	          tc_item.mask = TCIF_TEXT;
                  tc_item.lpReserved1 = 0;
                  tc_item.lpReserved2 = 0;
                  tc_item.pszText = taskbuffer;
                  tc_item.cchTextMax = 250;
                  tc_item.iImage = 0;
                  tc_item.lParam = 0;

                  if (TabCtrl_GetItem(hTaskBar, 1, &tc_item)) {
                      MessageBoxA(hwnd, taskbuffer, taskbuffer, MB_OK);
                 }
            }
     }
}