News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Syslink control example.

Started by hutch--, October 31, 2016, 08:12:02 AM

Previous topic - Next topic

hutch--

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.

Siekmanski

Creative coders use backward thinking techniques as a strategy.

jj2007

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
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.

TWell

#3
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/hh270406(v=vs.85).aspx

hutch--

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.