ActiveX Shell Registration | CodeGuru

ActiveX Shell Registration

Environment: Windows NT4 SP4, Windows 95/98 For those among us who develop ActiveX/COM objects, here’s a little trick to help you with registering/unregistering your components easily. With a simple modification to the registry, you will have additional register/unregister menu options (accessible with the right-mouse button) integrated in your Windows Shell, as shown in the above […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 15, 1999
3 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Sample Image

Environment: Windows NT4 SP4, Windows 95/98

For those among us who develop ActiveX/COM objects, here’s a little trick to help you with
registering/unregistering your components easily. With a simple modification to the registry, you will have
additional register/unregister menu options (accessible with the right-mouse button) integrated in your Windows Shell, as
shown in the above screen shot.

You can also register a component by double-clicking on it!

Note that if you’re paranoid with .reg files (like me ;-), you can manually create the register/unregister
menu for your components (see section “Manual Installation” below).

I also shipped in the kit a new version of regsvr32.exe (called regsvr33…) which print a clear-text error message if
registration fails (instead of an error code).

Automatic Installation


To install the additional menu options in your shell:



  • Open a Windows Explorer
  • Browse to the directory where the .reg files are located:

    DLL_Register_Unregister.reg

    OCX_Register_Unregister.reg
  • Double-click on file DLL_Register_Unregister.reg
  • A dialog box pops-up, saying:

    “Information in DLL_Register_Unregister.reg has been successfully entered into the registry.”
  • Click on the “OK” button”
  • Double-click on file OCX_Register_Unregister.reg
  • A dialog box pops-up, saying:

    “Information in OCX_Register_Unregister.reg has been successfully entered into the registry.”
  • Click on the “OK” button”

The program regsvr32.exe must be in your PATH. Put the program (if you don’t already have it,
it’s in .zip file for this article) in your system directory (e.g. “C:\winnt\system32” on Windows NT).

Manual Installation


To install the additional menu options in your shell:



  • Start a Windows Explorer
  • Select menu option “View” / “Options…
  • Click on tab “File Types
  • Click on button “New Type…
  • Type description of type: ActiveX COMponent
  • Type Content Type (MIME): application/ocx
  • Type Default Extension for Content Type: .OCX
  • Click on checkbox “Enable Quick View
  • Click on button “New…” below (Action)
  • Type Action name: Register
  • Type Application used to perform action: regsvr32.exe “%1”
  • CAUTION: do not forget the double-quotes before and after %1
  • Click on button OK
  • Select action “Register“, click on button “Set Default
  • Click on button “New…” below (Action)
  • Type Action name: Unregister
  • Type Application used to perform action: regsvr32.exe /u “%1”
  • CAUTION: do not forget the double-quotes before and after %1
  • Click on OK
  • Click on button “Change Icon…
  • Pick up an cool icon in shell32.dll, like:


  • Click on OK

Note that there is a difference with automatic registration: you can’t add the menu option for DLLs
(there’s no associated file type in the Windows Explorer…). Only automatic registration can do that.

Advertisement

Usage

    Registering a COMponent


    • Start a Windows Explorer
    • Browse to the directory containing your component
    • Double-click on your component

      OR

      Select the OCX or DLL file, click on right mouse button, select option “Register COMponent”


    • A dialog box pops-up, saying that registration is successfull:


    Unregistering a COMponent


    • Start a Windows Explorer
    • Browse to the directory containing your component
    • Select the OCX or DLL file, click on right mouse button, select option “Unregister COMponent”


    • A dialog box pops-up, saying that unregistration is successfull.

Downloads

Download source – 14 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.