[API]
RegCloseKey

[INCLUDE]
RegOpenKeyEx
RegQueryValueEx_String

[CODE]
Public Function RegisterFileTypes_GetRegistered(ByVal FileType As String, ByVal ProgramCaption As String, Optional ByRef IsDefaultRegistered As Boolean) As Boolean
  Dim xLong1 As Long
  Dim xBool1 As Boolean
  Dim xChar1 As String
  Dim xChar3 As String
  
  FileType = LCase(FileType)
  If RegOpenKeyEx(&H80000000, "." + FileType, 1&, xLong1) Then
    xBool1 = RegQueryValueEx_String(xLong1, "", xChar1)
    Call RegCloseKey(xLong1)
    End If
  
  If xBool1 Then
    xChar3 = xChar1
    If RegOpenKeyEx(&H80000000, xChar1 + "\Shell\" + ProgramCaption + "\Command", 1&, xLong1) Then
      If RegQueryValueEx_String(xLong1, "", xChar1) Then
        RegisterFileTypes_GetRegistered = (LCase(xChar1) = Chr(34&) & LCase(AppBase) & Chr(34&) & " " & Chr(34&) & "%1" & Chr(34&))
        End If
      Call RegCloseKey(xLong1)
      If RegOpenKeyEx(&H80000000, xChar3 + "\Shell", 1&, xLong1) Then
        If RegQueryValueEx_String(xLong1, "", xChar1) Then
          IsDefaultRegistered = (LCase(xChar1) = LCase(ProgramCaption))
          End If
        Call RegCloseKey(xLong1)
        End If
      End If
    End If
  End Function
