Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [vb6] impedire una seconda istanza del programma

    come da titolo.. come si fa?
    grazie!
    - - - Salvatore - - -

  2. #2
    Utente di HTML.it L'avatar di Jupy64
    Registrato dal
    Sep 2004
    Messaggi
    1,151
    codice:
    If App.PrevInstance Then
       MsgBox "Già in esecuzione!"
    else
       .....
    end if
    Jupy

  3. #3

    Alessandro Baraldi suggerisce...

    Public Sub Main()
    Dim RetVal As Boolean
    Dim conta as integer
    Dim Process as object

    On Error Resume Next
    conta = 0
    For Each Process In GetObject("winmgmts:").ExecQuery("Select * from
    Win32_Process WHERE Name='TuoProgr.exe'")
    conta = conta + 1
    If conta > 1 Then
    MsgBox "already Running...", vbOKOnly, "Get Out"
    Close All
    Exit Sub
    End If
    End If
    Next
    MainForm.Show
    End Sub
    - - - Salvatore - - -

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.