You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
4.6 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: winstl/shims/attribute/get_HKEY.hpp
  3. *
  4. * Purpose: get_HKEY attribute shim.
  5. *
  6. * Created: 1st June 2007
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2007-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file winstl/shims/attribute/get_HKEY.hpp
  40. *
  41. * \brief [C++ only] Definition of stlsoft::get_HKEY attribute shim
  42. * functions for Win32 types
  43. * (\ref group__library__shims__hkey_attribute "Window Attribute Shims").
  44. */
  45. #ifndef WINSTL_INCL_SHIMS_ATTRIBUTE_HPP_GET_HKEY
  46. #define WINSTL_INCL_SHIMS_ATTRIBUTE_HPP_GET_HKEY
  47. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  48. # define WINSTL_VER_SHIMS_ATTRIBUTE_HPP_GET_HKEY_MAJOR 1
  49. # define WINSTL_VER_SHIMS_ATTRIBUTE_HPP_GET_HKEY_MINOR 0
  50. # define WINSTL_VER_SHIMS_ATTRIBUTE_HPP_GET_HKEY_REVISION 1
  51. # define WINSTL_VER_SHIMS_ATTRIBUTE_HPP_GET_HKEY_EDIT 2
  52. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  53. /* /////////////////////////////////////////////////////////////////////////
  54. * Includes
  55. */
  56. #ifndef WINSTL_INCL_WINSTL_H_WINSTL
  57. # include <winstl/winstl.h>
  58. #endif /* !WINSTL_INCL_WINSTL_H_WINSTL */
  59. /* /////////////////////////////////////////////////////////////////////////
  60. * Namespace
  61. */
  62. #ifndef _WINSTL_NO_NAMESPACE
  63. # if defined(_STLSOFT_NO_NAMESPACE) || \
  64. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  65. /* There is no stlsoft namespace, so must define ::winstl */
  66. namespace winstl
  67. {
  68. # else
  69. /* Define stlsoft::winstl_project */
  70. namespace stlsoft
  71. {
  72. namespace winstl_project
  73. {
  74. # endif /* _STLSOFT_NO_NAMESPACE */
  75. #endif /* !_WINSTL_NO_NAMESPACE */
  76. /* /////////////////////////////////////////////////////////////////////////
  77. * get_HKEY
  78. *
  79. * This can be applied to an expression, and the return value is the
  80. * corresponding HKEY.
  81. */
  82. /* HKEY */
  83. /** \brief Access the HKEY of the given HKEY
  84. *
  85. * \ingroup group__library__shims__hkey_attribute
  86. *
  87. * This access <a href = "http://stlsoft.org/white_papers.html#shims">shim</a>
  88. * retrieves the HKEY registry handle for the given HKEY handle.
  89. *
  90. * \param h A HKEY whose corresponding HKEY will be retrieved
  91. * \return The HKEY corresponding to the given HKEY \c h
  92. */
  93. inline HKEY get_HKEY(HKEY h)
  94. {
  95. return h;
  96. }
  97. ////////////////////////////////////////////////////////////////////////////
  98. // Unit-testing
  99. #ifdef STLSOFT_UNITTEST
  100. # include "./unittest/get_HKEY_unittest_.h"
  101. #endif /* STLSOFT_UNITTEST */
  102. /* ////////////////////////////////////////////////////////////////////// */
  103. #ifndef _WINSTL_NO_NAMESPACE
  104. # if defined(_STLSOFT_NO_NAMESPACE) || \
  105. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  106. } // namespace winstl
  107. # else
  108. } // namespace winstl_project
  109. } // namespace stlsoft
  110. # endif /* _STLSOFT_NO_NAMESPACE */
  111. #endif /* !_WINSTL_NO_NAMESPACE */
  112. /* ////////////////////////////////////////////////////////////////////// */
  113. #endif /* WINSTL_INCL_SHIMS_ATTRIBUTE_HPP_GET_HKEY */
  114. /* ///////////////////////////// end of file //////////////////////////// */