3

I'm using the following code:

#include <WinAPI.au3>
#include <WindowsConstants.au3>

Global Const $WC_LINK = "SysLink"
Global Const $WC_LINKA = $WC_LINK
Global Const $WC_LINKW = $WC_LINK

$g_hLink = _WinAPI_CreateWindowEx(0, $WC_LINK, _
        'Test, [url="http://www.microsoft.com"]click here[/url], [url="http://www.microsoft.com"]here[/url] or [url=""]here[/url]', _
        BitOR($WS_VISIBLE, $WS_CHILD, $WS_TABSTOP), _
        10, 10, 300, 60, $Form2 _
)
GUIRegisterMsg($WM_NOTIFY, "MY_LINK_NOTIFY")

Func MY_LINK_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    Local Const $tagNMLINK = $tagNMHDR & ";" & "UINT mask; int iLink; UINT state; UINT stateMask; WCHAR szID[48]; WCHAR szUrl[2083];"
    Local $NMHDR = DllStructCreate($tagNMHDR, $lParam)
    Local $hwndFrom = DllStructGetData($NMHDR, "hwndFrom");
    Switch $hwndFrom
        Case $g_hLink
            Switch DllStructGetData($NMHDR, "code")
                Case $NM_CLICK
                    ContinueCase
                Case $NM_RETURN
                    $NMHDR = DllStructCreate($tagNMLINK, $lParam)
                    Local $iLink = DllStructGetData($NMHDR, "iLink")
                    Local $szURL = DllStructGetData($NMHDR, "szURL")
                    Local $szID = DllStructGetData($NMHDR, "szID")

                    If $szURL <> "" Then
                        ShellExecute($szURL, "", "", "open", @SW_SHOW);
                    EndIf
            EndSwitch
    EndSwitch
EndFunc

To make my syslinks clickable:

enter image description here

The problem is that I want it to display only the text... and set this white/gray background to transparent.

How can I do this?

user4157124
  • 2,809
  • 13
  • 27
  • 42
Scott
  • 5,991
  • 15
  • 35
  • 42

1 Answers1

0

It seems that it's impossible.

There is the LWS_TRANSPARENT style, but it doesn't make SysLink transparent, it just set its background color to the window background color.

Also, SysLink supports the WM_CTLCOLORSTATIC message, but you can't make background color transparent with it.

Abyx
  • 12,345
  • 5
  • 44
  • 76