fix wrong w32 string type

Tue, 15 Jul 2025 12:16:34 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 15 Jul 2025 12:16:34 +0200
changeset 666
86c3f109ed3b
parent 665
73689d24080c
child 667
35c64574f862

fix wrong w32 string type

application/main.c file | annotate | diff | comparison | revisions
ui/win32/window.c file | annotate | diff | comparison | revisions
--- a/application/main.c	Tue Jul 15 12:09:51 2025 +0200
+++ b/application/main.c	Tue Jul 15 12:16:34 2025 +0200
@@ -1014,7 +1014,7 @@
 #ifdef UI_WIN32
 
 void application_startup(UiEvent *event, void *data) {
-	UiObject *obj = ui_window("Test", NULL);
+	UiObject *obj = ui_window("Test w32", NULL);
 	
 }
 
--- a/ui/win32/window.c	Tue Jul 15 12:09:51 2025 +0200
+++ b/ui/win32/window.c	Tue Jul 15 12:16:34 2025 +0200
@@ -39,7 +39,7 @@
 
 static HINSTANCE hInstance;
 
-static const wchar_t *mainWindowClass = L"UiMainWindow";
+static const char *mainWindowClass = "UiMainWindow";
 
 LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
     switch(uMsg) {
@@ -62,7 +62,7 @@
     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
 
-    if(!RegisterClassEx(&wc)) {
+    if(!RegisterClassExA(&wc)) {
         MessageBox(NULL, "RegisterClassEx failed", "Error", MB_ICONERROR);
         exit(-1);
     }
@@ -72,10 +72,10 @@
     UiObject *obj = uic_object_new_toplevel();
     obj->window = window_data;
 	
-	HWND hwnd = CreateWindowEx(
+	HWND hwnd = CreateWindowExA(
 			0,
-			L"UiMainWindow",
-			"Test",
+			"UiMainWindow",
+			title,
 			WS_OVERLAPPEDWINDOW | WS_VISIBLE,
             CW_USEDEFAULT,
 			CW_USEDEFAULT,

mercurial