не хочет гаджет определять, возвращает 0
Код:
OpenWindow(0,0,0,170,106,"Button Events",#PB_Window_ScreenCentered| #PB_Window_SystemMenu) ButtonGadget(1,10,10,150,20,"Links-Klick") ButtonGadget(2,10,32,150,20,"Rechts-Klick") ButtonGadget(3,10,54,150,20,"Doppel-Links-Klick") ButtonGadget(4,10,76,150,20,"Doppel-Rechts-Klick") Procedure GetGadget(WindowID.l) Protected po.POINT GetCursorPos_(@po) MapWindowPoints_(0, WindowID(WindowID), @po, 1) n=ChildWindowFromPoint_(WindowID(WindowID),@po) Debug ""+GadgetID(2)+" "+n+" "+po\x+" "+po\y ProcedureReturn n EndProcedure Procedure Message(Gadget.l) MessageRequester("Button "+Str(Gadget),GetGadgetText(Gadget),0) EndProcedure Repeat Select WaitWindowEvent() Case #PB_Event_CloseWindow End Case #WM_RBUTTONDOWN If GetGadget(0) = GadgetID(2) Message(2) EndIf Case #WM_RBUTTONDBLCLK If GetGadget(0) = GadgetID(4) Message(4) EndIf Case #WM_LBUTTONDBLCLK If GetGadget(0) = GadgetID(3) Message(3) EndIf Case #PB_Event_Gadget If EventGadget() = 1 And EventType() = #PB_EventType_LeftClick Message(1) EndIf EndSelect ForEver