The MASM Forum

Microsoft 64 bit MASM => MASM64 SDK => Topic started by: hutch-- on October 31, 2016, 08:12:02 AM

Title: Syslink control example.
Post by: hutch-- on October 31, 2016, 08:12:02 AM
I have done similar in the past with custom button controls but this is a standard Windows common control that you can get to work with a little massaging. It uses that awful WM_NOTIFY interface and NMHDR structure but it will end up where you can respond to it. ShellExecute() will open a browser window and its reasonably straight forward to make a link on a page or dialog that will open whatever URL you want.
Title: Re: Syslink control example.
Post by: Siekmanski on October 31, 2016, 09:28:11 AM
Nice.  :t
Title: Re: Syslink control example.
Post by: jj2007 on October 31, 2016, 05:38:50 PM
invoke ShellExecute,hWin,"open","www.masm32.com",0,0,SW_SHOW

There should be also an option to get the URL directly, but so far I've not been able to spot it in the debugger :(

LITEM structure (https://msdn.microsoft.com/en-us/library/windows/desktop/bb760710(v=vs.85).aspx)
QuoteszUrl

    Type: WCHAR[L_MAX_URL_LENGTH]

    WCHAR string that contains the URL represented by the link. The maximum number of characters in the array is L_MAX_URL_LENGTH.
Title: Re: Syslink control example.
Post by: TWell on October 31, 2016, 08:23:12 PM
if SysLink control is defined with HREF like this "<a href=\"http://www.masm32.com\">www.masm32.com</a>"
that link url is filled in message.

EDIT:
https://msdn.microsoft.com/en-us/library/windows/desktop/hh298379(v=vs.85).aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/hh298379(v=vs.85).aspx)
https://msdn.microsoft.com/en-us/library/windows/desktop/hh270406(v=vs.85).aspx (https://msdn.microsoft.com/en-us/library/windows/desktop/hh270406(v=vs.85).aspx)
Title: Re: Syslink control example.
Post by: hutch-- on October 31, 2016, 09:50:45 PM
I just used a Microsoft example. Seems to work OK, any text you like in the control, a valid URL in the ShellExecute() function. Control dumps the mouse click in the NMHDR structure into the WM_NOTIFY message and the ShellExecute() function succeeds with a valid URL.