question

Gerailly avatar image
0 Votes"
Gerailly asked Castorix31 commented

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

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

  • 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

windows-apidotnet-visual-basicazure-bing-visual
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
1 Vote"
Castorix31 answered Castorix31 commented

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




syslink-focus.jpg (22.9 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

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 Votes 0 ·

I did other tests and WS_TABSTOP works with a classic Win32 window instead of a normal Form, created by the usual way RegisterClassEx + CreateWindowEx :

176145-win32form-tabstop.gif


0 Votes 0 ·
Gerailly avatar image
0 Votes"
Gerailly answered Castorix31 commented

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.