Note that there are some explanatory texts on larger screens.

plurals
  1. POSending Message to AutoIt for a VB6 Listbox and Finding String?
    primarykey
    data
    text
    <p>2 I went through the forums and other related question, but did not get much help. My question is related to sending Message to controls using AutoIt. In the following code I am trying to find the index of Text that I intended to search("L20"). The application is written in VB and the same SendMessage through VB works. I believe the below SendMessage has some issue. Please help me finding the issue.</p> <pre><code>$WindowName = "Form1" $WindowText = "" WinWait("[CLASS:ThunderRT6FormDC]") Local $hListBox1 = ControlGetHandle("[CLASS:ThunderRT6FormDC]", "", "ThunderRT6ListBox1") Local $hListBox2 = ControlGetHandle("[CLASS:ThunderRT6FormDC]", "", "ThunderRT6ListBox2") WinActivate( $WindowName, $WindowText ) ControlClick("[CLASS:ThunderRT6FormDC]", "", "ThunderRT6ListBox2") MsgBox(0, "ControlGetHandle Example", $hListBox1 &amp; " - " &amp; $LB_FINDSTRING &amp; " - " &amp; -1 &amp; " - " &amp; "L20") MsgBox(0, "ControlGetHandle Example", $hListBox2 &amp; " - " &amp; $LB_FINDSTRING &amp; " - " &amp; -1 &amp; " - " &amp; "L20") Local $sText = "L20" Local $obj1 = DllCall("user32.dll", "int", "SendMessageA", "hwnd", $hListBox1, "UINT", $LB_FINDSTRING, "WPARAM", -1, "wstr", $sText) Local $obj2 = DllCall("user32.dll", "int", "SendMessageA", "hwnd", $hListBox2, "UINT", $LB_FINDSTRING, "WPARAM", -1, "wstr", $sText) ;Local $obj1 = _SendMessageA($hListBox1, $LB_FINDSTRING, -1, "L20") ;Local $obj2 = _SendMessageA($hListBox2, $LB_FINDSTRING, -1, "L20") MsgBox(0, "ControlGetHandle Example", "The control handle of ThunderRT6ListBox1 is: " &amp; $obj1 &amp; $obj2) </code></pre> <p>The following vb6 version works in VB6 application</p> <pre><code>If FindExactMatch Then GetListBoxIndex = SendMessage(hWnd, LB_FINDSTRINGEXACT, StartIndex, SearchKey) Else GetListBoxIndex = SendMessage(hWnd, LB_FINDSTRING, StartIndex, SearchKey) End If </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload