Function FreeCallback(byval flag as integer) As Integer
Функция отключает процедуру, запущенную функцией SetWindowCallback
flag - флаг, может быть 0 или 1. Определяет какую функцию следует отключить. Флаг задается при запуске процедуры функцией SetWindowCallback
Windows
#Include "window9.bi"
Dim Shared text As Hwnd
Function windowproc(hwnd As HWND,msg As UINT,wParam As WPARAM,lParam As LPARAM) As Integer
Static a As Integer
If msg= WM_MOUSEMOVE Then
If IsMouseOver(text) Then
SetCursor(LoadCursor(0,IDC_HAND))
If a=0 then
SetGadgetColor(1,0,255,2)
invalidaterect(text,0,1)
a=1
EndIf
Else
If a=1 Then
SetGadgetColor(1,0,&hff0000,2)
invalidaterect(text,0,1)
a=0
endif
EndIf
EndIf
Return 0
End Function
Var hwnd=OpenWindow("Hyperlink Test",100,100,200,100)
text=TextGadget(1,10,10,100,30,"Visit on forum Freebasic",SS_CENTER or SS_NOTIFY)
SetGadgetColor(1,0,&hff0000,2)
SetWindowCallback(CInt(@windowproc()),1)
Do
Var ev=WaitEvent
If ev =EventGadget Then
If EventNumber=1 Then
RunProgram("C:\Program Files\Opera\opera.exe","http://www.freebasic.net/forum/")
FreeCallback(1)
EndIf
ElseIf ev= EventClose Then end
endif
Loop
Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents