In my windows program I use this code, when using it it crashes on close:

Code:
char URL[20];
	sprintf(URL, "http://newyork.yankees.mlb.com/NASApp/mlb/nyy/homepage/nyy_homepage.jsp"); //test url
	char FileName[15] = "yankees.txt";
	URLDownloadToFile(NULL, URL, FileName, 0, NULL);
	
	FILE *myfile;

	char big[5000];
	FILE *in;
	in = fopen(FileName,"r");
	while (!feof(in))
	{
		if ( fgets(big,sizeof(big),in) != NULL)  
		{
			  AppendToEdit(big, Test);
		}
	}
	fclose(in);