You can use, for instance GetCommandLine API (use the API not Command$) or any other function to retrieve information about the process, that way you can check if you are running under the IDE or not.
Example:
Private Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Private Function IsInIDE() As Boolean
MsgBox GetCommLine
If Not InStr(1, UCase(GetCommLine), "VB6.EXE") = 0 Then
IsInIDE = True
End If
End Function
Private Function GetCommLine() As String
Dim RetStr As Long, SLen As Long
Dim Buffer As String
'Get a pointer to a string, which contains the command line
RetStr = GetCommandLine
'Get the length of that string
SLen = lstrlen(RetStr)
If SLen > 0 Then
'Create a buffer
GetCommLine = Space$(SLen)
'Copy to the buffer
CopyMemory ByVal GetCommLine, ByVal RetStr, SLen
End If
End Function
Private Sub UserControl_Initialize()
MsgBox IsInIDE
End Sub