i__h4x Grandmaster Cheater Supreme
Reputation: 0
Joined: 09 Jun 2007 Posts: 1005 Location: i__<3's__wpe
|
Posted: Sun Apr 06, 2008 11:03 am Post subject: [VB 2005] Send Message to Console Window |
|
|
Im trying to Read/Write text from the Console in Medal of Honor Allied Assault.
WinSpy++
| Code: | X.exe
Console "User Console"
Edit ""
Button "Quit"
Button "Clear"
Edit "Initilization" |
With the words inside the quotation marks being the windows caption, and before it the windows class name. (The names are made up, just an example)
Currently I am using this code to get the hWnd of the console:
| Code: | Dim chWnd As Integer
chWnd = FindWindow("mohaa winconsole", vbNullString)
Dim ehWnd As Integer
ehWnd = FindWindowEx(chWnd, 0&, "edit", vbNullString)
Dim rtn As Integer = SendMessage(ehWnd, WM_SETTEXT, 0, "Test") |
However, that does not work to send the text to the console.
From looking at this source here of how to set text to the console/read text from console:
http://www.mpcforum.com/archive/index.php/t-84687.html (8th post down)
As far as I can see this is what they do:
Get the console hwnd:
FindWindow(vbNullString, "Mohaa Console")
Call EnumChildWindows(Consolehwnd, AddressOf EnumChildWindowProc, 0&)
If it finds the right window it converts the string to a byte array and then uses sendmessage to send it to the mohaa console, but im trying to convert this/similar to vb.net
_________________
Mes'a back!
 |
|