stanigator
stanigator

Reputation: 10944

simulate dialog exit

How would one use SendMessage() or PostMessage() function to close an application, given that the appropriate window handle is retrieved? Thanks in advance.

Upvotes: 1

Views: 131

Answers (2)

Alan
Alan

Reputation: 13731

SendMessage(hWnd, WM_CLOSE, 0, 0);

Upvotes: 2

Stephen Nutt
Stephen Nutt

Reputation: 3306

Call the PostQuitMessage function which will post a WM_QUIT message for you.

Upvotes: 1

Related Questions