# HG changeset patch # User Olaf Wintermann # Date 1759930943 -7200 # Node ID f5690594b240796293a6d1af514b885f25b0e13c # Parent 7ddf5fb7ec2a742eb1eab126f7b9153ad9cd6f75 add app manifest (win32) diff -r 7ddf5fb7ec2a -r f5690594b240 .hgignore --- a/.hgignore Wed Oct 08 12:36:16 2025 +0200 +++ b/.hgignore Wed Oct 08 15:42:23 2025 +0200 @@ -11,3 +11,4 @@ relre:.qmake.stash$ relre:^.idea/.* relre:^compile_commands.json$ +relre:^application/app.res$ diff -r 7ddf5fb7ec2a -r f5690594b240 application/Makefile --- a/application/Makefile Wed Oct 08 12:36:16 2025 +0200 +++ b/application/Makefile Wed Oct 08 15:42:23 2025 +0200 @@ -39,8 +39,10 @@ all: $(APP_BIN) -$(APP_BIN): $(OBJ) $(BUILD_ROOT)/build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)uitk$(LIB_EXT) - $(LD) -o $(APP_BIN) $(OBJ) $(BUILD_ROOT)/build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)uitk$(LIB_EXT) $(BUILD_ROOT)/build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)ucx$(LIB_EXT) $(LDFLAGS) $(TK_LDFLAGS) +include $(SYS_MAKEFILE) + +$(APP_BIN): $(OBJ) $(RES_FILE) $(BUILD_ROOT)/build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)uitk$(LIB_EXT) + $(LD) -o $(APP_BIN) $(OBJ) $(RES_FILE) $(BUILD_ROOT)/build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)uitk$(LIB_EXT) $(BUILD_ROOT)/build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)ucx$(LIB_EXT) $(LDFLAGS) $(TK_LDFLAGS) ../build/application/%$(OBJ_EXT): %.c $(CC) $(CFLAGS) $(TK_CFLAGS) -o $@ -c $< diff -r 7ddf5fb7ec2a -r f5690594b240 application/Makefile.unix diff -r 7ddf5fb7ec2a -r f5690594b240 application/Makefile.win32 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/application/Makefile.win32 Wed Oct 08 15:42:23 2025 +0200 @@ -0,0 +1,5 @@ +RES_FILE = app.res + +$(RES_FILE): app.rc app.manifest + llvm-rc app.rc + diff -r 7ddf5fb7ec2a -r f5690594b240 application/app.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/application/app.manifest Wed Oct 08 15:42:23 2025 +0200 @@ -0,0 +1,15 @@ + + + + + + + + diff -r 7ddf5fb7ec2a -r f5690594b240 application/app.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/application/app.rc Wed Oct 08 15:42:23 2025 +0200 @@ -0,0 +1,1 @@ +1 24 "app.manifest" diff -r 7ddf5fb7ec2a -r f5690594b240 application/main.c --- a/application/main.c Wed Oct 08 12:36:16 2025 +0200 +++ b/application/main.c Wed Oct 08 15:42:23 2025 +0200 @@ -1131,7 +1131,7 @@ ui_button(obj, .label = "Test 2-2", .hfill = TRUE, .hexpand = TRUE, .margin_top = 20); ui_button(obj, .label = "Test 2-3", .margin_top = 30); ui_newline(obj); - ui_button(obj, .label = "Test 3", .colspan = 3, .fill = TRUE); + ui_button(obj, .label = "Test 3XX", .colspan = 3, .fill = TRUE); ui_show(obj); } diff -r 7ddf5fb7ec2a -r f5690594b240 ui/win32/toolkit.c --- a/ui/win32/toolkit.c Wed Oct 08 12:36:16 2025 +0200 +++ b/ui/win32/toolkit.c Wed Oct 08 15:42:23 2025 +0200 @@ -41,6 +41,8 @@ #include #include +#include + static const char *application_name; static ui_callback startup_func; @@ -59,6 +61,11 @@ uic_load_app_properties(); ui_window_init(); + + INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_WIN95_CLASSES }; + InitCommonControlsEx(&icex); + + SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); } const char* ui_appname() { diff -r 7ddf5fb7ec2a -r f5690594b240 ui/win32/window.c --- a/ui/win32/window.c Wed Oct 08 12:36:16 2025 +0200 +++ b/ui/win32/window.c Wed Oct 08 15:42:23 2025 +0200 @@ -75,7 +75,7 @@ wc.hInstance = hInstance; wc.lpszClassName = mainWindowClass; wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); if(!RegisterClassExA(&wc)) { MessageBox(NULL, "RegisterClassEx failed", "Error", MB_ICONERROR); @@ -86,7 +86,7 @@ static UiObject* create_window(const char *title, void *window_data, bool simple) { UiObject *obj = uic_object_new_toplevel(); obj->window = window_data; - + HWND hwnd = CreateWindowExA( 0, "UiMainWindow",