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
00041
00049 #ifndef WINSTL_INCL_WINSTL_WINDOW_HPP_WINDOW_TRAITS
00050 #define WINSTL_INCL_WINSTL_WINDOW_HPP_WINDOW_TRAITS
00051
00052 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00053 # define WINSTL_VER_WINSTL_WINDOW_HPP_WINDOW_TRAITS_MAJOR 4
00054 # define WINSTL_VER_WINSTL_WINDOW_HPP_WINDOW_TRAITS_MINOR 1
00055 # define WINSTL_VER_WINSTL_WINDOW_HPP_WINDOW_TRAITS_REVISION 1
00056 # define WINSTL_VER_WINSTL_WINDOW_HPP_WINDOW_TRAITS_EDIT 31
00057 #endif
00058
00059
00060
00061
00062
00063 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00064 # include <winstl/winstl.h>
00065 #endif
00066 #ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_HPP_STRING
00067 # include <stlsoft/shims/access/string.hpp>
00068 #endif
00069 #ifndef WINSTL_INCL_WINSTL_SHIMS_ACCESS_HPP_STRING
00070 # include <winstl/shims/access/string.hpp>
00071 #endif
00072 #ifndef WINSTL_INCL_WINSTL_SYSTEM_HPP_SYSTEM_TRAITS
00073 # include <winstl/system/system_traits.hpp>
00074 #endif
00075
00076
00077
00078
00079
00080 #ifndef _WINSTL_NO_NAMESPACE
00081 # if defined(_STLSOFT_NO_NAMESPACE) || \
00082 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00083
00084 namespace winstl
00085 {
00086 # else
00087
00088
00089 namespace stlsoft
00090 {
00091
00092 namespace winstl_project
00093 {
00094
00095 # endif
00096 #endif
00097
00098
00099
00100
00101
00102 #ifdef STLSOFT_DOCUMENTATION_SKIP_SECTION
00103
00110 template <ss_typename_param_k C>
00111 struct window_traits
00112 : public system_traits<C>
00113 {
00116 public:
00118 typedef C char_type;
00120 typedef ws_size_t size_type;
00122 typedef ws_ptrdiff_t difference_type;
00124
00127 public:
00129 static ws_int_t get_window_text_length(HWND hwnd);
00130
00132 static ws_int_t get_window_text(HWND hwnd, char_type* buffer, ws_int_t cchBuff);
00133
00135 static ws_bool_t set_window_text(HWND hwnd, char_type const* buffer);
00137 };
00138
00139 #else
00140
00141 template <ss_typename_param_k C>
00142 struct window_traits;
00143
00144 STLSOFT_TEMPLATE_SPECIALISATION
00145 struct window_traits<ws_char_a_t>
00146 : public system_traits<ws_char_a_t>
00147 {
00148 public:
00149 typedef window_traits<ws_char_a_t> class_type;
00150 typedef ws_char_a_t char_type;
00151 typedef ws_size_t size_type;
00152 typedef ws_ptrdiff_t difference_type;
00153
00154 public:
00155 static ws_int_t get_window_text_length(HWND hwnd)
00156 {
00157 return ::GetWindowTextLength(hwnd);
00158 }
00159
00160 static ws_int_t get_window_text(HWND hwnd, char_type* buffer, ws_int_t cchBuff)
00161 {
00162 return ::GetWindowTextA(hwnd, buffer, cchBuff);
00163 }
00164
00165 static ws_bool_t set_window_text(HWND hwnd, char_type const* s)
00166 {
00167 return 0 != ::SetWindowTextA(hwnd, s);
00168 }
00169
00170 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00171 template <ss_typename_param_k S>
00172 static ws_bool_t set_window_text(HWND hwnd, S const& s)
00173 {
00174 return class_type::set_window_text(hwnd, stlsoft_ns_qual(c_str_ptr_a)(s));
00175 }
00176 #endif
00177 };
00178
00179 STLSOFT_TEMPLATE_SPECIALISATION
00180 struct window_traits<ws_char_w_t>
00181 : public system_traits<ws_char_w_t>
00182 {
00183 public:
00184 typedef window_traits<ws_char_w_t> class_type;
00185 typedef ws_char_w_t char_type;
00186 typedef ws_size_t size_type;
00187 typedef ws_ptrdiff_t difference_type;
00188
00189 public:
00190 static ws_int_t get_window_text_length(HWND hwnd)
00191 {
00192 return ::GetWindowTextLength(hwnd);
00193 }
00194
00195 static ws_int_t get_window_text(HWND hwnd, char_type* buffer, ws_int_t cchBuff)
00196 {
00197 return ::GetWindowTextW(hwnd, buffer, cchBuff);
00198 }
00199
00200 static ws_bool_t set_window_text(HWND hwnd, char_type const* s)
00201 {
00202 return 0 != ::SetWindowTextW(hwnd, s);
00203 }
00204
00205 #ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
00206 template <ss_typename_param_k S>
00207 static ws_bool_t set_window_text(HWND hwnd, S const& s)
00208 {
00209 return class_type::set_window_text(hwnd, stlsoft_ns_qual(c_str_ptr_w)(s));
00210 }
00211 #endif
00212 };
00213
00214 #endif
00215
00216
00217
00218 #ifndef _WINSTL_NO_NAMESPACE
00219 # if defined(_STLSOFT_NO_NAMESPACE) || \
00220 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00221 }
00222 # else
00223 }
00224 }
00225 # endif
00226 #endif
00227
00228
00229
00230 #endif
00231
00232