Showing a “Message” While Performing a Task in C++
July 8th, 2009
It took me a few minutes to figure this one out, a simple MessageBox won’t do as that’s a blocking call. Then I stumbled upon this old msdn blog article:
http://blogs.msdn.com/oldnewthing/archive/2006/09/25/770536.aspx.
Basically I had a requirement for a certain project to display some sort of progress message to the end user while performing complicated logic that could take 10seconds to a couple minutes and this had to be done from within a replacement GINA for WinXP. The above article was of extreme help in understanding the way message passing works in Win32.
DialogBox (with reference to the callback function)
- callback function.
- show message window do all my work here.
- then call EndDialog to return to the previous function.