From 5c3039618c8877b29712a5aececb99f8b4a4dd41 Mon Sep 17 00:00:00 2001 From: "msw@chromium.org" Date: Wed, 27 Apr 2011 03:48:14 +0000 Subject: Scrap WNDCLASSEX.hCursor, update GetCursorForPoint. Default to Win arrow in View::GetCursorForPoint & RootView::UpdateCursor. Simplify WidgetWin::SetCursor, avoid sending NULL. Only SetCuror on client events (DWM handles non-client). RIP TextButtonWithHandCursorOver (r57652 through r64531). RIP WindowWin::InitClass & |resize_cursors_|. Add OVERRIDE specifiers liberally. BUG=35356 TEST=Cursor styles shown in Win & Linux toolkit_views. Review URL: http://codereview.chromium.org/6880201 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83123 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/base/win/window_impl.cc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'ui/base/win') diff --git a/ui/base/win/window_impl.cc b/ui/base/win/window_impl.cc index d265621..7c4a6cd 100644 --- a/ui/base/win/window_impl.cc +++ b/ui/base/win/window_impl.cc @@ -197,20 +197,23 @@ std::wstring WindowImpl::GetWindowClassName() { if (ClassRegistrar::GetInstance()->RetrieveClassName(class_info, &name)) return name; + HICON icon = GetDefaultWindowIcon(); + // No class found, need to register one. - WNDCLASSEX class_ex; - class_ex.cbSize = sizeof(WNDCLASSEX); - class_ex.style = class_info.style; - class_ex.lpfnWndProc = base::win::WrappedWindowProc<&WindowImpl::WndProc>; - class_ex.cbClsExtra = 0; - class_ex.cbWndExtra = 0; - class_ex.hInstance = NULL; - class_ex.hIcon = GetDefaultWindowIcon(); - class_ex.hCursor = LoadCursor(NULL, IDC_ARROW); - class_ex.hbrBackground = reinterpret_cast(class_info.background + 1); - class_ex.lpszMenuName = NULL; - class_ex.lpszClassName = name.c_str(); - class_ex.hIconSm = class_ex.hIcon; + WNDCLASSEX class_ex = { + sizeof(WNDCLASSEX), + class_info.style, + base::win::WrappedWindowProc<&WindowImpl::WndProc>, + 0, + 0, + NULL, + icon, + NULL, + reinterpret_cast(class_info.background + 1), + NULL, + name.c_str(), + icon + }; ATOM atom = RegisterClassEx(&class_ex); CHECK(atom) << GetLastError(); -- cgit v1.1