WPF app does not respond to WM_CLOSE

前端 未结 2 1451
刺人心
刺人心 2021-01-24 00:50

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

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-24 01:17

    The direct equivalent of the Close command on the system menu is:

    PostMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
    

    You could try that instead.

提交回复
热议问题