how to create syslink class in parentWindow and move focus on it first , also tooltip to be activate when focus moved on any item in sys tray

Grailly 1 Reputation point
2022-02-19T14:47:18.043+00:00

Hi , Experts

how can i di this ......
Focus move to the syslink with variable hsyslink instead Edit Control then ok and cancel button when use setwindowpos hwndnew,old,0,0,0,0,SWP_NOMOVE+SWP_NOSIZE the window disappeared

in general i destroyed static control in dialogbox #32770 and then created Syslink with createWolindowEx with style WS_TABSTOP the problem is when window created focus go first edit then ok and then cancel button and never move focus to syslink with setwindowpos also cannot change the z-order and maybe cannot do because i tested this function if parameter x,y changed to zero the window disappeared ... also want to display tooltip when cursor move on any item in this syslink class ( is zero based and give me NM_CLICK And NM_RETURN )

i have read the document for syslink creation but i cannot find anywhere for changing the z-order when create syslink in the window

-i also created Tooltips_class32 but not activate with TTM_ACTIVATE and didn't show when mouse move to syslink area itemstated always return zero

%vb or vba%

help plz

Bing Visual Search
Bing Visual Search
A Bing service that gives you rich insights to help build compelling image applications on the device of your choice.
22 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,424 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,574 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,726 Reputation points
    2022-02-19T18:26:35.967+00:00

    I did some tests (VB .NET) and SetFocus works (WS_TABSTOP does not seem to work...)
    Test creation of SysLink as child of a myForm2 window :

            Dim hWndSysLink As IntPtr = CreateWindowEx(0, "SysLink", "<A HREF=""www.google.com"">Click here</A>", WS_VISIBLE Or WS_CHILD Or WS_TABSTOP Or LWS_USEVISUALSTYLE, 120, 40, 120, 40, myForm2.Handle, New IntPtr(10), IntPtr.Zero, IntPtr.Zero)  
            SetFocus(hWndSysLink)  
    

    with

        <DllImport("User32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>  
        Public Shared Function SetFocus(hWnd As IntPtr) As IntPtr  
        End Function  
    

    The focus is set on the SysLink after I call myForm2.Show() and NM_RETURN is fired if I hit [Enter] :

    176049-syslink-focus.jpg

    1 person found this answer helpful.

  2. Grailly 1 Reputation point
    2022-02-20T11:33:55.323+00:00

    tnx very much ...
    1- in your case change the z-order or not ,means when lost the focus from syslink again it can get focus ?

    2-if you have some Linkindex in the Syslink , when move mouse on each item can raise a messagebox that shows you are in this item index with ilink example 1 or 4

    0 comments No comments