CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    12

    Question Message posted to window while aborting an application

    Can someone tell me what message is posted to an application when the user presses Ctrl + C to terminate the application.
    Regards,
    Shelly.

  2. #2
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    2,147
    Which environment are you using - Ctrl+C doesn't terminate an application in windows ?

    If you are describing a console based application, Ctrl+C is typically processed by a default interrupt handler.

    This arrangement can be overridden using SetConsoleCtrlHandler in NT/2000

    If you are describing ALT+F4 to close a window (and possibly an application) Windows posts a WM_SYSCOMMAND message to the window with SC_CLOSE as the WPARAM. This can be handled by the OnSysCommand message handler if it is derived from CWnd.

    In a typical windows application, CTRL+C is used to copy data to the clipboard.

    Hope this helps,

    - Nigel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured