ShellExecute(...)
-
Hi world, Does the
ShellExecute
function works in a console application? The first argument of theShellExecute
function is the Handle to a parent window... but a consol application doesn't have window handle!!! I only want a solution for running an application (exe with argument) in a console application!? What's the simplest solution? Hello World!!! :) from Raphaël -
Hi world, Does the
ShellExecute
function works in a console application? The first argument of theShellExecute
function is the Handle to a parent window... but a consol application doesn't have window handle!!! I only want a solution for running an application (exe with argument) in a console application!? What's the simplest solution? Hello World!!! :) from Raphaëlyes it works. While a console has now window you can do one of two things: 1) pass NULL, 2) pass the result of ::GetDesktopWindow(). The only thing that HWND is for is act as the parent window for any other windows that come up as result of your execution. If what you are executing has no windows it doesn't matter all. If it does they will just be directed to the desktop. Hope that helps. Joseph Dempsey joseph_r_dempsey@yahoo.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous
-
Hi world, Does the
ShellExecute
function works in a console application? The first argument of theShellExecute
function is the Handle to a parent window... but a consol application doesn't have window handle!!! I only want a solution for running an application (exe with argument) in a console application!? What's the simplest solution? Hello World!!! :) from RaphaëlOK... I've found the solution by myself... simply use NULL for the first argument of
ShellExecute
Hello World!!! :) from Raphaël -
yes it works. While a console has now window you can do one of two things: 1) pass NULL, 2) pass the result of ::GetDesktopWindow(). The only thing that HWND is for is act as the parent window for any other windows that come up as result of your execution. If what you are executing has no windows it doesn't matter all. If it does they will just be directed to the desktop. Hope that helps. Joseph Dempsey joseph_r_dempsey@yahoo.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous
Thanks for your reply... (I've replied to myself too :) ) Hello World!!! :) from Raphaël
-
Hi world, Does the
ShellExecute
function works in a console application? The first argument of theShellExecute
function is the Handle to a parent window... but a consol application doesn't have window handle!!! I only want a solution for running an application (exe with argument) in a console application!? What's the simplest solution? Hello World!!! :) from RaphaëlI am not sure how correct this is, but when I don't have my own window I often use GetDesktopWindow().