Ejemplo n.º 1
0
SOCKET Win32Socket::accept(SocketName &out_socketname)
{
	sockaddr_in new_addr;
	memset(&new_addr, 0, sizeof(sockaddr_in));
	int size = sizeof(sockaddr_in);
	SOCKET accepted_socket = ::accept(handle, (sockaddr *) &new_addr, &size);
	throw_if_invalid(accepted_socket);
	out_socketname.from_sockaddr(AF_INET, (sockaddr *) &new_addr, size);
	reset_receive();
	return accepted_socket;
}
Ejemplo n.º 2
0
 void generic_text(const std::basic_string<U>& new_text)
 {
     throw_if_invalid();
     return detail::window_text(m_handle.get(), new_text);
 }
Ejemplo n.º 3
0
 std::basic_string<U> text() const
 {
     throw_if_invalid();
     return detail::window_text<U>(m_handle.get());
 }
Ejemplo n.º 4
0
 /**
  * Enable or disable a window.
  *
  * @returns  Previous enablement state.
  */
 bool enable(bool state)
 {
     throw_if_invalid();
     return ::EnableWindow(m_handle.get(), state) == 0;
 }
Ejemplo n.º 5
0
 /**
  * Is the window able to respond to they keyboard and mouse?
  *
  * Some types of window, e.g., buttons, may have a visible difference when
  * they are disabled usch as being greyed out.
  */
 bool is_enabled() const
 {
     throw_if_invalid();
     return ::IsWindowEnabled(m_handle.get()) != 0;
 }
Ejemplo n.º 6
0
 /**
  * Show or hide window.
  *
  * @returns  Previous visibility.
  */
 bool visible(bool state)
 {
     throw_if_invalid();
     return ::ShowWindow(m_handle.get(), (state) ? SW_SHOW : SW_HIDE) != 0;
 }
Ejemplo n.º 7
0
 /**
  * Is the window theoretically visible?
  *
  * It may be obscured but not hidden.
  */
 bool is_visible() const
 {
     throw_if_invalid();
     return ::IsWindowVisible(m_handle.get()) != 0;
 }