Initial commit

This commit is contained in:
Nick Martin 2025-05-24 10:39:02 -04:00
commit 7802b00e85
12 changed files with 126 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
*.o
*.exe
*.res
build/

10
CMakeLists.txt Normal file
View file

@ -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
"<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
add_compile_options(-g)
target_link_libraries(wt95 CURL::libcurl)

13
README.md Normal file
View file

@ -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

18
TC-mingw.cmake Normal file
View file

@ -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)

0
config.ini Normal file
View file

BIN
res/128px.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
res/16px.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
res/256px.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
res/32px.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
res/64px.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

51
src/main.cpp Normal file
View file

@ -0,0 +1,51 @@
#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;
}

30
wt95.rc Normal file
View file

@ -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