PDA

View Full Version : vB Send to Console



IssisX
24th July 2003, 07:55
Hm, well I have been working on this for a bit. I can't seem to get it to work. So, I came here. I'm trying to send commands directly to a game console (Mohaa). I have the working c++ code to do it. So I ported it into vB. I just dont know what's wrong with it. If anyone can help, it would be great. Heres the code:

' in my form
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Sub Console(ByVal cgCmd As String)
Dim MohCons As Long

Me.AutoRedraw = True
MohCons = FindWindow(vbNullString, "Mohaa Console")
EnumChildWindows MohCons, AddressOf EnumChildSendCommandProc, ByVal 0&
End Sub
' my button
Private Sub Command1_Click()
Console "set name IssisX"
End Sub

' in my module
' my constants
Public Const GWL_EXSTYLE = (-20)
Public Const WM_CHAR = &H102
Public Const WM_SETTEXT = &HC
Public Const ES_READONLY = &H800&
' my declarations and functions
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long

Function EnumChildSendCommandProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim lpClassName As String
Dim L As Long

lpClassName = Space$(1024)
L = GetClassName(hwnd, lpClassName, 1024)
If (LCase$(ClassName) <> "edit") Or ((GetWindowLong(hwnd, GWL_STYLE) And ES_READONLY) = ES_READONLY) Then
EnumChildSendCommandProc = True
Exit Function
End If
Form1.Print Hex$(lParam)
'continue enumeration:
EnumChildProc = 1
End Function

I have attatched the working c++ code if anyone would like to try from scratch. Thank ya

IssisX
24th July 2003, 07:56
Awesome, forgot to post it. Here it is..

IssisX
25th July 2003, 07:43
That's odd that noone can help me. All ya gotta do is try. I try as much as I can, I also contribute a hella much, annnnd I get nothing in return, thx ;)

IssisX
26th July 2003, 04:55
It's vB. Cmon '1337' ppl.

IssisX
28th July 2003, 13:18
Hello (hello) (hello) (hello).......earth to so called 1337 coders......wtf is so hard? I dont know c++, and if u know c++ and not vB, well thats sad d00ds. Holy hell, just help a brotha out y0. How many leechers Dled the code, 6?

Ali_C
28th July 2003, 21:48
i know C++ and not vb, haha

MoFo
28th July 2003, 22:37
I dont think there's alot of vb coder here, most of the are c++, you should ask in a vb forum, they would help u faster, and they should know what they are doin :)

Kamadi
28th July 2003, 23:10
I'm not that good at vb lol...

Bubb Rubb
29th July 2003, 00:20
Don't forget C#. The CLR is tight!

Das...Oppollum
29th July 2003, 00:28
How about a seach on planet-source-code? (http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?optSort=Alphabet ical&txtCriteria=quake+console&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=1)

IssisX
29th July 2003, 13:00
Now how in the world did you find that? I've looked and looked and loooked and looked and looked and looked...and found nothing. So I started making my own. Hm, I'll try modding it to my needs and tell ya how it works, thank ya, alot.

IssisX
29th July 2003, 14:29
100% effective. Thanks d00d

Jesus Claus
31st July 2003, 22:47
ROFL!!! ^^^^^ WOW IssisX you were not kiding when u said u could pick C++ and other shit up fast

PAS3I2
1st August 2003, 03:20
it was VB, not C++..........