dcsimg

MessageBox With Timeout

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


This is a simple class that displays a message box and automatically closes it after a specified amount of time.

This class has a very simple interface

  • Two public constructors
  • 
    CMessageBoxEx()
    CMessageBoxEx(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType, UINT uTimeOut, BOOL bShowTimeOut = TRUE)
    
  • Two public methods to execute Timed Out Message Box
    
    int DoMessageBox()
    int DoMessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType, UINT uTimeOut, BOOL bShowTimeOut = TRUE)
    
    The object creates a thread to check time elapsed. When timeout is reached, the thread posts WM_CLOSE message to the message box.


  • This article was originally published on July 30th, 1999

    Most Popular Programming Stories

    More for Developers

    RSS Feeds

    Thanks for your registration, follow us on our social networks to keep up-to-date