- This topic has 5 replies, 2 voices, and was last updated 16 years ago by Chike.
-
AuthorPosts
-
March 14, 2008 at 5:18 am #187651IMAFriendMember
Okay. So I have most of my app going good.
-I have the gui looking sharp,
-I have it load and save some files from hard disk, not too bad.
-I have it fill in my 2 listboxes with the open rooms, and the names from the selected room.
-I can get 3 handles, the room, the text entry, and the send button.Now my next step seems should be easy. Maybe?
I want to send text to the room. I managed to get it to send the basic hello world.Okay. so here is some code.
sendToRoom(rmHandle, rtbTest.Text)
Function sendToRoom(ByVal rmHandle As IntPtr, ByVal txt As String)
Dim rtbHandle As IntPtr
rtbHandle = getVoiceRoomRTBHandle(rmHandle)
SendMessage(rtbHandle, WM_SETTEXT, 0, txt)
Call clickSendButtonHandle(rmHandle)
End FunctionSo right now, my questions are:
-If I call the sendToRoom function (oops, it should be a sub, huh?) twice in a row, it only sends once. What is the best way to get the program to ‘wait’ until it’s ready to send a second time?
-How to send multicolored text? I don’t want to get detailed with this. But how to send [red] Hello [blue] World!?Thanks tons for any
March 14, 2008 at 6:27 am #187656ChikeMember@IMAFriend wrote:
-If I call the sendToRoom function (oops, it should be a sub, huh?) twice in a row, it only sends once. What is the best way to get the program to ‘wait’ until it’s ready to send a second time?
a. It sould be a sub if you don’t care for a return code (e.g. success or failure) and function if you do.
b. That should send the text twice, that’s how all them flooders work, depending of course on how clickSendButtonHandle is implemented which it’s code you did not post 😛@IMAFriend wrote:
-How to send multicolored text? I don’t want to get detailed with this. But how to send [red] Hello [blue] World!?
You need to send RTF text. Normaly that wouldn’t work with Rich Edit control, but they did something in paltalk that make this work.
March 14, 2008 at 10:11 pm #187655IMAFriendMember@Chike wrote:
a. It sould be a sub if you don’t care for a return code (e.g. success or failure) and function if you do.
Probably better programming practice to return a code, but it’s not that important either way. was just making a self-observation about my code. I probably started as a function then realized I didn’t need something returned, or some nonsense like that.
@Chike wrote:
b. That should send the text twice, that’s how all them flooders work, depending of course on how clickSendButtonHandle is implemented which it’s code you did not post 😛
It gets the handle to the avmui cui bitmap button or something like that. then
Call SendMessage(hnd, WM_LBUTTONDOWN, 0, 0)
Call SendMessage(hnd, WM_LBUTTONUP, 0, 0)@IMAFriend wrote:
You need to send RTF text. Normaly that wouldn’t work with Rich Edit control, but they did something in paltalk that make this work.
Yeah, I tried this. It worked. I guess it has limitations, of course. For example, we can send only 3 sizes of text to paltalk. Do we know what those sizes are?
If I made 20 line of text, size 1 to 20, I’d have 20 lines in the room, but at 3 different sizes. Is there an actual size? Probably (and I’ll get to this later if nobody replies or has easier method) I can read From the paltalk and look at the text size of that richtext box somehow.Next step: explore a little with the richtext stuff. Seems easy enough. I guess we don’t need to know all the rtf format, we can use the richtextbox methods and properties. Learning as I go..
March 15, 2008 at 1:23 am #187654ChikeMember@IMAFriend wrote:
It gets the handle to the avmui cui bitmap button or something like that. then
Call SendMessage(hnd, WM_LBUTTONDOWN, 0, 0)
Call SendMessage(hnd, WM_LBUTTONUP, 0, 0)If you follow the event sequence that come as a result of this you will see that this only post a WM_KEYDOWN message with VK_RETURN for the edit field, which means you cannot know when and it is actually processed.
(there’s also a WM_CHAR posted but i don’t know if it’s the result of the WM_KEYDOWN or sent along with it)@IMAFriend wrote:
Do we know what those sizes are?
8 10 and 12 I think, to be sure just drag some multi sized text from the edit field or chat text into wordpad to see the exact sizes and font.
March 15, 2008 at 5:12 am #187653IMAFriendMember@Chike wrote:
@IMAFriend wrote:
It gets the handle to the avmui cui bitmap button or something like that. then
Call SendMessage(hnd, WM_LBUTTONDOWN, 0, 0)
Call SendMessage(hnd, WM_LBUTTONUP, 0, 0)If you follow the event sequence that come as a result of this you will see that this only post a WM_KEYDOWN message with VK_RETURN for the edit field, which means you cannot know when and it is actually processed.
(there’s also a WM_CHAR posted but i don’t know if it’s the result of the WM_KEYDOWN or sent along with it)I’ve seen so many pieces of code recently, I don’t remember who was what and where.
I saw this on one, using the wm_lbuttondown/up, but another module or routine or function didn’t have that, but had one routine to put the text there, and then the next one was a sendmessage with something like .. okay, I found it. This is in the fader.bas thing.
Call SendMessageByString(AORich2, WM_SETTEXT, 0&, Chat$)
Call SendMessageLong(AORich2, WM_CHAR, ENTER_KEY, 0&)
But I couldn’t get this to work, so maybe I did it wrong.
Anyway, thanks again, I’ll report back, with updates, in case anyone is interested.
March 15, 2008 at 5:20 am #187652ChikeMemberI said WM_KEYDOWN message with VK_RETURN. The WM_CHAR comes only later after the text is sent and I don’t think it’s needed.
-
AuthorPosts
- You must be logged in to reply to this topic.