1f4b8e57fSBram MoolenaarREADME.txt for the gvimext DLL. 2f4b8e57fSBram Moolenaar 3f4b8e57fSBram MoolenaarWritten by Tianmiao Hu. Edited by Bram Moolenaar. 4f4b8e57fSBram Moolenaar 5f4b8e57fSBram Moolenaar 6f4b8e57fSBram MoolenaarINSTALLATION 7f4b8e57fSBram Moolenaar 8f4b8e57fSBram MoolenaarTo install the "Edit with Vim" popup menu entry, it is recommended to use the 9f4b8e57fSBram Moolenaar"install.exe" program. It will ask you a few questions and install the needed 10f4b8e57fSBram Moolenaarregistry entries. 11f4b8e57fSBram Moolenaar 12f4b8e57fSBram MoolenaarIn special situations you might want to make changes by hand. Check these 13f4b8e57fSBram Moolenaaritems: 14*38f1eeacSBram Moolenaar- The gvimext.dll, gvim.exe and uninstall.exe either need to be in the search 15f4b8e57fSBram Moolenaar path, or you have to set the full path in the registry entries. You could 16f4b8e57fSBram Moolenaar move the gvimext.dll to the "windows\system" or "windows\system32" 17f4b8e57fSBram Moolenaar directory, where the other DLL files are. 18f4b8e57fSBram Moolenaar- You can find the names of the used registry entries in the file 19f4b8e57fSBram Moolenaar "GvimExt.reg". You can edit this file to add the paths. To install the 20f4b8e57fSBram Moolenaar registry entries, right-click the gvimext.reg file and choose the "merge" 21f4b8e57fSBram Moolenaar menu option. 22f4b8e57fSBram Moolenaar- The registry key [HKEY_LOCAL_MACHINE\Software\Vim\Gvim] is used by the 23f4b8e57fSBram Moolenaar gvimext.dll. The value "path" specifies the location of "gvim.exe". If 24f4b8e57fSBram Moolenaar gvim.exe is in the search path, the path can be omitted. The value "lang" 25f4b8e57fSBram Moolenaar can be used to set the language, for example "de" for German. If "lang" is 26f4b8e57fSBram Moolenaar omitted, the language set for Windows will be used. 27f4b8e57fSBram Moolenaar 28f4b8e57fSBram MoolenaarIt is the preferred method to keep gvim.exe with the runtime files, so that 29f4b8e57fSBram MoolenaarVim will find them (also the translated menu items are there). 30f4b8e57fSBram Moolenaar 31f4b8e57fSBram Moolenaar 32f4b8e57fSBram MoolenaarUNINSTALLATION 33f4b8e57fSBram Moolenaar 34f4b8e57fSBram MoolenaarTo uninstall the "Edit with Vim" popup menu entry, it is recommended to use 35f4b8e57fSBram Moolenaarthe "uninstal.exe" program. 36f4b8e57fSBram Moolenaar 37f4b8e57fSBram MoolenaarIn special situations you might want to uninstall by hand: 38f4b8e57fSBram Moolenaar- Open the registry by running regedit.exe. 39f4b8e57fSBram Moolenaar- Delete all the keys listed in GvimExt.reg, except this one: 40f4b8e57fSBram Moolenaar [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved] 41f4b8e57fSBram Moolenaar For this key, only delete one value: 42f4b8e57fSBram Moolenaar "{51EEE242-AD87-11d3-9C1E-0090278BBD99}"="Vim Shell Extension" 43f4b8e57fSBram Moolenaar- Delete the gvimext.dll, if you want. You might need to reboot the machine 44f4b8e57fSBram Moolenaar in order to remove this file. A quick way is to log off and re-login. 45f4b8e57fSBram Moolenaar 46f4b8e57fSBram MoolenaarAnother method is by using the uninst.bat script: 47f4b8e57fSBram Moolenaar uninst gvimext.inf 48f4b8e57fSBram MoolenaarThis batch file will remove all the registry keys from the system. Then you 49f4b8e57fSBram Moolenaarcan remove the gvimext.dll file. 50f4b8e57fSBram MoolenaarNote: In order for this batch file to work, you must have two system files: 51f4b8e57fSBram Moolenaarrundll32.exe and setupapi.dll. I believe you will have rundll32.exe in your 52f4b8e57fSBram Moolenaarsystem. I know windows nt 4.0 with the service pack 4 has setupapi.dll. My 53f4b8e57fSBram Moolenaarwindows 95 has setupapi.dll. I find that the internet explorer 4.0 comes with 54f4b8e57fSBram Moolenaarthe setupapi.dll in file Ie4_5.cab. 55f4b8e57fSBram Moolenaar 56f4b8e57fSBram MoolenaarIf you do encounter problems running this script, then probably you need to 57f4b8e57fSBram Moolenaarmodify the uninst.bat to suit to your system. Basically, you must find out 58f4b8e57fSBram Moolenaarwhere are the locations for your rundll32.exe and setupapi.dll files. In 59f4b8e57fSBram Moolenaarwindows nt, both files are under c:\winnt\system32 directory. In my windows 95 60f4b8e57fSBram Moolenaarsystem, I got setupapi.dll at c:\windows\system and rundll32.exe at 61f4b8e57fSBram Moolenaarc:\windows. So you might want to try something like: 62f4b8e57fSBram Moolenaar rundll32.exe c:\windows\system\setupapi.dll,InstallHinfSection DefaultUninstall 128 %1 630c4b5bd3SBram Moolenaarwhere %1 can be substituted by gvimext.inf 64f4b8e57fSBram Moolenaar 65f4b8e57fSBram Moolenaar 66f4b8e57fSBram MoolenaarTHE SOURCE CODE 67f4b8e57fSBram Moolenaar 68f4b8e57fSBram MoolenaarI have provided the source code here in hope that gvim users around world can 69f4b8e57fSBram Moolenaarfurther enhance this little dll. I believe the only thing you need to change 70f4b8e57fSBram Moolenaaris gvimext.cpp file. The important two functions you need to look at are 71f4b8e57fSBram MoolenaarQueryContextMenu and InvokeCommand. You can modify right-click menus in the 72f4b8e57fSBram MoolenaarQueryContextMenu function and invoke gvim in the InvokeCommand function. Note 73f4b8e57fSBram Moolenaarthe selected files can be accessed from the DragQueryFile function. I am not 74f4b8e57fSBram Moolenaarfamiliar with the invoking options for gvim. I believe there are some 75f4b8e57fSBram Moolenaarimprovements that can be made on that side. 76f4b8e57fSBram Moolenaar 77f4b8e57fSBram MoolenaarI use MS Visual C++ 6.0's nmake to make the gvimext.dll. I don't have a 78f4b8e57fSBram Moolenaarchance to try earlier versions of MSVC. The files that are required for build 79f4b8e57fSBram Moolenaarare: 80f4b8e57fSBram Moolenaar gvimext.cpp 81f4b8e57fSBram Moolenaar gvimext.h 82f4b8e57fSBram Moolenaar gvimext.def 83f4b8e57fSBram Moolenaar gvimext.rc 84f4b8e57fSBram Moolenaar resource.h 85f4b8e57fSBram Moolenaar Makefile 86f4b8e57fSBram Moolenaar 87f4b8e57fSBram MoolenaarTo compile the DLL from the command line: 88f4b8e57fSBram Moolenaar vcvars32 89f4b8e57fSBram Moolenaar nmake -f Makefile 90f4b8e57fSBram Moolenaar 91f4b8e57fSBram MoolenaarIf you did something interesting to this dll, please let me know 92f4b8e57fSBram Moolenaar@ [email protected]. 93f4b8e57fSBram Moolenaar 94f4b8e57fSBram MoolenaarHappy vimming!!! 95