Anyone tried to send a message from VB application to the chat room of paltalk messenger application. If so, please help me, suppose that I've already knew the chat room window title. Thanks
I tried moeur code, but no luck.
Printable View
Anyone tried to send a message from VB application to the chat room of paltalk messenger application. If so, please help me, suppose that I've already knew the chat room window title. Thanks
I tried moeur code, but no luck.
Welcome to the forums vuongthacsi :)
If it is a text box you want to send the message to, You could send a WM_SETTEXT message, provided you know the class name of the text box you are after. If you have Spy++ you can use the Window Finder tool to get the class name, if you don't then you can grab Joacim Andersson's clone from the Codebank section :)
You could also try to use the SendKeys function
Split from an old thread into its own.
Download and install ApiSpy. Run it. Mark the target window as directed and generate code. Copy and paste the code into your project. Test, debug, edit...test...
In my case, the automatically generated code started too far down the tree. If you get null results from the api calls, that is your clue. You must use the set text fn!! Your code needs to cover versions 7 & 8 of PT, there are changes to the window structure of the user interface.
Ben,
At first I thought you were responding to a different question, then I thought maybe not.
APISPY will tell you what API calls a program makes, but nothing else (unless there is a new version out there I didn't know about.)
Did you attempt to spy on paltalk?
What do you mean that it started too far down the tree? Apispy launches the program and starts logging API calls right away.
I'm just curious.
Thank you for all responses, Please have a look at my code, it changes the title of the status bar of paltalk chat room, it is not sending a msg to chat room. Please indicate any error that i made. thanks again.
Private Sub cmdSendStyle_Click()
Dim sTextToSend As String
Dim sRoom As String
Dim sClassName As STring
Dim hWndForm As Long
Dim hWndTextBox As Long
sTextToSend = "Hello all" ' Text to send
sClassName = "My Window Class" ' Class Name of paltalk chatroom window
sRoom = "Music - Voice Group" ' Voice chat room title on the top bar
hWndForm = FindWindow(sClassName, sRoom)
hWndTextBox = FindWindowEx(hWndForm, 0&, vbNullString, vbNullString)
SendMessage hWndTextBox, WM_SETTEXT, 0&, sTextToSend$
End Sub
ApiSpy shows the name & handle of the current window. It has multiple functions. One of them generates code for finding window handles. You drag a yellow life ring to the target window and it generates code for finding each of the windows in the tree.
In my case, it should have started with the top most window in the PT room, but instead, started further down, so that it could not find any windows, always returning a null result. I had to work up to the top of the tree, coding the search at each level.
This is because the window class you are trying to access is a custom class that doesn't act like a text box.Quote:
it changes the title of the status bar of paltalk chat room, it is not sending a msg to chat room.
There was a similar thread earlier by Remix where he was trying to do the same thing to his Trillian program. Here is the link to that thread.
http://www.vbforums.com/showthread.php?t=345700
Or you can PM him to see if he got antwhere
Thanks all, I've got it worked, it sends text to the textbox of paltalk chatroom, now I again have another problem, how can I send that text to the chat room without hit the Enter key on the keyboard
I do not remember if I used send keys or a special command with the api call. one or the other. But I lose all rtf formating set in the richtextbox.
Yes, I use sendkeys, and now it worked perfect :)
Thanks all guys
I don't understand, can you show me the code?Quote:
how can I send that text to the chat room without hit the Enter key on the keyboard
Quote:
Originally Posted by moeur
VB Code:
Call SendMessageLong(richedita, WM_KEYDOWN, 13, 0&)
This is not clear what you are trying to do.
Do you want to click on a button?
Then you can sendkeys "{ENTER}"
After sending the text to the textbox of the paltalk chatroom, we need another step to send that text to the paltalk chatroom screen, to do that I use:Quote:
Originally Posted by moeur
SendKeys "{ENTER}" ' Using enter key to send the text
SendKeys "" ' to stop the enter key, otherwise it will flood the room.
Thanks Ben,Quote:
Originally Posted by Ben Powell
After finding the class name of the paltalk chatroom textbox, I used your code, it worked perfect too. :)