diff -r 000000000000 -r 6474c204b198 ipc/chromium/src/base/win_util.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipc/chromium/src/base/win_util.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,51 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_WIN_UTIL_H__ +#define BASE_WIN_UTIL_H__ + +#include +#include + +#include + +#include "base/tracked.h" + +namespace win_util { + +// NOTE: Keep these in order so callers can do things like +// "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, +// though. +enum WinVersion { + WINVERSION_PRE_2000 = 0, // Not supported + WINVERSION_2000 = 1, + WINVERSION_XP = 2, + WINVERSION_SERVER_2003 = 3, + WINVERSION_VISTA = 4, + WINVERSION_2008 = 5, + WINVERSION_WIN7 = 6 +}; + +// Returns the running version of Windows. +WinVersion GetWinVersion(); + +// Returns true if the shift key is currently pressed. +bool IsShiftPressed(); + +// Returns true if the ctrl key is currently pressed. +bool IsCtrlPressed(); + +// Returns true if the alt key is currently pressed. +bool IsAltPressed(); + +// Use the Win32 API FormatMessage() function to generate a string, using +// Windows's default Message Compiled resources; ignoring the inserts. +std::wstring FormatMessage(unsigned messageid); + +// Uses the last Win32 error to generate a human readable message string. +std::wstring FormatLastWin32Error(); + +} // namespace win_util + +#endif // BASE_WIN_UTIL_H__