Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Visual Basic (Microsoft) Versions 5/6 FAQ

Windows API

VB in design environment or run-time environment by HermanvLimbeek
Posted: 8 Jul 01

I made a public function which checks the running programs in Windows to see if we're in design-time or run-time environment. If you want to disable certain checks in design-time then just call the function to see if it returns true.

Public Function TestEnv() As Boolean
Dim buffer As String
Dim EnvFileName As String
Dim Envs As Variant
Dim nRet As Long
Dim i As Long

Envs = Array("vb.exe", "vb32.exe", "vb5.exe", "vb6.exe")

For i = LBound(Envs) To UBound(Envs)
   buffer = Envs(i)
   nRet = GetModuleHandle(buffer)
   If nRet <> 0 Then
      EnvFileName = buffer
      TestEnv = True
      Exit For
   End If
End Function

Back to Visual Basic (Microsoft) Versions 5/6 FAQ Index
Back to Visual Basic (Microsoft) Versions 5/6 Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close