Has anybody found a method to get the index of an item in a syslink control with more than one embedded URL without clicking on it? I want to set a tooltip.
I've wasted a lot of time with LM_HITTEST, LHITTESTINFO, LITEM, EM_CHARFROMPOS, LIS_HOTTRACK and the like, but it seems impossible. The control itself produces hardly any messages when subclassed. Inter alia, I can see a NM_KEYDOWN notification when no key is being pressed... it's a mess :cool:
José has a page on SysLink_HitTest (http://www.jose.it-berater.org/comctrl/syslink/syslink_hittest.htm) but it covers the clicked, not the hover case.
Hi
I haven't tried it myself, but I think the way to go is by sending LM_GETITEM messages in which the LITEM.iLink value is incremented one by one.
https://docs.microsoft.com/en-us/windows/win32/controls/lm-getitem (https://docs.microsoft.com/en-us/windows/win32/controls/lm-getitem)
Then check the returned LITEM structure until you get the link you are looking for.
If you have a match, you have the index.
Biterider
Thanks, biterider, but that would require to know the link I am looking for. This is not the case... I may know where my cursor is when receiving the TTN_SHOW notification, but the syslink control doesn't work with EM_CHARFROMPOS, unfortunately.
Clicking on the link is not the problem, the URL is easy to find:
mov rax, lParam
lea rax, [rax.NMLINK.item.szUrl]
But you don't want to click to set the tooltip :sad:
The attachment show a modeless with syslink to ..... the windows common controls ,control spy version 2.
This one show all the mesages and the event,answer is here.
Did you read and understand the question, Yves?
In the meantime, I found a working solution:
.if NotifyCode==TTN_SHOW
invoke GetCursorPos, addr pointL
invoke ScreenToClient, hSyslink, addr pointL
mov eax, pointL.x
mov edx, pointL.y
shl edx, 16
or eax, edx
push eax
or hoverFlag, -1
invoke SendMessage, hSyslink, WM_LBUTTONDOWN, MK_LBUTTON, eax
pop eax
invoke SendMessage, hSyslink, WM_LBUTTONUP, MK_LBUTTON, eax
Did you see what is it ?
It's for everyone and it's a prime source of informations.
Quote from: TouEnMasm on March 08, 2021, 04:09:56 AM
Did you see what is it ?
It's for everyone and it's a prime source of informations.
Yves, a simple deb shows me all Windows messages - much more convenient than an extra window:
WndProc proc uses esi edi ebx hWnd, uMsg, wParam:WPARAM, lParam:LPARAM
inc msgCount
deb 4, "msg", chg:msgCount
In any case, your contribution has nothing to do with the question asked here. You are spamming my threads, mon cher ami :badgrin:
I see,the one who have wrote:
Quote
I've wasted a lot of time with LM_HITTEST, LHITTESTINFO, LITEM, EM_CHARFROMPOS, LIS_HOTTRACK and the like, but it seems impossible. The control itself produces hardly any messages when subclassed. Inter alia, I can see a NM_KEYDOWN notification when no key is being pressed... it's a mess :cool:
is to smart to use the windows tools who give it the answer and all is needed to solve the problem without a line of code.
continue to make me laugh :thumbsup:
Quote from: TouEnMasm on March 08, 2021, 05:49:18 PM
I see,the one who have wrote:
Quote
I've wasted a lot of time with LM_HITTEST, LHITTESTINFO, LITEM, EM_CHARFROMPOS, LIS_HOTTRACK and the like, but it seems impossible. The control itself produces hardly any messages when subclassed. Inter alia, I can see a NM_KEYDOWN notification when no key is being pressed... it's a mess :cool:
is to smart to use the windows tools who give it the answer and all is needed to solve the problem without a line of code.
continue to make me laugh :thumbsup:
Nonsense, Yves. The spy tool is very old and very limited. Spy does not "give it the answer". You don't understand the question, but you keep trolling. Are you French, by accident?
My deb macro (http://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1019) is much more powerful. It shows me that the SysLink control receives a few messages: WM_NCHITTEST, WM_SETCURSOR, WM_ERASEBKGND, WM_PAINT, WM_NCPAINT, WM_GETTEXT and WM_MOUSEMOVE. None of them reveals the index of the URL inside the control. The main window receives WM_NOTIFY: NM_KEYDOWN, without pressing any key. That is, ehm, undocumented :cool:
notify 5 WM_NOTIFY: NM_KEYDOWN
SysLink 104 WM_PAINT
SysLink 105 WM_GETTEXTLENGTH
SysLink 106 WM_GETTEXT
notify 108 WM_NOTIFY: TTN_NEEDTEXTW
notify 109 WM_NOTIFY: NM_KEYDOWN
notify 110 WM_NOTIFY: TTN_SHOW
SysLink 111 WM_GETTEXT
SysLink 112 WM_NCPAINT
notify 113 WM_NOTIFY: NM_KEYDOWN
SysLink 117 WM_ERASEBKGND
notify 118 WM_NOTIFY: NM_KEYDOWN
notify 121 WM_NOTIFY: TTN_POP
SysLink 125 WM_PAINT
SysLink 126 WM_NCPAINT
SysLink 130 WM_ERASEBKGND
notify 131 WM_NOTIFY: NM_KEYDOWN
notify 522 WM_NOTIFY: NM_KEYDOWN
notify 523 WM_NOTIFY: TTN_SHOW
SysLink 524 WM_PAINT
SysLink 525 WM_NCPAINT
notify 526 WM_NOTIFY: NM_KEYDOWN
SysLink 530 WM_ERASEBKGND
notify 531 WM_NOTIFY: NM_KEYDOWN
notify 580 WM_NOTIFY: TTN_POP
SysLink 639 WM_PAINT
SysLink 640 WM_NCPAINT
SysLink 644 WM_ERASEBKGND
notify 645 WM_NOTIFY: NM_KEYDOWN
Guys, can you keep the bickering down, I don't want to have to keep track of this stuff or edit it. To put it in terms of archaic Australian folklore, it sounds like a pair of old molls at a christening. :tongue: