Welcome to Cobian's site

The home of Cobian Backup

 

HomeAboutSoftwarePicturesGuestbook

   
   

CobView

Cobian Backup

 Cobian Amigo

CobView

Go to CobViews main page

Create plug-ins

Please, download this DEMO plug-in in Delphi

If you are a developer, you may want to create your own plug-in. If you create a cool plug-in and want to publish it, please, send it to me to cobian@educ.umu.se and I will put it on the program's site.

I am NOT responsible for any 3rd parts plug-in. You, as the plug-in author are the responsible for your plug-in functionality and support.

How does it work?

CobView is a shell extension in the form of a context menu that shows when the user right clicks on any file or folder on Windows Explorer. When the user clicks on CobView, the following actions happen:

  •  The program CobView.exe is loaded.

  •  This program search the registry on the key HKEY_LOCAL_MACHINE\SOFTWARE\Cobian\CobView\Ext where the associations are stored.

  •  If the extension of the selected file is found there, the associated plugin is called and the file name is passed to it.

  •  If the extension is NOT found on the registry, the CobGeneral.dll plugin is called then.

As a plug-in developer you can create your plug-ins in any language you want. A plug-in MUST have 2 exported procedures with a fixed format. All other procedures and functions are free. You can download a plug-in example from

http://www.educ.umu.se/~cobian/programz/pluginsample.zip

The two obligatory procedures that must be present on a plug-in are:

procedure RegisterExt;stdcall;

procedure ShowInfo(FileName:PChar);stdcall;

The first procedure is used to register the extensions by the program CobReg.exe. An example in Delphi of what this procedure may do is:

procedure RegisterExt;stdcall;
var
  Reg:TRegistry;
  DllName:array[0..MAX_PATH] of char;
  Dll:string;
begin
   //Register the extensions that the DLL handles
   Reg:=TRegistry.Create;
   try
     Reg.RootKey:=HKEY_LOCAL_MACHINE;
     if Reg.OpenKey ('SoftWare\Cobian\CobView\Ext\',true) then
       begin
         GetModuleFileName(hInstance,DllName,SIzeOf(DllName));
         Dll:=ExtractFileName(String(DllName));
         Reg.WriteString('.ex1',Dll);
         Reg.WriteString('.ex2',Dll);
      end;
  finally
    Reg.Free;
  end;
end;

In this example, the program will register the extensions ex1 and ex2 to be open with your plug-in.

The second procedure will receive the file name as a PChar and it is up to you what to do with this file name.

I recommend you to download the sample program from my site.

Some guidelines:

  • Your plug-in may include a readme file with your Copyright and other legal information. (for example that YOU are the responsible for your plug-in as the author)

  • If you store some configuration keys on the registry, please use the key HKEY_CURRENT_USER\Software\Cobian\CobView\Plugins\YourPlugin where YourPlugin is your plug-in name. See the Delphi example on my site.

  • You can provide your own about box, but you can use my standard box for plug-ins by passing to it your own information. See again the Delphi example.

Happy programming!

   

©1997-2005 by Luis Cobian
cobian@educ.umu.se
All right reserved