The MFC application that i created is dialog based. Just one dialog thats all. How do I get the window handle to this window, while the application is performing the InitDialog. I need to find out its dimension as well. GetForegroundWindow not necessarily gives you the handle to this window that is loading up