OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/win/win_util.h" | 5 #include "base/win/win_util.h" |
6 | 6 |
7 #include <aclapi.h> | 7 #include <aclapi.h> |
8 #include <lm.h> | 8 #include <lm.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 HWND osk = ::FindWindow(kOSKClassName, NULL); | 322 HWND osk = ::FindWindow(kOSKClassName, NULL); |
323 if (::IsWindow(osk) && ::IsWindowEnabled(osk)) { | 323 if (::IsWindow(osk) && ::IsWindowEnabled(osk)) { |
324 PostMessage(osk, WM_SYSCOMMAND, SC_CLOSE, 0); | 324 PostMessage(osk, WM_SYSCOMMAND, SC_CLOSE, 0); |
325 return true; | 325 return true; |
326 } | 326 } |
327 return false; | 327 return false; |
328 } | 328 } |
329 | 329 |
330 typedef HWND (*MetroRootWindow) (); | 330 typedef HWND (*MetroRootWindow) (); |
331 | 331 |
332 // As of this writing, GetMonitorInfo function seem to return wrong values | |
333 // for rcWork.left and rcWork.top in case of split screen situation inside | |
334 // metro mode. In order to get required values we query for core window screen | |
335 // coordinates. | |
336 // TODO(shrikant): Remove detour code once GetMonitorInfo is fixed for 8.1. | |
337 BOOL GetMonitorInfoWrapper(HMONITOR monitor, MONITORINFO* mi) { | |
338 BOOL ret = ::GetMonitorInfo(monitor, mi); | |
339 #if !defined(USE_ASH) | |
340 if (base::win::IsMetroProcess() && | |
341 base::win::GetVersion() >= base::win::VERSION_WIN8_1) { | |
342 static MetroRootWindow root_window = NULL; | |
343 if (!root_window) { | |
344 HMODULE metro = base::win::GetMetroModule(); | |
345 // There are apparently instances when current process is inside metro | |
346 // environment but metro driver dll is not loaded. | |
347 if (!metro) { | |
348 return ret; | |
349 } | |
350 root_window = reinterpret_cast<MetroRootWindow>( | |
351 ::GetProcAddress(metro, "GetRootWindow")); | |
352 } | |
353 ret = ::GetWindowRect(root_window(), &(mi->rcWork)); | |
354 } | |
355 #endif | |
356 return ret; | |
357 } | |
358 | |
359 bool IsEnrolledToDomain() { | 332 bool IsEnrolledToDomain() { |
360 LPWSTR domain; | 333 LPWSTR domain; |
361 NETSETUP_JOIN_STATUS join_status; | 334 NETSETUP_JOIN_STATUS join_status; |
362 if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success) | 335 if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success) |
363 return false; | 336 return false; |
364 ::NetApiBufferFree(domain); | 337 ::NetApiBufferFree(domain); |
365 | 338 |
366 return join_status == ::NetSetupDomainName; | 339 return join_status == ::NetSetupDomainName; |
367 } | 340 } |
368 | 341 |
(...skipping 18 matching lines...) Expand all Loading... |
387 #if defined(_MSC_FULL_VER) | 360 #if defined(_MSC_FULL_VER) |
388 #pragma message(__PPOUT__(_MSC_FULL_VER)) | 361 #pragma message(__PPOUT__(_MSC_FULL_VER)) |
389 #endif | 362 #endif |
390 | 363 |
391 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") | 364 #pragma message("Visual Studio 2012 x86 must be updated to at least Update 1") |
392 #error Must install Update 1 to Visual Studio 2012. | 365 #error Must install Update 1 to Visual Studio 2012. |
393 #endif | 366 #endif |
394 | 367 |
395 #endif // _MSC_VER | 368 #endif // _MSC_VER |
396 | 369 |
OLD | NEW |