All pastes #753053 Raw Edit

Mine

public text v1 · immutable
#753053 ·published 2007-10-28 22:26 UTC
rendered paste body
#include <windows.h>
#include <commctrl.h>


int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{

	HWND WindowsMediaPlayer = FindWindow(NULL,"Windows Media Player");
	if(!WindowsMediaPlayer)
	{
		MessageBox(NULL,"Error!","Windows Media Player not found!",MB_ICONEXCLAMATION);
 		return 0;
 	}
	HWND WMPAppHost = FindWindowEx(WindowsMediaPlayer,NULL,"WMPAppHost",NULL);
 	if(!WMPAppHost)
 	{
 		MessageBox(NULL,"Error!","Control not found!",MB_ICONEXCLAMATION);
		return 0;
 	}
 	HWND SkinHost = FindWindowEx(WMPAppHost,NULL,"WMP Skin Host",NULL);
 	if(!SkinHost)

 	{
	MessageBox(NULL,"Error!","Skin Host not found!",MB_ICONEXCLAMATION);
 		return 0;
	}
	HWND irw = FindWindowEx(SkinHost,NULL,NULL,"LibraryContainer");
	
    if(!irw)
	{
		MessageBox(NULL,"Error!","Library Container not found!",MB_ICONEXCLAMATION);
		return 0;
	}

	HWND oi = FindWindowEx(irw,NULL,NULL,"BasketListView");
	
    // Setting up STRUCTURE
	char buffer[256];
    LVITEM what; 
	what.iItem = 0;
	what.mask = LVIF_TEXT; 
	what.pszText = &buffer;
	what.cchTextMax = 256;
	
    LVITEM FAR* pitem;
	pitem = &what;
	

	int a = ListView_GetItem(oi,pitem); // RETURNS 0 , SHOULD RETURN 1[SUCCESS] BUT HELL NO WHYYYY 
	printf("%d",a);

	return 0;
}