Skip to content

The old New Roomsend :)

Viewing 16 post (of 16 total)
  • Author
    Posts
  • #187573
    IMAFriend
    Member

    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 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.

Viewing 16 post (of 16 total)
  • You must be logged in to reply to this topic.