Le cas classique est d'utiliser le Static Control pour en faire un HyperlinkGadget, en cherchant tu peux peut être trouver des exemples aux adresses connues.
Tiens justement un exemple:
Code : Tout sélectionner
; German forum: http://robsite.de/php/pureboard/viewtopic.php?t=2955&highlight=
; Author: Andreas (updated for PB3.92+ by Andre)
; Date: 29. November 2003
Global Static2.l
Global ReUsableBrush,a.l
Procedure IsMouseOver(wnd)
GetWindowRect_(wnd,re.RECT)
GetCursorPos_(pt.POINT)
Result = PtInRect_(re,pt\x,pt\y)
ProcedureReturn Result
EndProcedure
Procedure SetColor(TxtColor,BkColor,wParam ,lParam )
Shared ReUsableBrush
DeleteObject_(ReUsableBrush)
ReUsableBrush = GetStockObject_(#HOLLOW_BRUSH)
SetBkColor_(wParam,BkColor)
SetTextColor_(wParam,TxtColor)
SetBkMode_(wParam,#TRANSPARENT)
Result = ReUsableBrush
ProcedureReturn Result
EndProcedure
Procedure WindowCallback(WindowID, message, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
Select message
Case #WM_LBUTTONUP
If IsMouseOver(Static2)
ShellExecute_(0,"open","http:\\www.ampsoft.org",0,0,#SW_SHOWNORMAL)
EndIf
Case #WM_MOUSEMOVE
GetCursorPos_(pt.POINT)
GetWindowRect_(Static2,re.RECT)
If PtInRect_(re,pt\x,pt\y)
a = 1
SetWindowText_(Static2,"www.ampsoft.org")
SetCursor_(LoadCursor_(0,32649))
Else
a = 0
SetWindowText_(Static2,"www.ampsoft.org")
SetCursor_(LoadCursor_(0,#IDC_ARROW))
EndIf
InvalidateRect_(WindowID(),0,0)
Case #WM_CTLCOLORSTATIC
If lParam = Static2
If a
Result = SetColor(RGB(255,0,0),RGB(255,255,255),wParam,lParam)
Else
Result = SetColor(RGB(0,0,255),RGB(255,255,255),wParam,lParam)
EndIf
EndIf
EndSelect
ProcedureReturn Result
EndProcedure
If OpenWindow(0, 10, 150, 640,180, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "MouseOver")
If CreateGadgetList(WindowID())
Static2 = TextGadget(0, 10,10,220,24,"")
EndIf
SetWindowCallback(@WindowCallback())
SendMessage_(WindowID(),#WM_MOUSEMOVE,0,0)
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit = 1
EndIf
End