Skip to content

calling Any one who has worked with Syslistview and API call

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #188851
    LoCNiNjA
    Member

    Hi dudes and dudets I am looking for some one who can handle vb code v good to help with project am doing at the moment please if you whish to help please PM me or leave a post here also if you not rely intrested please dont leave any comments unless there helpfull cos don’t have time to argue who is the better coder out of you all just need to get this part working and it will be nearley ready here is what i want to do i am already got the handle of the list view need to loop though the nicks in the list view and chechk them against the nic in the vaireable in my code when it finds it i want to send the correct message to it to turn that nic the specified color using RGB color at the moment i can send a color to the list view and it turns any black nics to what ever color i select but that would not be good enough I want to be able to select just one nick and color that one has any one got any idea’s if you do i will gladly share the finished program with ya all and help u when i can

    8) 😀

    #188857
    LoCNiNjA
    Member

    guess it a bit too hard for you guys hunever mind if i figuer it out ill let you know lol 😆

    #188856
    LoCNiNjA
    Member

    can anyone see why i am not getting the message box poping up with the names in the list her is the code i have the vairiablewith the syslistview already at this point


    For hIndex = 0 To lngCount - 1


    For hItem = 0 To 2


    With objItem
    .mask = LVIF_TEXT
    .iSubItem = hItem
    .pszText = Space$(32)
    .cchTextMax = Len(.pszText)
    End With



    r = SendMessage(SLVWhwnd, LVM_GETITEMTEXT, hIndex, VarPtr(objItem))


    sItem = Left$(objItem.pszText, r)



    If sItem "" Then MsgBox sItem
    Next hItem



    Next hIndex

    can you tell me if this is wrong ????????????????? 😯

    #188855
    Admin
    Administrator

    is this for paltalk nick list ❓

    #188854

    if that is you work with external listview it not correct to get listview item like that. you can try this code bellow. you have just start vb project and add 1 button and add this code into you form.

    Private Const PROCESS_QUERY_INFORMATION = 1024
    Private Const PROCESS_VM_OPERATION = &H8
    Private Const PROCESS_VM_READ = &H10
    Private Const PROCESS_VM_WRITE = &H20
    Private Const STANDARD_RIGHTS_REQUIRED = &HF0000
    Private Const MAX_LVMSTRING As Long = 255
    Private Const MEM_COMMIT = &H1000
    Private Const PAGE_READWRITE = &H4
    Private Const LVIF_TEXT As Long = &H1
    Private Const MEM_RELEASE = &H8000
    Private Const LVM_FIRST = &H1000&
    Private Const LVM_GETITEMCOUNT = LVM_FIRST + 4
    Private Const LVM_GETITEMTEXT As Long = (LVM_FIRST + 45)
    Private Type LV_ITEMA
    mask As Long
    iItem As Long
    iSubItem As Long
    state As Long
    stateMask As Long
    pszText As Long
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
    End Type
    Private Declare Function OpenProcess Lib “kernel32” (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
    Private Declare Function VirtualAllocEx Lib “kernel32” (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
    Private Declare Function VirtualFreeEx Lib “kernel32” (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
    Private Declare Function WriteProcessMemory Lib “kernel32” (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    Private Declare Function ReadProcessMemory Lib “kernel32” (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    Private Declare Function GetWindowThreadProcessId Lib “user32” (ByVal hwnd As Long, lpdwProcessId As Long) As Long
    Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
    Private Declare Function CloseHandle Lib “kernel32” (ByVal hObject As Long) As Long
    Private Declare Function FindWindow Lib “user32” Alias “FindWindowA” (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function FindWindowEx Lib “user32” Alias “FindWindowExA” (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Dim mywindowclass As Long, wtlsplitterwindow As Long, atldd As Long
    Dim syslistview As Long
    Public Function GetListviewItem(ByVal lstviewhwnd As Long) As String
    Dim result As Long
    Dim myItem As LV_ITEMA
    Dim pHandle As Long
    Dim pStrBufferMemory As Long
    Dim pMyItemMemory As Long
    Dim strBuffer() As Byte
    Dim index As Long
    Dim tmpString, tmp2 As String
    Dim strLength As Long
    Dim ProcessID As Long
    Dim ItemCount, i As Long

    ‘**********************
    ‘init the string buffer
    ‘**********************
    ReDim strBuffer(MAX_LVMSTRING)

    ‘***********************************************************
    ‘open a handle to the process and allocate the string buffer
    ‘***********************************************************
    Call GetWindowThreadProcessId(lstviewhwnd, ProcessID)
    pHandle = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ Or PROCESS_VM_WRITE, False, ProcessID)
    pStrBufferMemory = VirtualAllocEx(pHandle, 0, MAX_LVMSTRING, MEM_COMMIT, PAGE_READWRITE)

    ‘************************************************************************************
    ‘initialize the local LV_ITEM structure
    ‘The myItem.iSubItem member is set to the index of the column that is being retrieved
    ‘************************************************************************************
    myItem.mask = LVIF_TEXT
    myItem.iSubItem = 2 ‘for paltalk only if other else change to 0 because 0 and 1 (hand,mic icon) 2 for nick list
    myItem.pszText = pStrBufferMemory
    myItem.cchTextMax = MAX_LVMSTRING

    ‘**********************************************************
    ‘write the structure into the remote process’s memory space
    ‘**********************************************************
    pMyItemMemory = VirtualAllocEx(pHandle, 0, Len(myItem), MEM_COMMIT, PAGE_READWRITE)
    ItemCount = SendMessage(lstviewhwnd, LVM_GETITEMCOUNT, 0&, 0&)

    For i = 0 To ItemCount – 1
    result = WriteProcessMemory(pHandle, pMyItemMemory, myItem, Len(myItem), 0)

    ‘*************************************************************
    ‘send the get the item message and write back the memory space
    ‘*************************************************************
    result = SendMessage(lstviewhwnd, LVM_GETITEMTEXT, i, ByVal pMyItemMemory)
    result = ReadProcessMemory(pHandle, pStrBufferMemory, strBuffer(0), MAX_LVMSTRING, 0)
    result = ReadProcessMemory(pHandle, pMyItemMemory, myItem, Len(myItem), 0)

    ‘**************************************************
    ‘turn the byte array into a string and send it back
    ‘**************************************************
    For index = LBound(strBuffer) To UBound(strBuffer)
    If Chr(strBuffer(index)) = vbNullChar Then Exit For
    tmpString = tmpString & Chr(strBuffer(index))
    tmp2 = tmp2 & Chr(strBuffer(index))
    Next index

    MsgBox tmp2
    tmp2 = “”
    tmpString = Trim(tmpString) & vbCr
    ‘ MsgBox (tmpString)
    Next

    ‘**************************************************
    ‘deallocate the memory and close the process handle
    ‘**************************************************
    result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    result = VirtualFreeEx(pHandle, pMyItemMemory, 0, MEM_RELEASE)

    result = CloseHandle(pHandle)

    If Len(tmpString) > 0 Then GetListviewItem = tmpString
    End Function

    Private Sub Command1_Click()
    mywindowclass = FindWindow(“my window class”, vbNullString)
    wtlsplitterwindow = FindWindowEx(mywindowclass, 0&, “wtl_splitterwindow”, vbNullString)
    wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, “wtl_splitterwindow”, vbNullString)
    wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, “wtl_splitterwindow”, vbNullString)
    atldd = FindWindowEx(wtlsplitterwindow, 0&, “atl:0053d8d0”, vbNullString)
    syslistview = FindWindowEx(atldd, 0&, “syslistview32”, vbNullString)

    Call GetListviewItem(syslistview)
    End Sub

    #188853
    Newbie
    Member

    😀 I already do that. I know what you’re talking about. Yup!! Color items in the listview so black color nicknames become the color you choose. But change the color of 1 nick, i didn’t figure how to do it yet.
    Hope that you will findout how 1 day. And Oh yeah!! Hope that you’re a patient person. Cuz i am. but i give up that project already, afterall only you can see the color change in your pc.

    #188852
    LoCNiNjA
    Member

    @Newbie wrote:

    😀 I already do that. I know what you’re talking about. Yup!! Color items in the listview so black color nicknames become the color you choose. But change the color of 1 nick, i didn’t figure how to do it yet.
    Hope that you will findout how 1 day. And Oh yeah!! Hope that you’re a patient person. Cuz i am. but i give up that project already, afterall only you can see the color change in your pc.

    yeah lol i think i am going to give up on that one cos your right it is only us that can see the color but i just thought it would be fun never mind me thinks that whole project can be scrapped i have started work on my old one i have added a few more things and will try to continue doing so to make it the best prog about or so ithink lol 😳 any how go and have a look it’s more than just an banner killer 8)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.