mirror of
https://github.com/taigrr/wails.git
synced 2026-04-16 19:55:05 -07:00
fiX: unicode fixes for windows
This commit is contained in:
@@ -13,7 +13,7 @@ package webview
|
||||
#cgo linux openbsd freebsd CFLAGS: -DWEBVIEW_GTK=1 -Wno-deprecated-declarations
|
||||
#cgo linux openbsd freebsd pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
|
||||
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99 -DUNICODE=1
|
||||
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99 -DUNICODE=1 -D_UNICODE=1
|
||||
#cgo windows LDFLAGS: -lole32 -lcomctl32 -loleaut32 -luuid -lgdi32
|
||||
|
||||
#cgo darwin CFLAGS: -DWEBVIEW_COCOA=1 -x objective-c
|
||||
|
||||
@@ -58,6 +58,7 @@ extern "C"
|
||||
#elif defined(WEBVIEW_WINAPI)
|
||||
#define CINTERFACE
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include <commctrl.h>
|
||||
#include <exdisp.h>
|
||||
@@ -1350,8 +1351,8 @@ struct webview_priv
|
||||
}
|
||||
|
||||
#define WEBVIEW_KEY_FEATURE_BROWSER_EMULATION \
|
||||
"Software\\Microsoft\\Internet " \
|
||||
"Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION"
|
||||
_T("Software\\Microsoft\\Internet " \
|
||||
"Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION")
|
||||
|
||||
static int webview_fix_ie_compat_mode()
|
||||
{
|
||||
@@ -1363,7 +1364,7 @@ struct webview_priv
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
for (p = &appname[strlen(appname) - 1]; p != appname && *p != '\\'; p--)
|
||||
for (p = &appname[_tcslen(appname) - 1]; p != appname && *p != _T('\\'); p--)
|
||||
{
|
||||
}
|
||||
p++;
|
||||
@@ -1872,14 +1873,30 @@ struct webview_priv
|
||||
type |= MB_ICONERROR;
|
||||
break;
|
||||
}
|
||||
#ifdef UNICODE
|
||||
WCHAR *wtitle = webview_to_utf16(title);
|
||||
WCHAR *warg = webview_to_utf16(arg);
|
||||
MessageBox(w->priv.hwnd, warg, wtitle, type);
|
||||
GlobalFree(warg);
|
||||
GlobalFree(wtitle);
|
||||
#else
|
||||
MessageBox(w->priv.hwnd, arg, title, type);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
WEBVIEW_API void webview_terminate(struct webview *w) { PostQuitMessage(0); }
|
||||
WEBVIEW_API void webview_exit(struct webview *w) { OleUninitialize(); }
|
||||
WEBVIEW_API void webview_print_log(const char *s) { OutputDebugString(s); }
|
||||
WEBVIEW_API void webview_print_log(const char *s) {
|
||||
#ifdef UNICODE
|
||||
WCHAR *ws = webview_to_utf16(s);
|
||||
OutputDebugString(ws);
|
||||
GlobalFree(ws);
|
||||
#else
|
||||
OutputDebugString(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* WEBVIEW_WINAPI */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user