EnableExplicit Procedure WndProc(hWnd, uMsg, wParam, lParam) Protected result Protected *el.ENLINK Protected StringBuffer Protected txt.TEXTRANGE result = #PB_ProcessPureBasicEvents Select uMsg Case #WM_NOTIFY *el.ENLINK = lParam If *el\nmhdr\code=#EN_LINK If *el\msg=#WM_LBUTTONDOWN StringBuffer = AllocateMemory(512) txt.TEXTRANGE txt\chrg\cpMin = *el\chrg\cpMin txt\chrg\cpMax = *el\chrg\cpMax txt\lpstrText = StringBuffer SendMessage_(GadgetID(1), #EM_GETTEXTRANGE, 0, txt) RunProgram(PeekS(StringBuffer)) FreeMemory(StringBuffer) EndIf EndIf EndSelect ProcedureReturn result EndProcedure If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) EditorGadget(1,10,10,480,230,0) SendMessage_(GadgetID(1), #EM_SETEVENTMASK, 0, #ENM_LINK|SendMessage_(GadgetID(1), #EM_GETEVENTMASK, 0, 0)) SendMessage_(GadgetID(1), #EM_AUTOURLDETECT, #True, 0) SetGadgetText(1, "http://www.purebasic.de") SetWindowCallback(@WndProc()) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf