closing Messagebox
-
Hi How can I close a messagebox without using the Mouse?For example I want that the messageBox will close by itself after 10 seconds.Can I do that? Thanks
There is no timeout option for a MessageBox API. I would suggest use a dialog box, make it generic enough to be used. Use timer inside the dialog box. something like this: Call SetTimer(1, 10000, NULL) in CMsgBoxDlg::OnInitDialog() method. //10000 for 10 secs In timer method: void CMsgBoxDlg::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default CDialog::OnOK(); CDialog::OnTimer(nIDEvent); } Add a public member function to accept message box string and caption. Use static control to display the provided string on the dialog box with a 'Ok' button. Hope this helps Thammadi
-
Hi How can I close a messagebox without using the Mouse?For example I want that the messageBox will close by itself after 10 seconds.Can I do that? Thanks
iayd wrote:
How can I close a messagebox without using the Mouse?
Spacebar, Alt+F4, Alt+Space then either X or C.
iayd wrote:
For example I want that the messageBox will close by itself after 10 seconds.Can I do that?
Yes. See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hi How can I close a messagebox without using the Mouse?For example I want that the messageBox will close by itself after 10 seconds.Can I do that? Thanks
On the time you can send WM_CLOSE to it.
WhiteSky