How can I set a file association from a custom file type to a program

前端 未结 1 940
终归单人心
终归单人心 2021-01-25 23:07

Let\'s say I make a custom file that actually corresponds to what my program can read called \"Bacon.dek\". I can access it, modify it, etc. normally from my program, with only

相关标签:
1条回答
  • 2021-01-25 23:37

    Basically you have to do this -

    In registry add these keys

    [HKEY_CURRENT_USER\Software\Classes\dekEditor\shell\open\command]<br/>
    @="c:\path\to\app.exe \"%1\""<br/>
    [HKEY_CURRENT_USER\Software\Classes\.dek]<br/>
    @="dekEditor"<br/>
    

    This is a 2 step task.First you associate your extension .dek with dekEditor (2nd entry) and then specify it in Classes(1st entry).

    Answer taken from: Create registry entry to associate file extension with application in C++

    MSDN Article.

    0 讨论(0)
提交回复
热议问题