00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00047 #ifndef WINSTL_INCL_WINSTL_WINDOW_HPP_SETCURSOR_SCOPE
00048 #define WINSTL_INCL_WINSTL_WINDOW_HPP_SETCURSOR_SCOPE
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define WINSTL_VER_WINSTL_WINDOW_HPP_SETCURSOR_SCOPE_MAJOR 4
00052 # define WINSTL_VER_WINSTL_WINDOW_HPP_SETCURSOR_SCOPE_MINOR 0
00053 # define WINSTL_VER_WINSTL_WINDOW_HPP_SETCURSOR_SCOPE_REVISION 1
00054 # define WINSTL_VER_WINSTL_WINDOW_HPP_SETCURSOR_SCOPE_EDIT 44
00055 #endif
00056
00057
00058
00059
00060
00061 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00062 # include <winstl/winstl.h>
00063 #endif
00064 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_HPP_STRING
00065 # include <stlsoft/shims/access/string.hpp>
00066 #endif
00067 #ifndef WINSTL_INCL_WINSTL_SHIMS_ACCESS_HPP_STRING
00068 # include <winstl/shims/access/string.hpp>
00069 #endif
00070
00071
00072
00073
00074
00075 #ifndef _WINSTL_NO_NAMESPACE
00076 # if defined(_STLSOFT_NO_NAMESPACE) || \
00077 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00078
00079 namespace winstl
00080 {
00081 # else
00082
00083
00084 namespace stlsoft
00085 {
00086
00087 namespace winstl_project
00088 {
00089
00090 # endif
00091 #endif
00092
00093
00094
00095
00096
00097
00105 class setcursor_scope
00106 {
00107 public:
00109 typedef setcursor_scope class_type;
00110
00111
00112 public:
00116 ss_explicit_k setcursor_scope(HCURSOR hcur)
00117 : m_hcurLast(::SetCursor(hcur))
00118 {}
00119 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00123 template <ss_typename_param_k S>
00124 setcursor_scope(HINSTANCE hinst, S const& name)
00125 : m_hcurLast(::SetCursor(load_(hinst, stlsoft_ns_qual(c_str_ptr)(name))))
00126 {}
00127 #endif
00131 setcursor_scope(HINSTANCE hinst, ws_char_a_t const* name)
00132 : m_hcurLast(::SetCursor(load_(hinst, name)))
00133 {}
00137 setcursor_scope(HINSTANCE hinst, ws_char_w_t const* name)
00138 : m_hcurLast(::SetCursor(load_(hinst, name)))
00139 {}
00143 setcursor_scope(HINSTANCE hinst, int id)
00144 : m_hcurLast(::SetCursor(::LoadCursor(hinst, MAKEINTRESOURCE(id))))
00145 {}
00147 ~setcursor_scope() stlsoft_throw_0()
00148 {
00149 ::SetCursor(m_hcurLast);
00150 }
00151
00154 private:
00155 static HCURSOR load_(HINSTANCE hinst, ws_char_a_t const* name)
00156 {
00157 return ::LoadCursorA(hinst, name);
00158 }
00159 static HCURSOR load_(HINSTANCE hinst, ws_char_w_t const* name)
00160 {
00161 return ::LoadCursorW(hinst, name);
00162 }
00164
00167 private:
00168 HCURSOR m_hcurLast;
00170
00173 private:
00174 setcursor_scope(class_type const&);
00175 class_type& operator =(class_type const&);
00177 };
00178
00179
00180
00181 #ifndef _WINSTL_NO_NAMESPACE
00182 # if defined(_STLSOFT_NO_NAMESPACE) || \
00183 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00184 }
00185 # else
00186 }
00187 }
00188 # endif
00189 #endif
00190
00191
00192
00193 #endif
00194
00195