ShellExecuteEx の戻り値を確認する

たとえばひとつ前のエントリなら
ConsoleApplication1 の Environment.ExitCode を知りたい。
ShellExecuteEx の戻り値から得られそうだが、うまくいかない。

Raymond Chen 先生はこう言っている。

We discussed earlier the history behind the the return value of the ShellExecute function, and why its value in Win32 is meaningless aside from testing it against the value 32 to determine whether an error occurred.

http://blogs.msdn.com/b/oldnewthing/archive/2006/11/08/1035971.aspx

ExitCode は GetExitCodeProcess で確認する。