MFC: Address Bar control like Windows Explorer

南笙酒味 提交于 2020-01-16 05:51:06

问题


In my MFC app, I'm attempting to make a window that resembles the Windows 7 Open File dialog, but it browses a virtual/fake file system. It doesn't need to be pixel-perfect, but I'd like parity with the native OS dialog where possible.

Probably the most challenging part is the address bar the runs along the top of an Open dialog. The address bar control is also atop all Windows Explorer windows. It shows the folder names that make up your path. It shows and hides buttons when moused over (including an attractive fade animation), changes the active directory when names are clicked, and shows submenus when the triangles between names are clicked. This doesn't seem to correspond to any MFC control (or group of controls). Spy++ shows it as an "AddressDisplay Control" but I can't find much documentation beyond that.

Is there a way to access a control like this, or to mimic it, in MFC? Also, I am not browsing the real file system, so I have to be able to tell the control what to display--I can't just point it at C:\ and let the system do the rest.

Here's a picture of the control in question.


回答1:


Unfortunately, I think this is one of those controls that Microsoft has decided not to expose to developers through the Feature Pack. The Feature Pack was developed from the BCG control library. And, that library contains the control you want. However, it's not free. The only other alternative is to code it yourself.



来源:https://stackoverflow.com/questions/21176838/mfc-address-bar-control-like-windows-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!