Posts: 1,031
Threads: 246
Joined: Jul 2022
01-04-2023, 03:54 AM
(This post was last modified: 01-04-2023, 11:10 AM by Davider.)
Hi,
I want to get the text of AutoText list item by right-click
The following code sometimes prompts the following error message, Is there a better way?
Error (RT) in <open ":2241: /225">AT_List_Right: invalid window handle.
Thanks in advance for any advice and help
david
Function
AT_List_Right
Trigger
!v"" "QM_PopupList"
out
int hwnd=TriggerWindow
int hlv=child("" "SysListView32" hwnd)
int mc=wait(5 MR); err
if mc
,_i=SendDlgItemMessage(hwnd 8888 LVM_GETNEXTITEM -1 LVNI_SELECTED)
;,_i=SendMessage(hlv LVM_GETNEXTITEM -1 LVNI_SELECTED) ;;Same effect as above
,GetListViewItemText hlv _i-1 _s 0 2; out _s
Posts: 1,031
Threads: 246
Joined: Jul 2022
01-04-2023, 08:58 AM
(This post was last modified: 01-04-2023, 11:08 AM by Davider.)
Something strange
1.Sometimes there is an error message, but the value _s has output and the variable is correct
2.Sometimes there is an error message, but the variable _s has no output
Change to the following, still has no effect
_i=SendMessage(hlv LVM_GETNEXTITEM -1 LVNI_FOCUSED|LVNI_SELECTED)
Using the above method, when the AutoText list is displayed, it will wait to press the right mouse button, which is inefficient
Is there a way, when the mouse moves over the AutoText list, press the right mouse button and output the text of the item below the mouse cursor?