walltaker95/src/main.cpp
2025-05-24 10:39:02 -04:00

51 lines
1.4 KiB
C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#define _WIN32_WINNT 0x0500
#include <windows.h>
#include "../wt95.rc"
#include <shellapi.h>
#include <commctrl.h>
#include <curl/curl.h>
int main (int argc, char *argv[]) {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
HWND hwnd = GetConsoleWindow();
NOTIFYICONDATAA nid;
nid.hWnd = hwnd; // handle to the window that will display the tray icon
nid.uID = 100; // unique identifier for the tray icon
nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; // flags to indicate which fields are valid
nid.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));
strcpy(nid.szTip,"Walltaker95\0");
//nid.szTip[]="Walltaker95";
printf("test\n");
if(!curl) {
printf("Curl isn't working for some reason\n");
getchar();
return 0;
}
if (Shell_NotifyIcon(NIM_ADD, &nid)) {
// Tray icon created successfully
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
if (msg.message == nid.uCallbackMessage) {
// Handle the tray icon click here
}
}
} else {
// Error creating tray icon
printf("The tray icon fucked up somehow, oops...\n");
getchar();
}
//curl_easy_cleanup(curl);
return 0;
}