Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_WIN_UTIL_H__
6 #define BASE_WIN_UTIL_H__
8 #include <windows.h>
9 #include <aclapi.h>
11 #include <string>
13 #include "base/tracked.h"
15 namespace win_util {
17 // NOTE: Keep these in order so callers can do things like
18 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values,
19 // though.
20 enum WinVersion {
21 WINVERSION_PRE_2000 = 0, // Not supported
22 WINVERSION_2000 = 1,
23 WINVERSION_XP = 2,
24 WINVERSION_SERVER_2003 = 3,
25 WINVERSION_VISTA = 4,
26 WINVERSION_2008 = 5,
27 WINVERSION_WIN7 = 6
28 };
30 // Returns the running version of Windows.
31 WinVersion GetWinVersion();
33 // Returns true if the shift key is currently pressed.
34 bool IsShiftPressed();
36 // Returns true if the ctrl key is currently pressed.
37 bool IsCtrlPressed();
39 // Returns true if the alt key is currently pressed.
40 bool IsAltPressed();
42 // Use the Win32 API FormatMessage() function to generate a string, using
43 // Windows's default Message Compiled resources; ignoring the inserts.
44 std::wstring FormatMessage(unsigned messageid);
46 // Uses the last Win32 error to generate a human readable message string.
47 std::wstring FormatLastWin32Error();
49 } // namespace win_util
51 #endif // BASE_WIN_UTIL_H__