开发者

default viewer on Windows mobile 6.x

开发者 https://www.devze.com 2023-03-06 16:12 出处:网络
How can I find out if a default viewer exist for a file type (PDF for example)? I am planing to use ShellExecute to open a PDF file that I have downloaded from server, but I need to know if the device

How can I find out if a default viewer exist for a file type (PDF for example)? I am planing to use ShellExecute to open a PDF file that I have downloaded from server, but I need to know if the device is capable of vie开发者_JAVA百科wing the file before I attempt to download it.

P.S. This is a Visual C++ 2008 mobile project.

Thank You Sam


Same as with the desktop. For example, for PDFs you'd look in the registry (with RegOpenKeyEx and its relatives) for an extension association:

[HKEY_CLASSES_ROOT\.pdf]

If that exists, the default value will be the name of another key in HKEY_CLASSES_ROOT, which you'd open to

[HKEY_CLASSES_ROOT\{class name}\Shell\Open\Command which would tell you what, exactly, ShellExecute will run.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号