- This topic has 11 replies, 4 voices, and was last updated 19 years ago by Admin.
-
AuthorPosts
-
July 17, 2005 at 11:15 am #189445cwebzMember
you want to put this coding in your module .. then you want to use this to send the text PALSEND text1.text or what ever txt box you use ..
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_SETTEXT = &HC
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const VK_RETURN = &HD
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Sub PALCHATSEND(TEXT As String)
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atlfe As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
Dim Button As Long
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atlfe = FindWindowEx(wtlsplitterwindow, 0&, "atl:00501680", vbNullString)
atlaxwin = FindWindowEx(atlfe, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, TEXT$)
If richedita = 0 Then
Exit Sub
End If
Do
DoEvents
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atlfe = FindWindowEx(wtlsplitterwindow, 0&, "atl:00501680", vbNullString)
atlaxwin = FindWindowEx(atlfe, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
Loop Until richedita <> 0
End SubJuly 17, 2005 at 8:04 pm #189456AdminAdministrator@cwebz wrote:
you want to put this coding in your module .. then you want to use this to send the text PALSEND text1.text or what ever txt box you use ..
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_SETTEXT = &HC
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const VK_RETURN = &HD
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Sub PALCHATSEND(TEXT As String)
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atlfe As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
Dim Button As Long
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atlfe = FindWindowEx(wtlsplitterwindow, 0&, "atl:00501680", vbNullString)
atlaxwin = FindWindowEx(atlfe, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, TEXT$)
If richedita = 0 Then
Exit Sub
End If
Do
DoEvents
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atlfe = FindWindowEx(wtlsplitterwindow, 0&, "atl:00501680", vbNullString)
atlaxwin = FindWindowEx(atlfe, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
Loop Until richedita 0
End Sub❓ Arghhh ok you left out you need a command button aswell not much use for a textbox without a command button =)°
im trying to figure out why you people put all of this code in a Module anyway i have seen this type of method in a few of the people who program here. To me using a module is just adding on i only place a few of the “Declare Functions” in a module only if needed depends on what im making my anti-ban has all the declare functions in the module 8)
as for this…….
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atlfe As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
Dim Button As Long
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atlfe = FindWindowEx(wtlsplitterwindow, 0&, "atl:00501680", vbNullString)
atlaxwin = FindWindowEx(atlfe, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, TEXT$)
If richedita = 0 Then
Exit Sub
End Ifi just place it in the Private Sub Command1() End Sub
July 18, 2005 at 4:19 am #189455DepartureMemberwell syxx thats not true that you need a command button, what about just hitting the enter key after typing your message in the text box…. :OP
hehehehe i know im just being a smart assPrivate Sub txtbox_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
“Run Code here”
End If
End SubJuly 18, 2005 at 7:11 am #189454cwebzMemberI never did try that I should some time thanks for the idea ..
July 18, 2005 at 1:45 pm #189453AhFoxMemberHmm … I don’t see why you guys don’t change this string
Find:
“atl:00501680”Change:
vbNullString
This will work for 8.0 … 8.1 and maybe new version of paltlak …. if they don’t change the structure.
July 18, 2005 at 1:52 pm #189452DepartureMemberbecause cwebz has used an API spy to get the code, and its very funny due to the fact PSC had a submission today that got rejected and funny enough it was titled the same as this post. But the author claims in his discription that he had “fixed” the code hehehe there is nothing fix about it, like i said it comes stright from an API spy (maybe Pat or JK API spy)
July 21, 2005 at 1:03 am #189451cwebzMembertrue you do have a point I mean it’s harder then hell to actually do it any other way you know urmmm you got a point but hey it works .. I haven’t found any coding yet that did work untill I just figured this out granted I do reak at programming at times
July 23, 2005 at 1:54 pm #189450DepartureMemberDont be hard on your self mate, the main leasson is that you have found this out by your self and not copyed other peoples codes. And that in my eyes makes you more of a VB programmer than some of the other people that claim code as there own when it very clear that they have ripped it of someone eles code.
Anyway what im saying is that you have done well to work this out by self :O)
P.s why did this code get rejected from PSC?? there is nothing harmful in this code
September 1, 2005 at 3:58 am #189449cwebzMemberI duno I wish I new ..
September 1, 2005 at 4:45 am #189448AdminAdministratorWell old news but i use this just about the same as what you used but i think the way i do it better 😀
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atl As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
Dim Button As Long
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00504680", vbNullString)
atlaxwin = FindWindowEx(atl, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, Text$)
If richedita = 0 Then
Exit Sub
End If
Do
DoEvents
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atl = FindWindowEx(wtlsplitterwindow, 0&, "atl:00504680", vbNullString)
atlaxwin = FindWindowEx(atl, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
Loop Until richedita 0
End Suband have this
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
to send the text to the room 😀
September 1, 2005 at 1:26 pm #189447DepartureMemberhmmm syxxx its okay but….
you have un-needed code hehehe
you have this……
Do
DoEvents
mywindowclass = FindWindow(“my window class”, vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, “wtl_splitterwindow”, vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, “wtl_splitterwindow”, vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, “wtl_splitterwindow”, vbNullString)
atl = FindWindowEx(wtlsplitterwindow, 0&, “atl:00504680”, vbNullString)
atlaxwin = FindWindowEx(atl, 0&, “atlaxwin71”, vbNullString)
x = FindWindowEx(atlaxwin, 0&, “#32770”, vbNullString)
richedita = FindWindowEx(x, 0&, “richedit20a”, vbNullString)
richedita = FindWindowEx(x, richedita, “richedit20a”, vbNullString)
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
Loop Until richedita 0
End Subwhen you could have this instead……
Do
DoEventsCall SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
Loop Until richedita 0
End Subyour subclassing down to richedita twice, and you only have tobclass down one because you already have richedita = FindWindowEx(x, richedita, “richedit20a” when you set the text.
September 1, 2005 at 11:00 pm #189446AdminAdministratoryeah but this is not my code thou 😕
i was telling him i think the best way thing to use to send the text to the room would be to use this…
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
-
AuthorPosts
Related
- You must be logged in to reply to this topic.