"Assuming that p is a pointer to the dialog's parent (obtained through a GetParent() call), here is the code that would do just that:" . . . .