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
Create an IntPtr variable which contains the handle of your Silkroad window (to find this handle you can use the -API or the -Class [take a look at ]) and use it in the -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:
Create an IntPtr variable which contains the handle of your Silkroad window (to find this handle you can use the -API or the -Class [take a look at ]) and use it in the -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 )
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.
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.
WindowsInputSimulator (or how to send keys to s4) 10/07/2010 - S4 League - 8 Replies I don't know how many of you have used this but..
I was playing around with it.
void WaveDashThing()
{
System.Threading.Thread.Sleep(2000);
InputSimulator.SimulateKeyPress(VirtualKeyCode.SPA CE);
InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_A );
InputSimulator.SimulateKeyPress(VirtualKeyCode.SPA CE);
InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_A);
Send Keys to minimized PW-Window 07/21/2010 - Perfect World - 3 Replies I want to learn how to send keys to a PW-Window, but it is minimized (because of the other functions my prog has)..
i am programming in vb.net (i know.. not the best language but i am getting along with it quite good) so if anyone knows a simple function or can help me with this.. pls tell me :)
greetz
Deaparately trying to send Keys to the AR window... 04/26/2009 - Ace Online / AirRivals - 0 Replies I'm currently trying to code a joystick-support for AirRivals.
It doesn't work for one (crazy) reason: The game-window only seems to accept its input from the hardware-based keyboard.
Just thought it can be good to consult the "underground", although I'm not wanting to hack AR or to write a bot, but if I send Key-messages to the AR-Handle (using the Windows-API-function postmessage/keybd_event), nothing happens, except if it's a system Key like , or ... for example if I try to send a small...
How do I: Click or Send Keys to a minimized window 04/08/2006 - General Coding - 6 Replies I am making a bot for ConquerOnline, and I need to know how to send clicks or keys to a minimized window, like COPartner does.
Thanks for any help.