How do you get your window handle?
Can i see your code to start client if its not problem ?Quote:
i have tested and it works great with GG look :
[Only registered and activated users can see links. Click Here To Register...]
Private Sub btn_StartClient_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_StartClient.Click
Proxy.Str.Start()
Thread.Sleep(10)
Connected = True
Dim Path As String = "E:\EliteSilkRoad[GameGuardNopped]\sro_client.exe"
Dim Mutex1 As New Mutex(False, "Silkroad Online Launcher")
Mutex1.WaitOne()
Dim Mutex2 As New Mutex(False, "Ready")
Mutex2.WaitOne()
Me.p.StartInfo.FileName = Path
Me.p.StartInfo.Arguments = " 0 /38 0 0"
Me.p.Start()
While Me.p.MainWindowHandle = IntPtr.Zero
Application.DoEvents()
End While
Mutex1.Close()
Mutex1.Dispose()
Mutex2.Close()
Mutex2.Dispose()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SetWindowText(Me.p.MainWindowHandle, "TESTSTRING")
End Sub
try this :Quote:
Code:Private Sub btn_StartClient_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_StartClient.Click Proxy.Str.Start() Thread.Sleep(10) Connected = True Dim Path As String = "E:\EliteSilkRoad[GameGuardNopped]\sro_client.exe" Dim Mutex1 As New Mutex(False, "Silkroad Online Launcher") Mutex1.WaitOne() Dim Mutex2 As New Mutex(False, "Ready") Mutex2.WaitOne() Me.p.StartInfo.FileName = Path Me.p.StartInfo.Arguments = " 0 /38 0 0" Me.p.Start() While Me.p.MainWindowHandle = IntPtr.Zero Application.DoEvents() End While Mutex1.Close() Mutex1.Dispose() Mutex2.Close() Mutex2.Dispose() End SubI press button2 after i login to game.Code:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click SetWindowText(Me.p.MainWindowHandle, "TESTSTRING") End Sub
Btw searching and choosing the (0)th one of sro_client's doesnt help me . Because my tool is based on multi-client.
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Imports System.Threading
Public Class Form1
<DllImport("user32.dll")> _
Public Shared Function SetWindowText(ByVal hdl As IntPtr, ByVal title As String) As Boolean
End Function
Private p As Process
Private Const pathSro As String = "E:\Games\ISilkroad\sro_client.exe"
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub _StartSro_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _StartSro.Click
Dim Mutex1 As New Mutex(False, "Silkroad Online Launcher")
Dim Mutex2 As New Mutex(False, "Ready")
p = Process.Start(pathSro, "/18 0 0")
While p.MainWindowHandle = IntPtr.Zero
End While
Mutex1.Close()
Mutex2.Close()
End Sub
Private Sub _SetWindowText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _SetWindowText.Click
SetWindowText(p.MainWindowHandle, "xdfff")
End Sub
End Class
I tried your and it didnt work as i said.Quote:
did you test with my code ? If not, try it. MainWindowHandle should be different 0.
did u start your application as admin ? test with admin