
// Winamp actions
#define WA_PREV			101
#define WA_PLAY			102
#define WA_PAUSE		103
#define WA_STOP			104
#define WA_NEXT			105

#define RES_OK			201
#define RES_AUTH		202
#define RES_NOTFOUND	205
#define RES_BADREQUEST	206
#define RES_UNKNOWN		203
#define RES_FAIL		204

#define TIMER_ID		30


// config.cpp
void NewConfig();
BOOL CALLBACK ConfigServerWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK ConfigSystrayWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK ConfigAuthWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK ConfigAboutWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK ConfigWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
void config_write();
void config_read();
BOOL CALLBACK VolumeWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);



// connection.cpp
bool StartWinSock();
void prints(SOCKET socket, char * string);
void printsi(SOCKET socket,int number);
bool MakeRequest(char * host, int port, char * url, bool verbose, bool auth, bool gettitle);
int WASend(char * command);
void ToBase64(char * instr, char * outstr);
int GetResponse(SOCKET socket, bool gettitle);
char * GetAString(char* chptr, char* text);
char * SkipHeader(char * chptr);
char * GetALine(char * chptr, char * text);
bool StrComp(char * string1, char * string2);
char ToLowerCase(char c);

// main.cpp
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow);

void SendDefaultAction();
int GetIconID();
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
int systray_modify(HWND hwnd, UINT uID, HICON hIcon, LPSTR lpszTip);
int systray_add(HWND hwnd, UINT uID, HICON hIcon, LPSTR lpszTip);
int systray_del(HWND hwnd, UINT uID);


// title.cpp
DWORD WINAPI TitleThread(LPVOID param);
