I want to know if my App is running as an EXE or into a VB environment design. How can I know it?
Printable View
I want to know if my App is running as an EXE or into a VB environment design. How can I know it?
try this
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Public Function autonome() As Boolean
Dim strFileName As String
Dim lngCount As Long
strFileName = String(255, 0)
lngCount = GetModuleFileName(App.hInstance, strFileName, 255)
strFileName = Left(strFileName, lngCount)
Dim p
p = UCase(Right(strFileName, 7))
'Attention here
If p <> "VB6.EXE" Then
'code autonome
ideorexe = True
Else
'function under VB6
ideorexe = False
End If
End Function
Bye