commit 7802b00e851e78f5900c6dd1b956e0dafbdf9975 Author: Un conejo Date: Sat May 24 10:39:02 2025 -0400 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d706a68 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.o +*.exe +*.res +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1d1f768 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(Walltaker95 VERSION 0.1) +add_executable(wt95 src/main.cpp wt95.rc) +find_package( CURL REQUIRED ) +ENABLE_LANGUAGE(RC) +SET(CMAKE_RC_COMPILE_OBJECT + " -O coff -i -o ") +set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static") +add_compile_options(-g) +target_link_libraries(wt95 CURL::libcurl) diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c0f597 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Walltaker95 +A Walltaker client for legacy Windows versions (<= Windows Vista) + +## Build instructions (CachyOS) +``` +$ paru -Sy cmake mingw-w64-toolchain mingw-w64-curl +$ mkdir build +$ cd build +$ cmake -DCMAKE_TOOLCHAIN_FILE=../TC-mingw.cmake ../ +$ cmake --build . +``` + +Note: You'll need to supply DLLs manually as I haven't set that up to build yet diff --git a/TC-mingw.cmake b/TC-mingw.cmake new file mode 100644 index 0000000..2378695 --- /dev/null +++ b/TC-mingw.cmake @@ -0,0 +1,18 @@ +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) + +# where is the target environment located +set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) + +# adjust the default behavior of the FIND_XXX() commands: +# search programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + +# search headers and libraries in the target environment +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..e69de29 diff --git a/res/128px.ico b/res/128px.ico new file mode 100644 index 0000000..d647ac5 Binary files /dev/null and b/res/128px.ico differ diff --git a/res/16px.ico b/res/16px.ico new file mode 100644 index 0000000..079350e Binary files /dev/null and b/res/16px.ico differ diff --git a/res/256px.ico b/res/256px.ico new file mode 100644 index 0000000..7294433 Binary files /dev/null and b/res/256px.ico differ diff --git a/res/32px.ico b/res/32px.ico new file mode 100644 index 0000000..d40815a Binary files /dev/null and b/res/32px.ico differ diff --git a/res/64px.ico b/res/64px.ico new file mode 100644 index 0000000..d7419e5 Binary files /dev/null and b/res/64px.ico differ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..94c8fe0 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,51 @@ +#include +#include +#include + +//#define _WIN32_WINNT 0x0500 +#include +#include "../wt95.rc" +#include +#include +#include + + +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; + +} diff --git a/wt95.rc b/wt95.rc new file mode 100644 index 0000000..77d3368 --- /dev/null +++ b/wt95.rc @@ -0,0 +1,30 @@ +#define IDI_ICON1 201 + +#ifdef RC_INVOKED + +1 VERSIONINFO +FILEVERSION 0,0,0,1 +PRODUCTVERSION 0,0,0,1 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Meow Boutique" + VALUE "FileDescription", "Walltaker95 - Walltaker client for legacy Windows" + VALUE "FileVersion", "0.1" + VALUE "InternalName", "wt95" + VALUE "LegalCopyright", "conejo" + VALUE "OriginalFilename", "wt95.exe" + VALUE "ProductName", "Walltaker95" + VALUE "ProductVersion", "0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END +2 ICON "res/256px.ico" +IDI_ICON1 ICON "res/16px.ico" +#endif