Results 1 to 3 of 3

Thread: How to retrive all items from an external listview?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Talking How to retrive all items from an external listview?

    i created a form and it has a listview with a button. I wonder how i can fill mylistview with all items from external listview which i do not have access to its source code. Thanks

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: How to retrive all items from an external listview?

    need to get the classid of the form and the listview replace the notepad and edit with thoose.

    VB Code:
    1. Option Explicit
    2. Private Const WM_GETTEXT          As Long = &HD
    3. Private Const WM_GETTEXTLENGTH    As Long = &HE
    4.  
    5. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
    6.                                                                      ByVal lpWindowName As String) As Integer
    7. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, _
    8.                                                                          ByVal hWnd2 As Integer, _
    9.                                                                          ByVal lpsz1 As String, _
    10.                                                                          ByVal lpsz2 As String) As Integer
    11. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, _
    12.                                                                        ByVal wMsg As Integer, _
    13.                                                                        ByVal wParam As Integer, _
    14.                                                                        ByVal lParam As String) As Integer
    15. Private Sub Form_Load()
    16.  
    17. Dim hwndl       As Integer
    18. Dim hwndEx     As Integer
    19. Dim intlen     As Integer
    20. Dim buffer     As String
    21.  
    22.     hwndl = FindWindow("Notepad", vbNullString)
    23.     'gets handle of 'edit' area of notepad
    24.     hwndEx = FindWindowEx(hwndl, 0, "edit", vbNullString)
    25.  
    26.     intlen = SendMessage(hwndEx, WM_GETTEXTLENGTH, 0, vbNullString)
    27.    
    28.     buffer = Space$(intlen)
    29.    
    30.     SendMessage hwndEx, WM_GETTEXT, intlen, ByVal buffer
    31.        
    32.     MsgBox buffer
    33.    
    34. End Sub

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: How to retrive all items from an external listview?

    Many thanks for u reply. we here is some of the information i got from 2 of the listviews:

    GradientTreeViewClass
    ATL:0053E440
    WTL_SplitterWindow
    SEINFELD_SUPERMAN


    ---------------------------

    SysListView32
    ATL:0053D8D0
    WTL_SplitterWindow
    WTL_SplitterWindow
    WTL_SplitterWindow

    could u tell me which one of them should i use and replace with part of u code? do i need any module or any thing esle to make it work?
    Furthermore how to populate my listbox with that data? I be happy if u help me with it.Furthermore do i need any captionio information.Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width