Skip to content

invite all budlist in c++

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #191257

     

    HWND hParent =::FindWindow("#32770","Invite to Room");
    HWND hList = ::FindWindowEx(hParent, 0, "SysListView32", NULL);
    bool bCheck=true;
    int count=(int)::SendMessage(hList, LVM_GETITEMCOUNT, 0, 0);
    LV_ITEM lvi;
    lvi.state=UINT((int(bCheck) + 1) << 12);
    lvi.stateMask=LVIS_STATEIMAGEMASK;
    
    for(int i=0; i<count; i++)
    {
    WPARAM ItemIndex=(WPARAM)i;
    
    ::SendMessage(hList,LVM_SETITEMSTATE,ItemIndex,(LPARAM)&lvi);
    
    }
    HWND button = ::FindWindowEx(hParent, 0, "button", "Invite");
    ::SendMessage((HWND)button,WM_LBUTTONDOWN,1,1);
    ::SendMessage((HWND)button,WM_LBUTTONUP,1,1);

     

    why I posted the code in c++ and not in vb6 becuz I dont want to make life easy to vb6 newbie 😆

    #191268

    🙂 😀 Good job 🙂 😀 BattleStar-Galactica 8)

    #191267
    AhFox
    Member

    VB6 or VB.NET version do as follow:

    Set up our local LV_ITEM to change the selected item = LVIF_STATE

    LVITEM.state = LVIS_CHECKED
    LVITEM.stateMask = LVIS_STATEIMAGEMASK

    The rest you know what to do

    where i is totalPals
    for i as integer = 0 to totalPals - 1
    SendMessage(hwnd, LVM_SETITEMSTATE, i, LVI)
    next i

    hope this helps.

    #191266
    method
    Member

    nvye can you tell me how to declare these variables ?

    LVITEM.mask = LVIF_STATE
    LVITEM.state = LVIS_CHECKED
    LVITEM.stateMask = LVIS_STATEIMAGEMASK
    #191265
    Chike
    Member

    @method wrote:

    nvye can you tell me how to declare these variables ?

    LVITEM.mask = LVIF_STATE
    LVITEM.state = LVIS_CHECKED
    LVITEM.stateMask = LVIS_STATEIMAGEMASK

    You can find everything here:
    As for LVIS_CHECKED, there is no such thing. Image state is one-based image-index that is application dependent value that is represented by bits 12-15. That is (index shift left 12)
    As you can see in BattleStar-Galactica’s code it’s 2 << 12 = 8192 decimal or 2000 hex.

    #191264
    method
    Member

    chike thanks for reply. But i was asking about vb6 way to declare them ! could you show me how they should be declared in vb6?

    #191263
    Chike
    Member

    Good heavens method, it’s all there. Those are hexdecimal integer constants, just replace 0x with &H

    #191262
    Departure
    Member

    @Chike wrote:

    Good heavens method

    Lol

    Anyway good find Chike very useful…

    Oh and for method please read this to help you understand

    #191261
    method
    Member

    Thanks guys i tried the following code but paltalk keep closing when i click the button. Could you you guys tell what i am doing wrong and how to fix it ?

     

    Option Explicit
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    'Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
    ' ByVal hwnd As Long, _
    ' ByVal wMsg As Long, _
    ' ByVal wParam As Long, _
    ' ByVal lParam As Long) As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    
    Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam 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
    Const WM_COMMAND = &H111
    Private Const WM_CLOSE As Long = &H10
    Private Const WM_KEYDOWN = &H100
    Private Const WM_KEYUP = &H101
    Private Const VK_SPACE = &H20
    '
    Private Const LVIS_STATEIMAGEMASK As Long = &HF000
    Private Const LVIS_UNCHECKED = &H1000
    Private Const LVIS_CHECKED = &H2000
    Private Const LVIF_STATE = &H8
    Private Const LVM_FIRST = &H1000
    Private Const LVM_SETITEMSTATE = (LVM_FIRST + 43)
    
    Private Type LV_ITEM
    Mask As Long
    iItem As Long
    iSubItem As Long
    state As Long
    stateMask As Long
    pszText As String
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
    End Type
    
    Private Sub Command1_Click()
    Dim x As Long, editx As Long
    Dim button As Long
    
    Dim LV As LV_ITEM
    Dim Sel As Boolean
    'Set up our local LV_ITEM to change the selected item
    With LV
    .Mask = LVIF_STATE
    '.state = LVIS_SELECTED
    .state = IIf(Sel, LVIS_CHECKED, LVIS_UNCHECKED)
    .stateMask = LVIS_STATEIMAGEMASK
    End With
    
    x = FindWindow("#32770", "Invite to room")
    If x Then
    'MsgBox "found"
    
    'button = FindWindowEx(x, 0&, "button", vbNullString)
    'button = FindWindowEx(x, button, "button", vbNullString)
    'button = FindWindowEx(x, button, "button", vbNullString)
    
    button = FindWindowEx(x, 0&, "SysListView32", vbNullString)
    SendMessage button, LVM_SETITEMSTATE, 1, LV
    
    End If
    End Sub

     

    #191260
    Chike
    Member

    LV must be copied to paltalk process address space (VirtualAllocEx).

    #191259
    method
    Member

    @Chike wrote:

    LV must be copied to paltalk process address space (VirtualAllocEx).

    Can yo show me how ? i don’t know exactly what you mean!

    #191258
    Chike
    Member

    There are many examples in the forums using this.
    First find pal process id:

    GetWindowThreadProcessId(palWnd, palProcId)

    The open a handle for pal process:

    hPalProc = OpenProcess(PROCESS_VM_OPERATION or PROCESS_VM_READ  or PROCESS_VM_WRITE, 0, palProcId)

    Allocate memory in pal process adress space:

    palMem = VirtualAllocEx(hPalProc, 0, Len(LV), MEM_COMMIT or MEM_RESERVE, PAGE_READWRITE)

    Copy LV structure to pal memory:

    WriteProcessMemory(hPalProc , palMem, LV, Len(LV), 0)

    Make your call with palMem instead of LV.

    Release pal memory:

    VirtualFreeEx(hPalProc , palMem , 0, MEM_RELEASE)

    Close pal process handle

    CloseHandle(hPalProc)

    I am not going to declare the functions for you you gotta know how to do this yourself by now, nor the values or type for each varuable/constant.
    Use MSDN Library for reference, and the link departure posted, anything else google or search the forums.
    If you are going to program you must learn to find things by yourself or you’re just waisting time.

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