Context Menu (Un)Register OCX and DLL
No attachments for this post
I'm still new to creating ActiveX DLL. After downloading some DLL plugin samples from Planet-Source-Code i found that some of the codes need to register the DLL manually (that is typing "c:windowssystem
egsvr32.exe DLLFILENAME" in MS-DOS prompt) or an extra EXE is created for that purpose. Why not add an "Register DLL" option into context menu (the menu which pops up when you right click on any dll files with your mouse on right panel of Windows Explorer)?
Original Author: Chin Huat
- Click on Start Menu, choose "Run".
- Type "regedit" and click "OK".
- On the left panel of Registry Editor, go to :
(expand the tree with alot of folder icons, from "My Computer", then "HKEY_CLASSES_ROOT" and then "dllfile", by clicking the "+" sign)
- Right click on "dllfile", choose "New" -> "Key".
- Rename the new key to "shell". IT SHOULD BE AT THE SAME LEVEL AS THE "DefaultIcon" KEY!
- Create another key named "Register" under "shell"
- On the right panel, set "(Default)" string value into "Register DLL" by double clicking on it.
- Create another key named "command" under "Register"
- Again, set the "(Default)" string value under "command" to:
- Restart your computer.
- Now, right-click on some DLL files, there should be an extra option "Register DLL". Click on it.
- A message box will appear, displaying the success message.
Just in case you want to add another option called "Unregister DLL", you can create another key named "Unregister" under "shell" ("Unregister" should be the same level as "Register") and set the "(default)" string value to "Unregister DLL". Under "Unregister", create another key called "command" and set the "(default)" string value to
C:WindowsSystemRegSvr32.Exe /u "%1"
Restart your computer. "Unregister DLL" should be available in context menu. The same trick applies to all file types. Let me know if you still have any problem.
- To make the same option available for .OCX files, search for "ocxfile" key under "HKEY_CLASSES_ROOT" and repeat step 4 to 12
- Let say if you want to add a shell option to a file with extension .ABC , you must find the ".ABC" key under "HKEY_CLASSES_ROOT". Memorize the default value under the key, (eg, "(Default)" is set to "ABCFile"). Find the key with the same same as the value (in this case, the key name is "ABCFile"). Now repeat from step 4 to 12. IF YOU CREATE THE "shell" key under ".ABC", THINGS WILL NOT WORK OUT!
- Backup your registry file so that you can restore them, just in case anything worse happen. Choose "Registry" from the menu, then "Export Registry File". The rest should be self explainable.
- Windows ME (and 2000?) already have this built-in function. The "Open With" context menu option now contains "Microsoft(C) Register Server". Clicking on it will register the DLL only but not unregister it!
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.