Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to customize "File Open" dialog? Collapse All
Subject Author Date
Anil Siddhpura Jan 30, 2009 - 11:30 PM


How to customize "Open File" dialog?

I am using CExtShellDialogFile class instead of CFileDialog class of windows. I want to make this "Open file" dialog readonly. And user can only access "removable drives" through this dialog. So how to customize like this?


Apurv Shah


Anil Siddhpura Feb 26, 2009 - 11:45 PM


No, it’s different email-id. But you have replied to that id so many times. Just this time I did not get reply. So i am again droping a mail. Please reply to me with update source code.


Apurv Shah

Technical Support Feb 26, 2009 - 1:25 PM

We didn’t receive your e-mail. Did you send it using the same mail box return address as you used for registering on this web site?

Anil Siddhpura Feb 25, 2009 - 10:33 PM


As you said I had drop you an email for updated source code. But I still not got any reply for that. Please reply me as it’s urgent for me.



Technical Support Feb 12, 2009 - 12:02 PM

Thank you for reporting the editor issue. To fix it, please update the .../Prof-UIS/Src/ExtEdit.cpp and .../Prof-UIS/Include/ExtEdit.h files from the following ZIP file:

We added m_dwAttributeFilterAny, m_dwAttributeFilterAllPresent and m_dwAttributeFilterAllAbsent properties to the CExtShellComboBox class. The same properties are present in the CExtShellListCtrl and CExtShellTreeCtrl classes. So, now the CExtShellComboBox class can filter shell items as well as the CExtShellListCtrl and CExtShellTreeCtrl classes can do and you can specify the SFGAO_REMOVABLE flag in the CExtShellComboBox::m_dwAttributeFilterAllPresent property to make the shell combo box displaying removable drives only. You can drop us an e-mail so we will provide you with a source code update for the shell classes.

Anil Siddhpura Feb 11, 2009 - 12:34 AM


Thanks for your help.

Yes i know it displays the read-only file names editor but still i can edit the name of file in that editor.

there is a Look in "Combobox" in that Open file dialog & it displays all Drives of computer starting from Desktop. I want to show only removable drives in this combobox as well. So how to do this?

Apurv Shah

Technical Support Feb 9, 2009 - 5:15 AM

We run the ProfUIS_Controls sample application, selected the File Dialog page, checked the Read-only file name(s) edit check box and clicked the Show Prof-UIS File dialog button. The displayed file dialog had the read-only file names editor. We are sorry, but the CExtShellDialogFile requires a small improvement for displaying custom shell root item in its tree control. Please add the following public property into it:

   CExtPIDL m_pidlRoot;

Then please the following line in the CExtShellDialogFile::OnInitDialog() method:

And replace it with the following code:
   if( ! m_pidlRoot.IsEmpty() )
                        m_wndShellTree.RefreshShellRoot( m_pidlRoot.GetPtr() );

Now the CExtShellDialogFile class can be configured for displaying custom shell root:
   VERIFY( dlgShellFile.m_pidlRoot.GetSpecialFolderLocation( m_hWnd, CSIDL_DRIVES ) );

We also added two new flag properties into the the CExtShellDialogFile class: m_bEnableButtonCreateNewFolder and m_bEnableButtonDelete. They allow to disable dialog buttons like you requested. Please drop us an e-mail and we will provide you with the source code update.

Anil Siddhpura Feb 3, 2009 - 10:00 PM


Please reply me. It’s urgent for me.


Apurv Shah

Anil Siddhpura Feb 2, 2009 - 3:00 AM


Thanks for your reply.

As you said I tried to set "My Computer" as root item, but it’s not working and still the Desktop is root item.

Also, i set  CExtShellDialogFile::m_bReadOnlyFileNamesEdit to true, but still i can change the name of file in that Editbox.

There are Create new folder & delete buttons in Open File dialog. I don’t want to show these buttons to user or can i disable these buttons?


Apurv Shah


Technical Support Feb 1, 2009 - 11:46 AM

The CExtShellDialogFile::m_bReadOnlyFileNamesEdit property allows you to make read-only the single line file name editor inside the shell file dialog. The CExtShellDialogFile::m_bShowFileNamesEdit property allows you to hide the file name editor. The CExtShellDialogFile::m_wndShellTree and CExtShellDialogFile::m_wndShellList properties are public and you can access them. They are the CExtShellTreeCtrl and CExtShellListCtrl controls created inside the shell file dialog. Both these classes have three DWORD properties containing combinations of the SFGAO_*** flags defined in the shell related part of Win32 API for filtering shell items: m_dwAttributeFilterAny, m_dwAttributeFilterAllPresent and m_dwAttributeFilterAllAbsent. The m_dwAttributeFilterAllPresent and m_dwAttributeFilterAllAbsent are initially zero. You need to assign the SFGAO_REMOVABLE flag to the m_dwAttributeFilterAllPresent property of the CExtShellDialogFile::m_wndShellTree property. As result, tree control will display only removable drives. You can also assign PIDL of the My Computer shell item to the CExtShellTreeCtrl::m_pidlRoot property and, as result, the My Computer shell item will be used as root item instead of the Desktop item. Here is how to compute it:
CExtPIDL pidlMyComputer;
VERIFY( pidlMyComputer.GetSpecialFolderLocation( m_hWnd, CSIDL_DRIVES ) );