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_FUNCTIONAL_HPP_MESSAGE
00048 #define WINSTL_INCL_WINSTL_FUNCTIONAL_HPP_MESSAGE
00049 
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_MESSAGE_MAJOR     4
00052 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_MESSAGE_MINOR     1
00053 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_MESSAGE_REVISION  1
00054 # define WINSTL_VER_WINSTL_FUNCTIONAL_HPP_MESSAGE_EDIT      39
00055 #endif 
00056 
00057 
00058 
00059 
00060 
00061 #ifndef WINSTL_INCL_WINSTL_H_WINSTL
00062 # include <winstl/winstl.h>
00063 #endif 
00064 #ifndef WINSTL_INCL_SHIMS_ATTRIBUTE_HPP_GET_HWND
00065 # include <winstl/shims/attribute/get_HWND.hpp>
00066 #endif 
00067 #ifndef _WINSTL_WINDOW_FUNCTIONALS_NO_STD
00068 # include <functional>
00069 #else 
00070 # error Now need to write that std_binary_function stuff!!
00071 #endif 
00072 
00073 
00074 
00075 
00076 
00077 #ifndef _WINSTL_NO_NAMESPACE
00078 # if defined(_STLSOFT_NO_NAMESPACE) || \
00079      defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00080 
00081 namespace winstl
00082 {
00083 # else
00084 
00085 
00086 namespace stlsoft
00087 {
00088 
00089 namespace winstl_project
00090 {
00091 
00092 # endif 
00093 #endif 
00094 
00095 
00096 
00097 
00098 
00106 
00107 struct message_send
00108     : public std::unary_function<HWND, void>
00109 {
00110 public:
00112     typedef message_send        class_type;
00113 public:
00114     message_send(   UINT    msg
00115                 ,   WPARAM  wparam
00116                 ,   LPARAM  lparam)
00117         : m_msg(msg)
00118         , m_wparam(wparam)
00119         , m_lparam(lparam)
00120     {}
00121 
00122 public:
00123     void operator ()(HWND hwnd) const
00124     {
00125         send_(hwnd);
00126     }
00127     template <ss_typename_param_k W>
00128     void operator ()(W &wnd) const
00129     {
00130         send_(winstl_ns_qual(get_HWND)(wnd));
00131     }
00132 
00133 private:
00134     void send_(HWND hwnd) const
00135     {
00136         ::SendMessage(hwnd, m_msg, m_wparam, m_lparam);
00137     }
00138 
00139 private:
00140     const UINT      m_msg;
00141     const WPARAM    m_wparam;
00142     const LPARAM    m_lparam;
00143 
00144 private:
00145     class_type& operator =(class_type const&);
00146 };
00147 
00155 
00156 struct message_post
00157     : public std::unary_function<HWND, void>
00158 {
00159 public:
00161     typedef message_post        class_type;
00162 public:
00163     message_post(   UINT    msg
00164                 ,   WPARAM  wparam
00165                 ,   LPARAM  lparam)
00166         : m_msg(msg)
00167         , m_wparam(wparam)
00168         , m_lparam(lparam)
00169     {}
00170 
00171 public:
00172     void operator ()(HWND hwnd) const
00173     {
00174         post_(hwnd);
00175     }
00176     template <ss_typename_param_k W>
00177     void operator ()(W &wnd) const
00178     {
00179         post_(winstl_ns_qual(get_HWND)(wnd));
00180     }
00181 
00182 private:
00183     void post_(HWND hwnd) const
00184     {
00185         ::PostMessage(hwnd, m_msg, m_wparam, m_lparam);
00186     }
00187 
00188 private:
00189     const UINT      m_msg;
00190     const WPARAM    m_wparam;
00191     const LPARAM    m_lparam;
00192 
00193 private:
00194     class_type& operator =(class_type const&);
00195 };
00196 
00197 
00198 
00199 #ifndef _WINSTL_NO_NAMESPACE
00200 # if defined(_STLSOFT_NO_NAMESPACE) || \
00201      defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00202 } 
00203 # else
00204 } 
00205 } 
00206 # endif 
00207 #endif 
00208 
00209 
00210 
00211 #endif 
00212 
00213