how to update trialbot from 9.1 to 9.2

In this forums, you can get help for any programming language.

how to update trialbot from 9.1 to 9.2

Postby wazzzup » Sun Nov 25, 2007 2:29 pm


i need help update trivia bot from 9.1 to 9.2 thanks :D
User avatar
wazzzup
imFiles Senior
imFiles Senior
 
Posts: 119
Joined: Fri Feb 02, 2007 8:17 pm
Location: none

Re: how to update trialbot from 9.1 to 9.2

Postby Departure » Sun Nov 25, 2007 11:10 pm

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:
Code: Select all

      Private Sub Form_Load()
   
      Dim hWndForm As Long
   
          'get the form handle
 
          hWndForm = FindWindow(vbNullString, "<PaltalkWindowCaption>")
   
          '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)
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Re: how to update trialbot from 9.1 to 9.2

Postby Ghost » Mon Nov 26, 2007 12:51 am

Wrong section, moved to Programming Help.
(10:37 AM) NME: the color of shit is awsome

"Return the sword to its scabbard.
In the place where you were created,
in the land of your ancestry,
I will judge you."

Ezekiel 21:30
User avatar
Ghost
imFiles God
imFiles God
 
Posts: 2130
Joined: Tue Aug 01, 2006 1:52 am

Re: how to update trialbot from 9.1 to 9.2

Postby wazzzup » Fri Nov 30, 2007 1:04 pm

Thanks Departure
User avatar
wazzzup
imFiles Senior
imFiles Senior
 
Posts: 119
Joined: Fri Feb 02, 2007 8:17 pm
Location: none


Return to Programming Help

Who is online

Users browsing this forum: No registered users and 0 guests