preliminary update checker

This commit is contained in:
berkeviktor@aol.com
2010-08-30 10:08:17 +02:00
parent fe5cb63a59
commit b2ba474f06
4 changed files with 89 additions and 24 deletions

View File

@@ -0,0 +1,36 @@
#include <windows.h>
#include <wininet.h>
char* check_version ()
{
HINTERNET hINet, hFile;
hINet = InternetOpen("XChat-WDK Update Checker", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
if (!hINet)
{
return "error";
}
hFile = InternetOpenUrl (hINet, "http://xchat-wdk.googlecode.com/hg/version.txt", NULL, 0, 0, 0);
if (hFile)
{
static char buffer[1024];
DWORD dwRead;
while (InternetReadFile(hFile, buffer, 1023, &dwRead))
{
if (dwRead == 0)
{
break;
}
buffer[dwRead] = 0;
}
return buffer;
InternetCloseHandle (hFile);
}
InternetCloseHandle (hINet);
return "error";
}

View File

@@ -0,0 +1 @@
char* check_version ();