Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow Only One Instance of Client
#1
Author: Dragoons Master
Difficulty: 1/5
See also: http://www.key2heaven.net/ms/forums/viewtopic.php?t=59

:: CLIENT SIDE ::
Add this into modGameLogic:
Code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Add this on top of Sub Main():
Code:
Call MultiClient

Add this sub into modGameLogic:
Code:
Sub MultiClient()
    Dim GameClient As Long
    Dim OldAppName As String
    OldAppName = App.Title
    App.Title = ""
    GameClient = FindWindow(vbNullString, OldAppName)
    App.Title = OldAppName
    If App.PrevInstance = True Or GameClient  0 Then
        Call MsgBox("Client already running!", vbExclamation, "Error")
        End
    End If
End Sub
That's all!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)