Is it possible to set callback function for gadget
Is it possible to set callback function for gadget [SOLVED]
-
SkyManager
- Enthusiast

- Posts: 339
- Joined: Tue Jan 30, 2007 5:47 am
- Location: Hong Kong
Is it possible to set callback function for gadget [SOLVED]
I see codes for setting callback function to window.
Is it possible to set callback function for gadget
Is it possible to set callback function for gadget
Last edited by SkyManager on Sat Mar 03, 2007 12:45 am, edited 1 time in total.
Code: Select all
Global Gadget
Procedure GadgetCallback(hWnd, uMsg, wParam, lParam)
If uMsg = #WM_LBUTTONDBLCLK
Debug "Double Clicked!"
EndIf
ProcedureReturn CallWindowProc_(Gadget, hWnd, uMsg, wParam, lParam)
EndProcedure
If OpenWindow(0, 0, 0, 150, 75, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ButtonGadget(0, 5, 5, 125, 25, "Double Click Me!")
Gadget = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, @GadgetCallback())
Repeat
WinEvent = WaitWindowEvent()
Until WinEvent = #PB_Event_CloseWindow
EndIf : Endc ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
-
SkyManager
- Enthusiast

- Posts: 339
- Joined: Tue Jan 30, 2007 5:47 am
- Location: Hong Kong
