Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
136 views
in Technique[技术] by (71.8m points)

c++ - Determining an IShellItem's file type / associated application

I apologize if this is a rudimentary question, but for some reason I haven't been able to find the answer with my searches.

Let's say you have an IShellItemArray, and for each IShellItem in the array, you want to determine the item's associated application or general file type. For example, the item may be a Microsoft Word document, Excel document, PDF, image, etc. I was wondering what the most efficient way to do this is.

It seems like getting the path and then the file extension wouldn't be ideal, as you'd have to potentially compare it to many different extensions for any given application.

Is this a job for IQueryAssociations? And perhaps more specifically, IQueryAssociations::GetString? I know you can obtain that interface through IShellItem::BindToHandler.

And should I be looking for an application string, or instead perhaps a CLSID associated with the program? Thanks a million for any help.

question from:https://stackoverflow.com/questions/65941516/determining-an-ishellitems-file-type-associated-application

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...