mirror of
https://github.com/fltk/fltk.git
synced 2026-05-21 14:31:40 +08:00
Fixed Windows class name (xclass) setup and caching mechanism. This was
not yet completely converted to UTF-8. Cleaned up related code, removed old comments. Tested and confirmed that the xclass() setup works and that different icons can be set for different window classes (as it was in FLTK 1.1.10). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7704 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+11
-11
@@ -1400,14 +1400,16 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
first_class_name = class_name;
|
||||
}
|
||||
|
||||
const wchar_t* class_namew = L"FLTK";
|
||||
const wchar_t* message_namew = L"FLTK::ThreadWakeup";
|
||||
if (!class_name_list.has_name(class_name)) {
|
||||
WNDCLASSEX wc;
|
||||
WNDCLASSEXW wcw;
|
||||
wchar_t class_namew[100]; // (limited) buffer for Windows class name
|
||||
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
// convert UTF-8 class_name to wchar_t for RegisterClassExW and CreateWindowExW
|
||||
|
||||
fl_utf8toUtf16(class_name,strlen(class_name), // in
|
||||
(unsigned short*)class_namew, // out
|
||||
sizeof(class_namew)/sizeof(wchar_t)); // max. size
|
||||
|
||||
if (!class_name_list.has_name(class_name)) {
|
||||
WNDCLASSEXW wcw;
|
||||
memset(&wcw, 0, sizeof(wcw));
|
||||
wcw.cbSize = sizeof(WNDCLASSEXW);
|
||||
|
||||
@@ -1428,13 +1430,11 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
wcw.hbrBackground = NULL;
|
||||
wcw.lpszMenuName = NULL;
|
||||
wcw.lpszClassName = class_namew;
|
||||
wcw.cbSize = sizeof(WNDCLASSEXW);
|
||||
RegisterClassExW(&wcw);
|
||||
class_name_list.add_name((const char *)class_namew);
|
||||
class_name_list.add_name(class_name);
|
||||
}
|
||||
|
||||
// const char* message_name = "FLTK::ThreadWakeup";
|
||||
// if (!fl_wake_msg) fl_wake_msg = RegisterWindowMessage(message_name);
|
||||
const wchar_t* message_namew = L"FLTK::ThreadWakeup";
|
||||
if (!fl_wake_msg) fl_wake_msg = RegisterWindowMessageW(message_namew);
|
||||
|
||||
HWND parent;
|
||||
|
||||
Reference in New Issue
Block a user