So.... that's what i was thinking... Man... you have designed the game... i think you are trying to HOOK another software..... :eek: :confused: :( :mad:
Well.. it becomes so easy..after you declared MohCons to be a top level window..
Change the Console Method as under...
(Run NOtepad.exe before u click the Button)
I used Notepad caz i thought after Mohcons becoming the top window .. they both would be same....
VB Code:
Public Sub Console(cgCmd As String) Dim MohCons As Long Dim ActualConsole As Long MohCons = FindWindowEx(0, 0, vbNullString, "Untitled - Notepad") Do ActualConsole = FindWindowEx(MohCons, ActualConsole, "Edit", vbNullString) Debug.Print getClassNameFromHwnd(ActualConsole) If (ES_READONLY And GetWindowLong(ActualConsole, GWL_STYLE)) Then For x = 1 To Len(cgCmd) SendMessage ActualConsole, WM_CHAR, Asc(Mid(cgCmd, x, 1)), 0 Next SendMessage ActualConsole, WM_CHAR, 13, 0 Exit Sub End If Loop While ActualConsole <> 0 End Sub
Now your two points...
My code first finds the Medal of Honor Allied Assault window then finds mohcons inside it...so you have to make this window available before you want to post something on it.... OBVIOUSLY..
Second. I checked that code with mimic one... so change the code to meet your requirements....OK
