0720 發表於 2018-6-11 19:03:51

boindary 發表於 2018-6-11 19:07:13

判斷程序吧??

0720 發表於 2018-6-15 09:43:47

qwe032747 發表於 2018-6-18 22:47:47

0720 發表於 2018-6-15 09:43 static/image/common/back.gif
有語法嗎~

Private Declare Function CreateMutex Lib "kernel32" Alias "CreateMutexA" (lpMutexAttributes As SECURITY_ATTRIBUTES, ByVal bInitialOwner As Long, ByVal lpName As String) As Long
Private Type SECURITY_ATTRIBUTES
        nLength As Long
        lpSecurityDescriptor As Long
        bInheritHandle As Long
End Type
Private Const ERROR_ALREADY_EXISTS = 183&
Private Sub Form_Load()
    Dim sa As SECURITY_ATTRIBUTES
    sa.bInheritHandle = 1
    sa.lpSecurityDescriptor = 0
    sa.nLength = Len(sa)
    Call CreateMutex(sa, 1, App.Title)
    If (Err.LastDllError = ERROR_ALREADY_EXISTS) Then
        MsgBox "請勿重復運行", , ""
        End
    End If
End Sub


VB6防多開的寫法
頁: [1]
查看完整版本: 如何限定此程式只可以開一次