Forum Replies Created
-
AuthorPosts
-
April 19, 2008 at 1:11 am #187573IMAFriendMember
So here’s my code:
Sub set_ptROOM(ByRef rm As sRoom)
' five handles to find:
' Room, Read, Write, Send, List
' first we find out Room Handle
rm.rmHandle = FindWindow("dlggroupchat window class", rm.rmFullName)This gives my room handle. The four items in the room have the same ‘trunk.
' Then Read, Write, Send, List all have same base
hnd = FindWindowEx(rm.rmHandle, IntPtr.Zero, "wtl_splitterwindow", vbNullString)
hnd = FindWindowEx(hnd, IntPtr.Zero, "wtl_splitterwindow", vbNullString)
hnd = FindWindowEx(hnd, IntPtr.Zero, "wtl_splitterwindow", vbNullString)
hnd = FindWindowEx(hnd, IntPtr.Zero, "wtl_splitterwindow", vbNullString)Now we pick at each item. Listview first
' Listview handle from hnd
rm.rmListHandle = FindWindowEx(hnd, IntPtr.Zero, "wtl_splitterwindow", vbNullString)
rm.rmListHandle = FindWindowEx(rm.rmListHandle, IntPtr.Zero, "atl:006fb328", vbNullString)
rm.rmListHandle = FindWindowEx(rm.rmListHandle, IntPtr.Zero, "syslistview32", vbNullString)Now we extend the new ‘base’ handle.
' Read, Write, Send all share 1 more level
hnd = FindWindowEx(hnd, IntPtr.Zero, "atl:006fb050", vbNullString)Now each of the three will get their handle.
' Read handle from hnd
hndParent = hnd
rm.rmReadHandle = FindWindowEx(hndParent, IntPtr.Zero, "atlaxwin71", vbNullString)
rm.rmReadHandle = FindWindowEx(hndParent, rm.rmReadHandle, "atlaxwin71", vbNullString)
rm.rmReadHandle = FindWindowEx(rm.rmReadHandle, IntPtr.Zero, "#32770", vbNullString)
rm.rmReadHandle = FindWindowEx(rm.rmReadHandle, IntPtr.Zero, "richedit20a", vbNullString)
' Write handle from hnd
hndParent = FindWindowEx(hnd, IntPtr.Zero, "atlaxwin71", vbNullString)
hndParent = FindWindowEx(hndParent, IntPtr.Zero, "#32770", vbNullString)
rm.rmWriteHandle = FindWindowEx(hndParent, IntPtr.Zero, "richedit20a", vbNullString)
rm.rmWriteHandle = FindWindowEx(hndParent, rm.rmWriteHandle, "richedit20a", vbNullString)
' Send handle from hnd
rm.rmSendHandle = FindWindowEx(hnd, IntPtr.Zero, "avmui_cuibitmapbutton", vbNullString)
End SubNow when ever I want to use the handle, I just use rm.rmWriteHandle or rm.rmSendHandle.
I probably should make each item not have the rm prefix, but I’m not really up to par on coding standards.
April 18, 2008 at 5:12 am #184909IMAFriendMember@String wrote:
In another thread you said it was vietnamese, are you sure? I translated it but it still made no sense. Try it yourself, and if the letters in the message are ΕΎΓΓ and etc then enter it that way,
It’s definitely vietnamese.
If you took most chat or casual language and put it in a translater, it’d not help much either.
If u take dis an put in da transl8tr the dang ting wud laff at u
I know a little bit of viet, but not much. I think it says..
Khi con trai PT tang nick cho con gai thi ho dang lam gi???
When a boy PT (tang?) nick gives a girl (thi ho) will do what?I think it’s asking what will a girl do for a boy who gives he a colored nick??
April 17, 2008 at 11:46 pm #187576IMAFriendMemberAre we talking about getting the handles to the chat windows n stuff?
This is what I did. I haven’t tested with varioud colored nicks so I don’t know.
A) What do I want handles for?
-RoomText
-InputTextBox
-SendButton
-ListViewI made an object called ptRoom, which has 4 members, listed above.
Imagine each letter is a handle down the line. some are the wtl splitter, some are the atl stuff, etc.
So, it’s like a tree. I mapped it out.
-RoomText goes A.B.C.D.E.H.J.L
-InputTBox is A.B.C.D.E.F
-SendButton is A.B.C.D.E.G
-ListView is A.B.C.D.E.H.MI made one subroutine that went A.B.C.D.E (all 4 items go that far), and made this my ‘base’ handle.
Then I branched out to F and assigned that handle to my ptRoom.InputTBox
Then I branchced out from Base to G and assigned that to my ptRoom.SendButton
Then I branched out from base to H (new base)
From the new base, I got the J and L, for my RoomText and M for the ListView.Basically, I made one subroutine that follows the ‘tree’, sets a base where they start branching, and assigned all 4 items at one time.
That gives me a room object (ptRoom) with all 4 handles that I need, and I don’t have to look for the handles more than one time per room.
When the user clicks on the room or the room is opened or however you want to implement it, it finds your four handles and yer done.
Hopefully that makes sense. It might have to be modified for different colors or checking on that. And my description might be slighly off for how many branches, but the concept is there, and this probably will produce pretty efficient code.
G’luck.
March 29, 2008 at 3:25 pm #187597IMAFriendMember@Chike wrote:
Yes, get the image with LVM_GETITEM mask = LVIF_IMAGE, iSubItem = 1, and check the iImage field.
You can check the iImage for cams for iSubItem 0
Awesome. This is exactly what I was looking for. Now to see how elegantly I can implement it. Do I have to call that whole procedure 1 time for the nick, and a second time for the subitem 1? That’ll give me something to do this morning.
Are there subitems 3, 4, …?
How can you get this info? The api spy doesn’t help much. I looked and looked (maybe not using the right keywords) and couldn’t figure out how to extract subitem info, or headerinfo, using api stuff.
Anyway, thanks again for the response.
DougB
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 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 4, 2008 at 3:00 am #187758IMAFriendMember@Chike wrote:
First of all I think you must use Long instead of integer. SendMessage integers’ are 32 bit and basic integer is 16 bit (not completely sure, but be safer to use Long.)
vb.net variables of integer are 32 bit now. I’ll double check to make sure I’ve got 32 bits going into the sendmessage.
@Chike wrote:
Second, you have the code you need just few posts before yours, look at MessageCrossProcess.
@Chike wrote:
For your own process you can use VarPtr that to get the structure address, or declare another variant of send message to take lParam as Ref.
I’ll look at both these a bit closer. I’ve looked at so many files and samples and trying to update to the net stuff is a pain, I wish I had vb6 again. delegates and ‘as any’ and integers, oh my.
@Chike wrote:
However sending those messages to paltalk involves more than that. You need to allocate the structure in paltalk address space, and this code does it.
Okay, I am able to get the handle to the syslistview32, and with that handle I can get the Count, and I can run the scroll up and down. But to read the contents I need to dive deeper into the paltalk address space, right? I’ll review the code some more to work on that next.
@Chike wrote:
As for how to declare the LVITEM structure try to look at the attachment in this post.
Got that part taken care of.
Thanks bunches for the patience with me. I have a good app that I have in mind. Maybe not useful to many people, but useful to me and a few friends. So this is a good learning session for me. Just gotta keep working it til that light above my head turns on. π‘
March 3, 2008 at 3:56 am #187761IMAFriendMemberCool, now I’m getting started at least. It’s tough to find good info on this stuff.
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
And the docs seem to say for my four parameters, I need to use the handle, the LVM_GetItemText constant, the ‘selectedIndex’ type of property, and the LVMITEM structure (type) with the sendmessage.
How can I do that, the sendmessage is asking for lParam of int, not struct:LVMItem.
Can I just duplicate the sendmessage function?
March 2, 2008 at 10:11 am #187763IMAFriendMemberI’m having problems getting even the basic stuff working. My gui looks great, now I’m trying to get the code to interact with paltalk.
I’m trying to get the list of users in a room to a listbox on my form. Seems basic enough.
When I try use API to count the (dummy data) number of items on my form’s listbox, it’s fine. vb.net gives the handle as an intptr, so I use lstPassages.handle.toint32.
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Dim LCount As Integer
LCount = SendMessage(lstPassages.Handle.ToInt32, LB_GETCOUNT, 0&, 0&)
That gives me a value of 8 in LCount, which is great.
But when I get my handle from the Paltalk syslistview32, and it seems to be the right handle, LCount gives me a value of 0. π I”m using
Dim dlggroupchatwindowclass As Integer, wtlsplitterwindow As Integer, atlfb As Integer
Dim syslistview As Integer
dlggroupchatwindowclass = FindWindow("dlggroupchat window class", vbNullString)
wtlsplitterwindow = FindWindowEx(dlggroupchatwindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atlfb = FindWindowEx(wtlsplitterwindow, 0&, "atl:006fb328", vbNullString)
syslistview = FindWindowEx(atlfb, 0&, "syslistview32", vbNullString)
Dim LCount As Integer
LCount = SendMessage(syslistview, LB_GETCOUNT, 0&, 0&)
All those lines are giving me reasonable numbers, and I get some number for syslistview that seems like it should be the right handle. Why can’t I even get a count? I haven’t gotten as far as getting items from the box yet, but if I can’t get a count, then I’m not on the right track.
Any help?
-
AuthorPosts