// ModuleExecuteable delivers the Path and Filename of the current executeable (i.E. c:\VDF7\BIN\DFRUN.EXE or c:\vdf9\projects\hammer\programs\hammer.exe // 2.1.2004 BP Function ModuleExecuteable Global Returns String Handle hModule Integer iRet String sFile Pointer pFile Move (Repeat(Character(0),255)) to sFile Move (addressOf(sFile)) to pFile Move (GetModuleHandle(0)) to hModule Move (GetModuleFileName(hModule,pFile,255)) to iRet Move (CString(sFile)) to sFile Move (Lowercase(sFile)) to sFile Function_Return (cString(sFile)) End_Function // Functions to associate filetypes to the Hammer. Function MainRegistryTag Global Returns String Function_Return "The Hammer" End_Function // Changed to work correct with VDF8 or higher // 2.1.2004 BP Procedure RegisterSelfOpenTAG Global String sPath Move (ModuleExecuteable()) to sPath Move (sPath + " -OPEN") to sPath Send AssignExecutableToTAG_OPEN (MainRegistryTag()) sPath (Append(psStartupBitmapPath(ghoApplication),"\Editor.Ico")) "The Hammer" 1 End_Procedure Procedure RegisterFileType Global String sExt Send AssignExtentionToTAG sExt (MainRegistryTag()) End_Procedure Procedure AsociateAllFileTypes Global Integer hoID iC String sExt sTmp Object oParser is a cLineParser Move Self to hoID Set psSepCharacter to "|" End_Object Send RegisterSelfOpenTAG Send ParseLine to hoID (psFileTypes(ghoEditorProperties)) For iC from 0 to (Item_Count(hoID)-1) Get value of hoID item (iC+1) to sExt Move (Left(sExt,Pos(".",sExt))) to sTmp Move (Replace(sTmp,sExt,"")) to sExt If not "*" In sExt If not "." In sExt Begin Move (Trim(sExt)) to sExt Send RegisterFileType ("."+sExt) End Increment iC End Send Request_Destroy_Object to hoID Send NofityShell_AssocChanged End_Procedure Procedure UnRegisterSelfOpenTAG Global String sPath Move (ModuleExecuteable()) to sPath Move (sPath + " -OPEN") to sPath Send AssignExecutableToTAG_OPEN (MainRegistryTag()) sPath (Append(psStartupBitmapPath(ghoApplication),"\Editor.Ico")) "The Hammer" 1 End_Procedure Procedure UnRegisterFileType Global String sExt Send AssignExtentionToTAG sExt (MainRegistryTag()) End_Procedure Procedure DeassociateAllFileTypes Global Integer hoID iC String sExt sTmp Object oParser is a cLineParser Move Self to hoID Set psSepCharacter to "|" End_Object Send UnRegisterSelfOpenTAG Send ParseLine to hoID (psFileTypes(ghoEditorProperties)) For iC from 0 to (Item_Count(hoID)-1) Get value of hoID item (iC+1) to sExt Move (Left(sExt,Pos(".",sExt))) to sTmp Move (Replace(sTmp,sExt,"")) to sExt If not "*" In sExt If not "." In sExt Begin Move (Trim(sExt)) to sExt Send UnRegisterFileType ("."+sExt) End Increment iC End Send Request_Destroy_Object to hoID Send NofityShell_AssocChanged End_Procedure // DeassociateAllFileTypes