How can I send the keys sro_client?

05/02/2011 04:25 admin53#1
Hello,how can I send keys just sro_client's window with vb6?
I need these codes.I said just because of I want to sendkeys to sro_client's window while what I'm doing something on computer
05/02/2011 13:24 Kraizy​#2
Send-/PostMessage.
05/11/2011 20:06 admin53#3
Quote:
Originally Posted by xKraizy View Post
Send-/PostMessage.
thx but I need some example because I couldn't understand what was writing on other websites.
05/11/2011 20:10 Kraizy​#4
Create an IntPtr variable which contains the handle of your Silkroad window (to find this handle you can use the [Only registered and activated users can see links. Click Here To Register...]-API or the [Only registered and activated users can see links. Click Here To Register...]-Class [take a look at [Only registered and activated users can see links. Click Here To Register...]]) and use it in the [Only registered and activated users can see links. Click Here To Register...]-API.

You could start like this:
Code:
Dim SilkroadHandle As IntPtr = FindWindow(vbNullString, "WINDOW_NAME")
//or
Dim SilkroadHandle As IntPtr = Process.GetProcessesByName("PROCESS_NAME")(0).MainWindowHandle
Now you got your handle and can use the SendMessage-API:
Code:
SendMessage(SilkroadHandle, ...)
05/15/2011 10:15 sarkoplata#5
Quote:
Originally Posted by xKraizy View Post
Create an IntPtr variable which contains the handle of your Silkroad window (to find this handle you can use the [Only registered and activated users can see links. Click Here To Register...]-API or the [Only registered and activated users can see links. Click Here To Register...]-Class [take a look at [Only registered and activated users can see links. Click Here To Register...]]) and use it in the [Only registered and activated users can see links. Click Here To Register...]-API.

You could start like this:
Code:
Dim SilkroadHandle As IntPtr = FindWindow(vbNullString, "WINDOW_NAME")
//or
Dim SilkroadHandle As IntPtr = Process.GetProcessesByName("PROCESS_NAME")(0).MainWindowHandle
Now you got your handle and can use the SendMessage-API:
Code:
SendMessage(SilkroadHandle, ...)
Mainwindowhandle or handle ?
btw vb6 doesn't have process class ( which is extremely good i think :D )
05/15/2011 10:41 Kraizy​#6
Quote:
Mainwindowhandle or handle ?
You need to find the handle of the control you want to send text to. MainWindowHandle is the handle of the MainControl-/Window (the Silkroad game itself) but if you want to send a text to a textbox in another tool you need to go through all parent controls first - use Spy++ to look for them.
05/15/2011 12:12 mrapc#7
How do you know what Programm he use
AutoIt / VB / C# / C++ /P#
05/15/2011 12:48 Kraizy​#8
@mrapc
Quote:
Originally Posted by admin53 View Post
how can I send keys just sro_client's window with vb6?
And, you can use the SendMessage API with vb.net, vb6, c++, c#..
05/15/2011 13:22 sarkoplata#9
Quote:
Originally Posted by xKraizy View Post
@mrapc

And, you can use the SendMessage API with vb.net, vb6, c++, c#..
"Any" statement is not supported in vb.net ,, %90 of google results give you old vb apis.
btw , i am still searching how to find handle of a hidden window. That's possible with auto-it ( don't know how ) , i'm sure it can be done with vb.net but couldn't find any sources about it.