简体   繁体   中英

How to convert GUI to path on Windows with Qt/C++?

Clicking on "my computer" in the start menu returns a GUID link instead of a direct link. For example:

::{20B04FE1-3AEA-1069-A2D8-08012B30309D}

How can I convert it to a normal path so that I can get a list of directories and files with the help of QDir ?

UPDATE

I'm not trying to get a list of drives. It is easily done with Qt. I just want to know that a user clicked My Computer in the start menu. (My application can replace Windows Explorer).

You are looking there at an item in the Shell Namespace, not in the filesystem.

Introduction to the Shell Namespace:

http://msdn.microsoft.com/en-us/library/windows/desktop/cc144090(v=vs.85).aspx

The shell shows many things which don't exist as files, My Computer being one. The Desktop is another - the shell desktop is a merged view of the All Users desktop folder, your personal desktop folder, and a few other items which are purely virtual like the recycle bin.

To find out more about the item you can use SHParseDisplayName to convert a name to an ITEMIDLIST .

If you intend to offer a replacement for Explorer, good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM