Public Function SoftICELoaded() As Boolean
Dim hfile As Long, retval As Long
hfile = CreateFileNS("\\.\SICE", GENERIC_WRITE Or GENERIC_READ, FILE_SHARE_READ Or FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
If hfile <> -1 Then
' SoftICE is detected.
retval = CloseHandle(hfile) ' Close the file handle
SoftICELoaded = True
Else
' SoftICE is not found.
SoftICELoaded = False
End If
End Function

Public Function SmartCheckLoaded() As Boolean
Dim zoek As Long
Dim dfg

dfg = "NMSCMW50"
'search classname
zoek = FindWindow(dfg, vbNullString)
'if result isn`t 0(nothing) then SC is on
If zoek <> 0 Then
SmartCheckLoaded = True
Else
SmartCheckLoaded = False
End If
End Function