#include <windows.h>
#include <winsock.h>

#include "main.h"

extern HINSTANCE inst;
extern HWND hwnd;

extern char host[255], username[20], password[20], title[255];
extern int port, default_action, update_delay;

extern char szAppName[], AboutText[];

extern HWND ConfigWnd, VolumeWnd;

// --------------------------------------------------------------------------------
// Thread to update title in systray tooltip
DWORD WINAPI TitleThread(LPVOID param)
{
	while(true)
	{
		MakeRequest(host,port,"/smalltitle",false,false,true);
		if (StrComp(title,""))
			wsprintf(title,"%s",szAppName);
		systray_modify(hwnd,1030,LoadIcon(inst, MAKEINTRESOURCE(GetIconID())),title);
		//MessageBox(hwnd,title,"Title",MB_OK | MB_TOPMOST);
		Sleep(update_delay*1000);
	}

	return true;
}

