show_window.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) 2006, 2007 Julio M. Merino Vidal
  2. // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
  3. // Copyright (c) 2009 Boris Schaeling
  4. // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
  5. // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
  6. // Copyright (c) 2016 Klemens D. Morgenstern
  7. //
  8. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  9. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_PROCESS_WINDOWS_SHOW_WINDOW_HPP
  11. #define BOOST_PROCESS_WINDOWS_SHOW_WINDOW_HPP
  12. #include <boost/process/v1/detail/config.hpp>
  13. #include <boost/winapi/process.hpp>
  14. #include <boost/winapi/show_window.hpp>
  15. #include <boost/process/v1/detail/handler_base.hpp>
  16. namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail { namespace windows {
  17. template<::boost::winapi::WORD_ Flags>
  18. struct show_window : ::boost::process::v1::detail::handler_base
  19. {
  20. template <class WindowsExecutor>
  21. void on_setup(WindowsExecutor &e) const
  22. {
  23. e.startup_info.dwFlags |= ::boost::winapi::STARTF_USESHOWWINDOW_;
  24. e.startup_info.wShowWindow |= Flags;
  25. }
  26. };
  27. struct create_no_window_ : public ::boost::process::v1::detail::handler_base
  28. {
  29. template <class Executor>
  30. void on_setup(Executor &exec) const
  31. {
  32. exec.creation_flags |= ::boost::winapi::CREATE_NO_WINDOW_;
  33. }
  34. };
  35. }}}}}
  36. #endif