ProgID or CLSID for vb.net apps?

StewartBW 1,145 Reputation points
2024-07-19T04:39:42.3033333+00:00

Hello,

When registering a file type extension for an app written in vb.net framework 4.0:

https://learn.microsoft.com/en-us/windows/win32/shell/how-to-register-a-file-type-for-a-new-application

https://learn.microsoft.com/en-us/windows/win32/shell/how-to-include-an-application-on-the-open-with-dialog-box?source=recommendations

What's my ProgID and CLSID, since they belong to COM objects and the apps is pure .Net.

Those ids are also needed when adding to open with list:

https://learn.microsoft.com/en-us/windows/win32/shell/how-to-include-an-application-on-the-open-with-dialog-box?source=recommendations

  • And if I add to HKEY_CLASSES_ROOT.blah\OpenWithList instead of HKEY_CLASSES_ROOT.blah\OpenWithProgids it will show up in the Open with list in Win10/Win11?

Thanks :)

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,001 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,733 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 32,056 Reputation points Microsoft Vendor
    2024-07-19T08:29:08.0166667+00:00

    Hi @StewartBW ,

    To register a file type for your .NET application and ensure it appears in the "Open with" dialog in Windows 10/11, you need to understand a few key concepts:

    1. ProgID: This is a string that uniquely identifies a programmatic identifier. For .NET applications, the ProgID is typically in the format of Company.Application.
    2. CLSID: This is a globally unique identifier for a COM class object. For pure .NET applications, you typically don't have a CLSID unless you're exposing your .NET class as a COM object.
    3. OpenWithList vs OpenWithProgids: The OpenWithList registry key is used to add an application to the "Open with" list directly, while the OpenWithProgids key associates a ProgID with a file type.
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\.yourfileext]
    @="YourApp.ProgID"
    
    [HKEY_CLASSES_ROOT\YourApp.ProgID]
    @="Your Application Description"
    "FriendlyTypeName"="Your Application Description"
    
    [HKEY_CLASSES_ROOT\YourApp.ProgID\DefaultIcon]
    @="\"C:\\Path\\To\\YourApp.exe\",0"
    
    [HKEY_CLASSES_ROOT\YourApp.ProgID\shell\open\command]
    @="\"C:\\Path\\To\\YourApp.exe\" \"%1\""
    
    [HKEY_CLASSES_ROOT\.yourfileext\OpenWithList\YourApp.exe]
    

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.