Look at the documentation of GetWindowRect; I think you don't need to call ClientToScreen.
For determining where the cursor is at, look at the member functions of CWnd, especially the Window Access Functions. Perhaps you can use the function that determines which, if any, of the child windows that contains a specified point, but there are probably other possibilities.
I think however that checking the cursor position in OnInitDialog won't work; by the time you see the button, OnInitDialog will have returned long (in computer time) before.
Also see The scope of this forum; your question will get faster and better answers in a MFC newsgroup.