Call RoomSend

You can talk about VB programming here

Call RoomSend

Postby locohacker » Thu Feb 03, 2005 8:49 am


Well here what I am using in case u had problems, some people were. :wink:

Code: Select all
Public Sub RoomSend(Text As String)
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atld As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
On Error Resume Next
mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:004d6640", vbNullString)
atlaxwin = FindWindowEx(atld, 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)
    atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:004d6640", vbNullString)
    atlaxwin = FindWindowEx(atld, 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


And to call it

Code: Select all
Call RoomSend(RichTextBox1.TextRTF)


This the old method that the paltalk programers use to send meesges to paltalk rooms.
I just put this cause some people where having problems with Call RoomSend including me, lol :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby Guest » Thu Feb 03, 2005 4:43 pm

Code: Select all
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atld As Long
Dim atlaxwin As Long
Dim x As Long
Dim toolbarwindow As Long
Dim richedita As Long

mywindowclass = FindWindow("my window class", vbNullString)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:004d6640", vbNullString)
atlaxwin = FindWindowEx(atld, 0&, "atlaxwin71", vbNullString)
x = FindWindowEx(atlaxwin, 0&, "#32770", vbNullString)
toolbarwindow = FindWindowEx(x, 0&, "toolbarwindow32", vbNullString)
Call SendMessageLong(toolbarwindow, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessageLong(toolbarwindow, WM_LBUTTONUP, 0&, 0&)
richedita = FindWindowEx(x, 0&, "richedit20a", vbNullString)
richedita = FindWindowEx(x, richedita, "richedit20a", vbNullString)
Call SendMessageByString(richedita, WM_SETTEXT, 0&, Text1.Text)
SendKeys "{ENTER}"
If toolbarwindow = 0 Then
    MsgBox "Error: Cannot find room window dumbass!"
    Exit Sub
End If
End Sub


i use the toolbarwindow to call there is a |> looking thing in the pm's and chat rooms that i use that to send the text :D
Guest
 

heh

Postby Guest » Thu Feb 03, 2005 4:47 pm

by the way the Paltalk Messenger 7.0.4 build 61 has a button now so i use to replace toolbarwindow 8)
Guest
 

Postby locohacker » Thu Feb 03, 2005 11:25 pm

Shit thas better :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby ice_531 » Sat Feb 05, 2005 1:41 pm

don't see the point in all of that... :roll:
Donate<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHFgYJKoZIhvcNAQcEoIIHBzCCBwMCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCs/0uzPIZqTdxEj17Dvq0mb43qiVQqnFY8wD3pzL2I8G7IlDCMgf3gOUVcdvUJCsQ5R2ppTni8oyPGp0AyKKhVCc9q91vkSNLni2q3wkVqXOBzZ3kW6gzCWXYVF5oNiWfVifJKvxvrd8MSF68RLliPvpZ/DyqrNEDcJ0xf1y7vLjELMAkGBSsOAwIaBQAwgZMGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIlkheaAC0HTuAcByAN690+/6Qg3WJZ2tulrVlrc5gms8Hi4uULzVWEJ2eCl+qsTiL0hxhm+cWMkAdmwdVzdCjTycWiytB3yKOb8oYJ44S1CT7UQbhqWmDeW3n9Bf2glwMnzq8fnk8Gvro0Ienjr0gRG84mRcQgDvFz9mgggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCz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KoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNTAxMDMwMDUwMDRaMCMGCSqGSIb3DQEJBDEWBBQh7Pq7/hdSihxV+D/Sbi+QfOnRYTANBgkqhkiG9w0BAQEFAASBgHMeZ8yurETv0eLK9RJvRhLZnnstUneC71UWwACYs2cIvT5ARXpR6IMTZ2QkYgQM5MF642PvPSG6qdEGIpjuodowvKRSRGCpxCJcIAJLVG2ZiYUHFFqO7sK7MfXnyuxROsr84l8GqKf8UKuPOgpgmlVU3mOvkUFxfMShhJbh9/zI-----END PKCS7-----
">
</form>
User avatar
ice_531
imFiles Senior
imFiles Senior
 
Posts: 138
Joined: Tue Dec 28, 2004 10:14 pm
Location: http://www.ice-designz.com

Postby method » Wed Apr 12, 2006 9:44 am

could any one tell me how i can use the code posted by Guest . what modules i need nad what controles in my form?Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby locohacker » Wed Apr 12, 2006 10:08 am

lol check the greeter code it has everything, but check this firs u ad a rich textboxt to your form.

then you add a module by clicking on project then on add module and enter this code, it need some clean up but still it works :)



