The old New Roomsend :)

You can talk about VB programming here

Re: The old New Roomsend :)

Postby IMAFriend » Fri Apr 18, 2008 8:11 pm


So here's my code:

Code: Select all
    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.

Code: Select all
        ' 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

Code: Select all
        ' 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.

Code: Select all
        ' 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.

Code: Select all
        ' 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 Sub


Now 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.
IMAFriend
imFiles Newbie
imFiles Newbie
 
Posts: 12
Joined: Sun Mar 02, 2008 4:51 am

Previous

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests