;Autor: ts-soft EnableExplicit Define TXTProgramm.s Procedure.s GetAssociatedProgram(Extension.s) Protected AssociatedProgram$, hKey.l, KeyValue.s, datasize.l, Pos.l, KeyNext.s KeyValue.s = Space(255) datasize.l = 255 If RegOpenKeyEx_(#HKEY_CLASSES_ROOT, "." + Extension, 0, #KEY_READ, @hKey) = #ERROR_SUCCESS If RegQueryValueEx_(hKey, "", 0, 0, @KeyValue, @datasize) = #ERROR_SUCCESS KeyNext.s = Left(KeyValue, datasize-1) hKey.l = 0 KeyValue.s = Space(255) datasize.l = 255 If RegOpenKeyEx_(#HKEY_CLASSES_ROOT, KeyNext + "\Shell\Open\Command", 0, #KEY_READ, @hKey) = #ERROR_SUCCESS If RegQueryValueEx_(hKey, "", 0, 0, @KeyValue, @datasize) = #ERROR_SUCCESS AssociatedProgram$ = Left(KeyValue, datasize-1) EndIf EndIf EndIf EndIf Pos = FindString(LCase(AssociatedProgram$), ".exe", 1) If Pos <> 0 AssociatedProgram$ = Left(AssociatedProgram$, Pos + 4) AssociatedProgram$ = RemoveString(AssociatedProgram$, Chr(34), 1) EndIf ProcedureReturn AssociatedProgram$ EndProcedure TXTProgramm.s = GetAssociatedProgram("txt") If TXTProgramm.s="" MessageRequester("","Für txt besteht keine Zuordnung.",0) Else MessageRequester("","txt ist ''" + GetFilePart(TXTProgramm) + "'' und ist zugeordnet in ''" + GetPathPart(TXTProgramm)+"''.",0) EndIf