Autoit - Problem obtaining text drop-down menu on x64

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Andrey_A
Junior Member
Junior Member
Posts: 12
Joined: 2010-06-02, 21:44 UTC
Contact:

Autoit - Problem obtaining text drop-down menu on x64

Post by *Andrey_A »

Help solve the problem. It is necessary to get the text of the drop-down menu item (bar).
On the version TC x32 text can be obtained.
On the version TC x64, the text is not returned.
The problem with _GUICtrlMenu_GetItemText () for x64
Is there a solution? Perhaps there is another way to get the text of the drop-down menu item ...

Code: Select all

#include <WinAPI.au3>
#include <Constants.au3>
#include <GuiMenu.au3>
$Struct=DllStructCreate($tagPOINT)
Do
  Dim $aPos=MouseGetPos(),$0=DllStructSetData($Struct,'x',$aPos[0])+DllStructSetData($Struct,'y',$aPos[1]),$hWnd=_WinAPI_WindowFromPoint($Struct)
  If  '#32768'=_WinAPI_GetClassName($hWnd)Then
    Sleep(9)
    Dim $hMenu=_SendMessage($hWnd,481,0,0),$iIndex=_GUICtrlMenu_MenuItemFromPoint(0,$hMenu)
    If $iIndex>-1 Then
      $sText=_GUICtrlMenu_GetItemText($hMenu,$iIndex)
      ToolTip('Number: '&$iIndex&@CRLF&'Text :'&$sText,0,0,'Info')
    EndIf
  EndIf
Until Sleep(99)-1
Image: http://tc-image.3dn.ru/Image/tc/0/tc_pr_32.png
Image: http://tc-image.3dn.ru/Image/tc/0/tc_pr_64.png
Autor TCIMG
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

You should use AutoIt Window Info (Au3Info*.exe) to see if AutoIt is actually able to see the text you want to have. If not, you'd need to use a different approach to achieve your goal.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Andrey_A
Junior Member
Junior Member
Posts: 12
Joined: 2010-06-02, 21:44 UTC
Contact:

Post by *Andrey_A »

Au3Info * .exe does not show any information.
Therefore, I asked at the forum, maybe someone knows the solution.
Autor TCIMG
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Well, one way I can think of: Read the linked .bar file and use WinMenuSelectItem function to directly call the menu item you want with the text retrieved from the .bar file. The question is: What do you intend to do in the end? Maybe there's another way.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Andrey_A
Junior Member
Junior Member
Posts: 12
Joined: 2010-06-02, 21:44 UTC
Contact:

Post by *Andrey_A »

Reading a bar file is not a solution. Bar files are several hundred.
The goal is to get the text of the item under the cursor on TC x64
Autor TCIMG
Post Reply