If you want to know, whether your program runs currently in the IDE or as exe in runtime mode, you can do it like this :
GeSHi (vb):
Private Function IsInIDE() As Boolean
'Disable errorhandling
On Error Resume Next
'This is only executed in ide...
Debug.Print 1 / 0
'... and it throws out an error ;)
Select Case err.Number
Case 0
'If there is no error, we are in runtime mode
IsInIDE = False
Case Else
'else we're in ide mode
IsInIDE = True
End Select
'Enable errorhandling and clear the error
On Error GoTo 0
err.Clear
End Function
Created by GeSHI 1.0.7.20