unit %ModuleIdent; // // This unit contains the basics necessary for an NSE ShellHandler that does not use the IDEs design time // capabilities. It is created automaticlly when a new EasyNSE project is created. It is necessary to create // Shell Handler components dynamically and assign the properties/events manually, then register them with the // global FactoryManager. There are a few things to remember though. // // 1) If you change the names of the DataModule or the Factory Manager you must // reflect those changes in the function InitializeLibrary below manually. // // 2) Do not add more TEasyFactoryManager objects to the DataModule. // // 3) As Explorer (or other applications that use the shell interfaces) calls to obtain an // interface EasyNSE will create a new copy if the object that implements that particular // handler. // // 4) Be Careful with global resources. There can be numerous objects for a handler created and active // at the same time that are in different threads. // // 5) Be Careful as the objects could also be in different processes so any global variables will // need to be reinitialized when the DLL is loaded in a new process. // // Replace the xxxxxHandler units in the "uses" clause below if using the "EasyIncludeHandler.inc" file in // the $(EASYNSE)\Include folder when trying to reduce the DLL size. These would automaticlly be inserted // below but the IDE will strip out the conditional defined when adding or removing DataModules so it must // be done manually..... sorry. // // Replace this in the uses clause: // // EasyQueryInfoHandler, // EasyPropertySheetHandler, // EasyThumbnailHandler, // EasyContextMenuHandler, // EasyDragDropHandler, // EasyColumnHandler, // EasyCopyHookHandler, // EasyIconHandler, // EasyDropHandler, // EasyDataHandler, // EasyIconOverlayHandler, // EasyNamespaceHandler, // // With this: // // {$IFNDEF NO_QUERYINFOHANDLER}EasyQueryInfoHandler,{$ENDIF} // {$IFNDEF NO_PROPERTYSHEETHANDLER}EasyPropertySheetHandler,{$ENDIF} // {$IFNDEF NO_THUMBNAILHANDLER}EasyThumbnailHandler,{$ENDIF} // {$IFNDEF NO_MENUHANDLERS}EasyContextMenuHandler, EasyDragDropHandler,{$ENDIF} // {$IFNDEF NO_COLUMNHANDLER}EasyColumnHandler,{$ENDIF} // {$IFNDEF NO_COPYHOOKHANDLER}EasyCopyHookHandler,{$ENDIF} // {$IFNDEF NO_ICONHANDLER}EasyIconHandler,{$ENDIF} // {$IFNDEF NO_DROPHANDLER}EasyDropHandler,{$ENDIF} // {$IFNDEF NO_DATAHANDLER}EasyDataHandler,{$ENDIF} // {$IFNDEF NO_ICONOVERLAYHANDLER}EasyIconOverlayHandler,{$ENDIF} // {$IFNDEF NO_NAMESPACEEXTENSION}EasyNamespaceHandler,{$ENDIF} // {$IFNDEF NO_BANDHANDLERS}EasyBandHandlers,{$ENDIF} // interface {$include Compilers.Inc} {$include EasyIncludeHandler.inc} uses Windows, Classes, ActiveX, EasyIDEComponents, EasyCommonObjects, EasyQueryInfoHandler, EasyPropertySheetHandler, EasyThumbnailHandler, EasyContextMenuHandler, EasyDragDropHandler, EasyColumnHandler, EasyCopyHookHandler, EasyIconHandler, EasyDropHandler, EasyDataHandler, EasyIconOverlayHandler, EasyNamespaceHandler, EasyBandHandlers, EasyUtilities; {$R Winxp_DLL.res} procedure InitializeLibrary; procedure FinalizeLibrary; function RegisterLibrary: Boolean; function UnRegisterLibrary: Boolean; implementation function RegisterLibrary: Boolean; // // Called when the DLL is registered as a COM Server with RegSvr32.exe // Return: // Return false if the library should not be registered as a COM Server begin Result := True; end; function UnRegisterLibrary: Boolean; // // Called when the DLL is begin un-registered as a COM Server with RegSvr32.exe // Return: // Return false if the library should not be un-registered as a COM Server begin Result := True; end; procedure InitializeLibrary; // // Called when the library is loaded into a processes memory space or when the // library is loaded for any reason to create the objects to implement the shell // handler or NSE. // // Notes: // Keep any code in this function to a minimum. Do not do any thing that would // cause other DLL's to be loaded within this function // begin // Assign the FactoryManager if necessary if not Assigned(FactoryManager) then FactoryManager := TEasyFactoryManager.Create(nil); end; procedure FinalizeLibrary; // // Called when the library is freed from a processes memory space or when the library // is being released // // Notes: // Keep any code in this function to a minimum. Do not do any thing that would // cause other DLL's to be loaded within this function // begin FreeAndNil(FactoryManager); end; end.