Hey, i used the following technique in my program to solve a same problem. when you recieve WM_INITDIALOG message, call ShowWindow(hDlg,SW_SHOW); //plese write the MFC equivalent urself;P) After that, you can call MessageBox to do your stuff... That's simpler solution.
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs