$I Link.inc
CLS

DrawText 10,10,"Link.inc Copyright by"
var Link1&=CreateSysLink(%hwnd,"Julian Schmidt","http://julian-schmidt.xprofan.com/",150,11,Len("Julian Schmidt")*6.9,18)
SubClass Link1&, 1
DrawText 10,40,"Homepage:"
var Link2&=CreateSysLink(%hwnd,"julian-schmidt.xprofan.com","http://julian-schmidt.xprofan.com/",90,40,Len("julian-schmidt.xprofan.com")*6.9,18)
SubClass Link2&, 1
DrawText 10,65,"E-Mail:"
var Link3&=CreateSysLink(%hwnd,"info@julian-schmidt.xprofan.com","info@julian-schmidt.xprofan.com",90,65,Len("info@julian-schmidt.xprofan.com")*6.9,18)
SubClass Link3&, 1

while 1
    waitinput 30
    if getfocus(Link1&) or getfocus(Link2&) or getfocus(Link3&)
        locate 2,43
        print GetTextSysLink(Link1&)
        locate 4,43
        print GetURLSysLink(Link2&)
        locate 6,43
        print GetURLSysLink(Link3&)
    Endif
endwhile

SubClassProc
If Getfocus(&sWnd)
    case SearchString(GetURLSysLink(&sWnd),"@")=0 : OpenLink(&sWnd)
    case SearchString(GetURLSysLink(&sWnd),"@")>0 : SendMail(&sWnd)
    Setfocus(%hwnd)
    waitinput
Endif
EndProc

Proc SearchString
    declare pos%
    Parameters ZuDurchsuchenderText$,Suchtext$
    whileloop Len(ZuDurchsuchenderText$)
        If Mid$(ZuDurchsuchenderText$,&loop,Len(Suchtext$))=Suchtext$
            pos%=&loop
            break
        Endif
    Endwhile
    Return pos%
EndProc
