Announcement

Collapse
No announcement yet.

File Associations

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File Associations

    Hi there,

    I'd like to associate a file extension (for a new filetype I'm creating with my app) with my app's executable so that I can double-click on the filetype and have the app launch and open it.

    Here's what I believe is the right place to do this:
    HKEY_CLASSES_ROOT
    ApplicationName
    (Default) = Application Name
    CurVer
    (Default) = Version Info
    DefaultIcon
    (Default) = Icon Info
    Shell
    Open
    Command
    (Default) = "%appPath%\App.exe" "%1"

    Any OS differences between 98,NT,2000?

    Also -- according to msdn -- "Any time a file association is created or changed, notify the system that a change has been made by calling SHChangeNotify, specifying the SHCNE_ASSOCCHANGED event. If this is not doen, the Shell might not recognize any changes made until the system restarts".

    Now I could obviously force the user to restart the system to "finish install", but just in case, as I'm not proficient in c++, I'm wondering whether it's possible to call SHChangeNotify through the installer instead. Anyone know the answer?

    Thanks,

    Jenny Dixey

  • #2
    Re: File Associations

    You could try using rundll32.exe or whatever the heck it's called (memory bit clouded by 2am green tea binge at the moment).
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: File Associations

      Thanks, if you think of the utility you're referring to when the green tea fog wears off, please post again!

      Comment


      • #4
        Re: File Associations

        The fog hasn't cleared, but now I'm at work, still high on the caffeine.

        It was indeed rundll32.exe, built into Windows, which provides an entry into the windows API from the command line.

        The following excellent article shows how to use it to call SHChangeNotify to trigger an SHCNE_ASSOCCHANGED event.
        http://www.zdnet.com/pcmag/pctech/co...t1815.006.html

        The actual info about rundll32.exe is a bit later in the article, on page 8:
        http://www.zdnet.com/pcmag/pctech/co...t1815.008.html
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Re: File Associations

          Hmmm...after skimming the article a wee bit less quickly, it appears it isn't as specific to your problem as I originally thought.

          However, I'm confident that with a little bit of Googleing you should be able to take it from there.
          --[[ Indigo Rose Software Developer ]]

          Comment

          Working...
          X