diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2020-05-24 15:44:22 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2020-05-24 15:44:22 (GMT) |
commit | e9d72bbaa4a4cef256b3d3480ed1136b8651d019 (patch) | |
tree | 5b555bb43f3c32b4ff86fe07b3b06f5000ade4d9 /win/ttkWinMonitor.c | |
parent | a48a5b55179978d3f31371c90d9be6eaa6931f17 (diff) | |
parent | ad1ded4a7f409e06bd6e1b33da463e6c7cd844af (diff) | |
download | tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.zip tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.tar.gz tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.tar.bz2 |
Merge trunk
Diffstat (limited to 'win/ttkWinMonitor.c')
-rw-r--r-- | win/ttkWinMonitor.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index 5d9cf0a..1d31c1c 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -22,7 +22,7 @@ typedef struct { int index; } SystemColorEntry; -static SystemColorEntry sysColors[] = { +static const SystemColorEntry sysColors[] = { { "System3dDarkShadow", COLOR_3DDKSHADOW }, { "System3dLight", COLOR_3DLIGHT }, { "SystemActiveBorder", COLOR_ACTIVEBORDER }, @@ -55,7 +55,7 @@ static SystemColorEntry sysColors[] = { static void RegisterSystemColors(Tcl_Interp *interp) { Ttk_ResourceCache cache = Ttk_GetResourceCache(interp); - SystemColorEntry *sysColor; + const SystemColorEntry *sysColor; for (sysColor = sysColors; sysColor->name; ++sysColor) { DWORD pixel = GetSysColor(sysColor->index); @@ -70,29 +70,29 @@ static void RegisterSystemColors(Tcl_Interp *interp) static HWND CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) { - WNDCLASSEX wc; + WNDCLASSEXW wc; HWND hwnd = NULL; - TCHAR title[32] = TEXT("TtkMonitorWindow"); - TCHAR name[32] = TEXT("TtkMonitorClass"); + WCHAR title[32] = L"TtkMonitorWindow"; + WCHAR name[32] = L"TtkMonitorClass"; - wc.cbSize = sizeof(WNDCLASSEX); + wc.cbSize = sizeof(WNDCLASSEXW); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hinst; - wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wc.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wc.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); wc.hbrBackground = (HBRUSH)COLOR_WINDOW; wc.lpszMenuName = name; wc.lpszClassName = name; - if (RegisterClassEx(&wc)) { - hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW, + if (RegisterClassExW(&wc)) { + hwnd = CreateWindowW( name, title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hinst, NULL ); - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) interp); + SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) interp); ShowWindow(hwnd, SW_HIDE); UpdateWindow(hwnd); } @@ -109,7 +109,7 @@ DestroyThemeMonitorWindow(void *clientData) static LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - Tcl_Interp *interp = (Tcl_Interp *)GetWindowLongPtr(hwnd, GWLP_USERDATA); + Tcl_Interp *interp = (Tcl_Interp *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); Ttk_Theme theme; switch (msg) { @@ -137,7 +137,7 @@ WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) } break; } - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcW(hwnd, msg, wp, lp); } /* |