I have done 2 tests.
I got two applications that ran on the same computer.
1st time, when I click my CsAPP.exe. the MessageBox.Show()
works quite well and a new window pop-up the way I wished.
2nd time, when I run CppAPP.exe there is a CreateProcess()
to call CsApp.exe. At this point, my MessageBox.Show()
doesn't work. I set breakpoint to my CsApp code and verfied that the code ran to MessageBox.Show()
but the Pop-up window didn't show up.
C++ code snippet
CreateProcess(apppath.c_str(), NULL, &sa, &sa, FALSE, 0, NULL, appdir.c_str(), &si, &pi);
C# code snippet
MessageBox.Show("Read " + xmlFile + " failed, an invalid XML format file found",
"Critical Warning",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
Any replies and comments are appreciated.
[Updated on Aug 23rd]
I consulted one guy. And He said that the MessageBox showed on another invisible desktop actually
for my test2. He recommended me to read a book named 'Windows internals'. If any found I will update my post later. Thanks.