Skip to content

how to update trialbot from 9.1 to 9.2

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #190809
    wazzzup
    Member

    i need help update trivia bot from 9.1 to 9.2 thanks 😀

    #190812
    Departure
    Member

    put the source snippet for 9.1 and ill modify it for you to work with 9.2 and future version + older versions. I have found a new way to do this using EnumChildWindows instead of the standard findwindowex, this method should have been used first from what read, because GETCHILD , HWNDNEXT is unstable used in a loop.

    here is an example:



    Private Sub Form_Load()

    Dim hWndForm As Long

    'get the form handle

    hWndForm = FindWindow(vbNullString, "")

    'enumerate child windows of the window

    If hWndForm 0 Then EnumChildWindows hWndForm, AddressOf EnumChildProc, ByVal 0&

    End Sub



    '=================

    'In a standard module

    Option Explicit



    Public Declare Function EnumChildWindows Lib "user32" _

    (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long



    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _

    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long



    Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _

    (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long



    'call back function

    Public Function EnumChildProc(ByVal hwnd As Long, ByVal lParam As Long) As Long

    'assuming it is a Richedit box, other wise change the class name

    If GetClsName(hwnd) = "RichEdit20A" Then

    GlobalRichEditString = hwnd

    End If

    'continue enumeration

    EnumChildProc = 1

    End Function



    'gets the class name

    Public Function GetClsName(ByVal hwnd As Long) As String

    Dim lpClassName As String

    Dim RetVal As Long

    lpClassName = Space(256)

    'retrieve the class name

    RetVal = GetClassName(hwnd, lpClassName, 256)

    'Show the classname

    GetClsName = Left$(lpClassName, RetVal)


    End Function

    Only thing I did’nt do was add a global string but just add that as “GlobalRichEditString” then when sending text ect… just use that for the handel of richedit box. And also this executes on form load so you could add this to a button or something instead of when the form loads, I just put loads for when I embed the form into paltalk (which is not here)

    #190811
    Ghost
    Member

    Wrong section, moved to Programming Help.

    #190810
    wazzzup
    Member

    Thanks Departure

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