Below you'll find the source for the Visual Basic 6 function InIdeMode.
Attribute VB_Name = "modInIdeMode"
' These functions are downloaded from:
' http://www.stefanthoolen.nl/archive/vb6-functions/
'
' You may freely distribute this file but please leave all comments, including this one, in it.
'
' @Author Stefan Thoolen <mail@stefanthoolen.nl>
' Required for InIdeMode()
Private InIdeMode_chk As Boolean
Option Explicit
''
' Always returns true
' Part of InIdeMode()
' @return Boolean Always true
' @author Stefan Thoolen <mail@stefanthoolen.nl>
Private Function InIdeMode_subcheck() As Boolean
InIdeMode_chk = True
InIdeMode_subcheck = True
End Function
''
' Checks if we are in IDE mode
' Part of InIdeMode()
' @return Boolean True if we are in IDE mode, false if we are not
' @author Stefan Thoolen <mail@stefanthoolen.nl>
Public Function InIdeMode() As Boolean
InIdeMode_chk = False
' Debug.Assert does not work outside the IDE mode
' So outside IDE mode, chk will stay false
Debug.Assert InIdeMode_subcheck() Or True
' We'll return the check
InIdeMode = InIdeMode_chk
End Function