end c++ program with a specific key

please tell me that how to ends any c++ program with a specific key?
Are you talking about console output ? or program you created by your own
Use the GetAsyncKeyState function from the Windows API.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646293(v=vs.85).aspx
Topic archived. No new replies allowed.