{"id":73,"date":"2010-03-17T12:04:33","date_gmt":"2010-03-17T12:04:33","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=73"},"modified":"2022-02-17T06:24:06","modified_gmt":"2022-02-17T06:24:06","slug":"launching-specific-things","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/application-control\/launching-specific-things","title":{"rendered":"Launching Specific Things"},"content":{"rendered":"<h4>\nLaunching A Web Page In A Browser<br \/>\n<\/h4>\n<pre>\r\n<code>System::Diagnostics::Process::Start(&quot;http:\/\/www.ibexuk.com&quot;);<\/code><\/pre>\n<h4>\nOpening file in Notepad<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\tusing namespace System::Diagnostics;\r\n\r\n\tProcessStartInfo ^startInfo = gcnew ProcessStartInfo();\r\n\tstartInfo-&gt;FileName = &quot;C:\\\\Windows\\\\notepad.exe&quot;;\r\n\tstartInfo-&gt;Arguments = &quot;\\&quot;&quot; + Path::GetDirectoryName(Application::ExecutablePath) + &quot;\\\\SomeDocName.Config\\&quot;&quot;;\r\n\tProcess::Start(startInfo);\r\n<\/code><\/pre>\n<h4>\nLaunching Another Application From C++<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nusing namespace System::Diagnostics;\r\n\tProcess::Start(&quot;C:\\\\GVNVR\\\\ViewLog500.exe&quot;);\r\n\r\n\t\/\/or\r\n\tSystem::Diagnostics::Process::Start(&quot;C:\\\\GVNVR\\\\ViewLog500.exe&quot;);\r\n<\/code><\/pre>\n<h5>\nIf you need to pass arguments then use<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n\tProcessStartInfo ^startInfo = gcnew ProcessStartInfo();\r\n\tstartInfo-&gt;FileName = &quot;C:\\\\Program Files\\\\IndigoVision\\\\Control Center\\\\ControlCenter.exe&quot;;\r\n\tstartInfo-&gt;Arguments = &quot;-username adampulley -video_display_mode video_panes_only&quot;;\r\n\tProcess::Start(startInfo);\r\n<\/code><\/pre>\n<p>\nAlso see:<br \/>\nShell Execute\n<\/p>\n<h4>\nLaunching and Closing Another Application From C++<br \/>\n<\/h4>\n<h5>\nCreate Class<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n\tProcess^ MyProcess;\r\n<\/code><\/pre>\n<h5>\nOpen Ap<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n\tMyProcess = gcnew Process();\r\n\tMyProcess-&gt;StartInfo-&gt;FileName = &quot;C:\\\\Program Files\\\\IndigoVision\\\\ControlCenter.exe&quot;;\r\n\tMyProcess-&gt;StartInfo-&gt;Arguments = &quot;-username adampulley -video_display_mode video_panes_only&quot;;\r\n\tMyProcess-&gt;Start();\r\n<\/code><\/pre>\n<h5>\nClose Ap<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n\tif (MyProcess != nullptr)\r\n\t{\r\n\t\tif (!MyProcess-&gt;HasExited)\r\n\t\t\tMyProcess-&gt;CloseMainWindow();\r\n\t\tMyProcess = nullptr;\r\n\t}\r\n<\/code><\/pre>\n<p>\nOther resources for fingding and closing other aps:<br \/>\nhttp:\/\/support.microsoft.com\/kb\/307395<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Launching A Web Page In A Browser System::Diagnostics::Process::Start(&quot;http:\/\/www.ibexuk.com&quot;); Opening file in Notepad using namespace System::Diagnostics; ProcessStartInfo ^startInfo = gcnew ProcessStartInfo(); startInfo-&gt;FileName = &quot;C:\\\\Windows\\\\notepad.exe&quot;; startInfo-&gt;Arguments = &quot;\\&quot;&quot; + Path::GetDirectoryName(Application::ExecutablePath) + &quot;\\\\SomeDocName.Config\\&quot;&quot;; Process::Start(startInfo); Launching Another Application From C++ using namespace System::Diagnostics; Process::Start(&quot;C:\\\\GVNVR\\\\ViewLog500.exe&quot;); \/\/or System::Diagnostics::Process::Start(&quot;C:\\\\GVNVR\\\\ViewLog500.exe&quot;); If you need to pass arguments then use ProcessStartInfo ^startInfo = gcnew ProcessStartInfo(); [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,99],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-application-control","category-processes"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":7,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":1309,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/73\/revisions\/1309"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}