Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFileDialog - How to Center Window?

Status
Not open for further replies.

CasperTheGhost

Programmer
Mar 21, 2002
8
US
I am using a derived CFileDialog class in my app
(Explorer "2000" style) but can't Center the Dialog to the DesktopWindow. Tried first in OnInitDialog using CenterWindow(), goes to default Upper Left Hand corner. Tried MoveWindow() too, but same results. Last resort used a CALLBACK HookProc which caused the Dialog to revert to the 9x style but centered it! Does anyone know the proper
call/code to Center the Dialog (Explorer "2000" style)?
Thanks in advance...
 
try this:
CMyFileDlg myDlg(1,NULL,NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL, GetDesktopWindow());

and in CMyFileDlg::OnInitDialog() just do centerwindow();

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top