Link to home
Start Free TrialLog in
Avatar of dkremer
dkremer

asked on

Embedded CFileDialog

Hi.
I'd like to do something like Visual Basic Open Project dialog, which is a property sheet that has the common file dialog in one of the pages.
The problem is that CFileDialog (which hooks the GetOpenFileName API) only opens as a modal dialog, and embedding it as a child is difficult... I tried several approaches like deriving from CFileDialog and in it's OnInitDone calling SetParent, but I had paint problems and, syncronization problems since the 'program flow' would stop when the call to the modal dialog was made, so I tried to create the common dialog in a seperate thread but this caused other problems...
Any ideas, pointers, something ?

   Thanks.

P.S. I don't want answers like 'use the .rc of the common dialog and create it yourself, and use the SHGetDesktopFolder and such and populate the list and tree...', I'd really like the actual common dialog embedded.
Not sure it can be done though, so help me out :)
Avatar of dkremer
dkremer

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of RONSLOW
RONSLOW

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkremer

ASKER

Thanks,
Didn't think about that... I wanted the easy way by using CPropertySheet\Page, wind up using seperate threads... now all I have to do is manage the visibility of the controls.... :)

    Thanks again,
      - Dror Kremer

Be aware that the actual common dialog is the PARENT of your CFileDialog ... the file dialog controls are not children of the CFileDialog (so you cannot enumerate them of GetDlgItem etc) ... instead, do a GetParent and enum or GetDlgItem etc from there.