1、第一种方法:用微软提供的官方文档
From : http://support.microsoft.com/kb/181934/en-us/
Generally, when you want to display a message box for a limited amount of time, you must implement a regular dialog box that closes itself after a specified amount of time. The problem with this method is that you lose the standard message box functionality that Windows provides.
The following example shows how to use the MessageBox function to create a message box that automatically closes after a specified amount of time. Note the following about the example:
- The example uses a Windows timer that fires an event after the specified amount of time has elapsed.
- When the timer event occurs, the PostQuitMessage API is used to break out of the modal message loop that MessageBox uses.
- Note The WM_QUIT message must be removed from the message queue to prevent it from being retrieved in the main message queue.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)