I am trying to close a C# .NET 4 WPF application from a c++ application. The C++ app uses the standard technique of enumerating windows, finding the one that corresponds to a gi
The direct equivalent of the Close command on the system menu is:
PostMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
You could try that instead.