Code: Select all
Option Explicit
Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) 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 MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal dwLength As Long)
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, Source As Any, ByVal Length As Long)
Private Const WM_SETTEXT = &HC
Private Const EM_GETLINECOUNT = &HBA
Public Const VK_SPACE = &H20
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
Public Const WM_CHAR = &H102
Public Const WM_COMMAND = &H111
Public Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hMenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Long
Public Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean
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 Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) 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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public TREEVIEW_HOOK As Long
Public Const WH_CALLWNDPROC = &H4
Sub RoomSend(Text As String)
Dim mywindowclass As Long
Dim wtlsplitterwindow As Long
Dim atld As Long
Dim atlaxwin As Long
Dim x As Long
Dim richedita As Long
Dim Button As Long
mywindowclass = FindWindow("my window class", Form1.Text1.Text)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:0053d798", vbNullString)
atlaxwin = FindWindowEx(atld, 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", Form1.Text1.Text)
wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atld = FindWindowEx(wtlsplitterwindow, 0&, "atl:0053d798", vbNullString)
atlaxwin = FindWindowEx(atld, 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




then you put a command button on the form and on the command button enter this call to send the text which is in the richtextbox to the paltalk room

Code: Select all
Call RoomSend(RichTextBox1.TextRTF)


aigh thas it but the greeter or funtext code has that already :wink:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby method » Wed Apr 12, 2006 3:23 pm

it give me error :

compile error :
method or data member not found


Private Sub Command1_Click()
Call RoomSend(RichTextBox1.TextRTF)
End Sub


when u say richtext file is that a specile type of textbox ? i could not find it and i just use normal textbox with RichTextBox1 name.
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby locohacker » Wed Apr 12, 2006 7:57 pm

ah you need to add a rcihtectbox to your form, its kindna like the textbox but cooler, you have to go to project click on components and look there for the richtextbox component :)

umm if you want I can make a quick code for ya, i willeven clean it up lol I know my codes always got extra stuff lol :twisted:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby method » Wed Apr 12, 2006 8:06 pm

locohacker wrote:ah you need to add a rcihtectbox to your form, its kindna like the textbox but cooler, you have to go to project click on components and look there for the richtextbox component :)

umm if you want I can make a quick code for ya, i willeven clean it up lol I know my codes always got extra stuff lol :twisted:


man that would be so nice since i just want to learn vb.

Now i get compile error and pointing to :

mywindowclass = FindWindow("my window class", Form1.Text1.Text)

compile error
method or or data member not found
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby BattleStar-Galactica » Wed Apr 12, 2006 9:57 pm

method wrote:
locohacker wrote:ah you need to add a rcihtectbox to your form, its kindna like the textbox but cooler, you have to go to project click on components and look there for the richtextbox component :)

umm if you want I can make a quick code for ya, i willeven clean it up lol I know my codes always got extra stuff lol :twisted:


man that would be so nice since i just want to learn vb.

Now i get compile error and pointing to :

mywindowclass = FindWindow("my window class", Form1.Text1.Text)

compile error
method or or data member not found

make sure you have added a Text1 in your form1 and veryfy if your FindWindow is declared if you declare in a module make sure is public
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby locohacker » Thu Apr 13, 2006 7:33 am

Ah here the code for ya i clean it up :)
Attachments
Text Sender.zip
(2.68 KiB) Downloaded 119 times
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby method » Thu Apr 13, 2006 7:43 am

Many thanks loco for the source code. Could look at my post :

http://www.imfiles.com/paltalk/viewt ... =9568#9568

and let me know what things needed to be changed in order that it work. My intention was to just send text to paltalk send text with out sending it to room. I just want to learn how this findwindow and send text works. Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby locohacker » Thu Apr 13, 2006 7:50 am

u want to send text to patalk room, but without sending it just putting it on the send box :?: I am confuse :shock:
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby method » Thu Apr 13, 2006 7:53 am

locohacker wrote:u want to send text to patalk room, but without sending it just putting it on the send box :?: I am confuse :shock:


i just want to put the text in send box . I just want to learn the basic that is why i want to learn step by step. So i be glad if u look at my code that was just puting file in notpad and tell me what parts do i need to change so that it put the input text to paltalk send box.Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Next

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests