Author Topic: Syslink control example.  (Read 1657 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5659
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Syslink control example.
« 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

Siekmanski

  • Member
  • *****
  • Posts: 1611
Re: Syslink control example.
« Reply #1 on: October 31, 2016, 09:28:11 AM »
Nice.  :t
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Member
  • *****
  • Posts: 8619
  • Assembler is fun ;-)
    • MasmBasic
Re: Syslink control example.
« Reply #2 on: October 31, 2016, 05:38:50 PM »
Code: [Select]
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
Quote
szUrl

    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

  • Member
  • ****
  • Posts: 748
Re: Syslink control example.
« Reply #3 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/hh270406(v=vs.85).aspx
« Last Edit: October 31, 2016, 11:13:11 PM by TWell »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5659
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Syslink control example.
« Reply #4 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: