Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:11

0001 //
0002 // boost/process/v2/windows/default_launcher.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_PROCESS_V2_WINDOWS_SHOW_WINDOW_HPP
0012 #define BOOST_PROCESS_V2_WINDOWS_SHOW_WINDOW_HPP
0013 
0014 #include <boost/process/v2/windows/default_launcher.hpp>
0015 
0016 BOOST_PROCESS_V2_BEGIN_NAMESPACE
0017 namespace windows
0018 {
0019 
0020 /// A templated initializer to add wShowWindow flags.
0021 template<DWORD Flags>
0022 struct process_show_window
0023 {
0024   constexpr process_show_window() {}
0025 
0026   error_code on_setup(windows::default_launcher & launcher, 
0027                       const filesystem::path &, 
0028                       const std::wstring &) const
0029   {
0030     launcher.startup_info.StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
0031     launcher.startup_info.StartupInfo.wShowWindow |= Flags;
0032 
0033     return error_code {};
0034   };
0035 };
0036 
0037 ///Hides the window and activates another window.
0038 constexpr static process_show_window<SW_HIDE           > show_window_hide;
0039 ///Activates the window and displays it as a maximized window.
0040 constexpr static process_show_window<SW_SHOWMAXIMIZED  > show_window_maximized;
0041 ///Activates the window and displays it as a minimized window.
0042 constexpr static process_show_window<SW_SHOWMINIMIZED  > show_window_minimized;
0043 ///Displays the window as a minimized window. This value is similar to `minimized`, except the window is not activated.
0044 constexpr static process_show_window<SW_SHOWMINNOACTIVE> show_window_minimized_not_active;
0045 ///Displays a window in its most recent size and position. This value is similar to show_normal`, except that the window is not activated.
0046 constexpr static process_show_window<SW_SHOWNOACTIVATE > show_window_not_active;
0047 ///Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
0048 constexpr static process_show_window<SW_SHOWNORMAL     > show_window_normal;
0049 
0050 }
0051 BOOST_PROCESS_V2_END_NAMESPACE
0052 
0053 #endif //  BOOST_PROCESS_V2_WINDOWS_SHOW_WINDOW_HPP