Q: How to start your dialog application in hidden mode?
A: If you put the function 'ShowWindow(SW_HIDE)' in your 'OnInitDialog()', it won't have any effect, because 'OnInitDialog()' always finishes with calling 'ShowWindow(SW_SHOW)'. But there is a workaround for that. Create a 'BOOL' member variable into your dialog class and set it to 'FALSE' in the constructor.
Now override the 'WM_WINDOWPOSCHANGING' message handler. Your code should look something like this to hide the dialog:
To make the dialog again visible, use the following code:
Note: Most of the material in this article is taken from codeguru.com