Skip to main content
gamedev.net
🔒 Locked

Determining Default Application

Started by nathan123 2 replies 600+ views
Original Post
nathan123
nathan123
I have a program (for windows) and at a certain point in the program, a quicktime movie file is opened. I use the ShellExecute command to open the movie, and that works fine. For example: ShellExecute(NULL,"open",movieFilePath,NULL,NULL,SW_SHOWNORMAL); However, the ShellExecute uses whatever the default application the system has set to open *.mov files. So my questions are as follows: 1. Is there a way to programatically check what the system has set to open *.mov files? (or any type of files for that matter) 2. Is there a way to program and set a "link" between an application and a certain extension (be it .mov or any other)? I'm guessing this may have something to do with the Registry? But I am not really sure. Any info would be greatly appreciated. Thanks.
raz0r
raz0r
Check out: "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts"
SiCrane
SiCrane
HKEY_CLASSES_ROOT\{extension name} 's (Default) value will contain the name of the current handler for the extension. HKEY_CLASSES_ROOT\{handler name}\shell will contain a list of verbs associated with the handler. And the command key for the verb contains the command line associated with the verb. In practice you only need to check HKEY_CLASSES_ROOT\{extension name} to determine the name of the handler, or the existance of that key to check to make sure that a handler exists. Keep in mind that different application versions may install different handler names.
nathan123
nathan123
Thanks for your (quick) replies!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.