Procedure Thread(dummy) Repeat GetWindowRect_(GadgetID(1),re.RECT) GetCursorPos_(pt.POINT) If PtInRect_(re, pt\y << 32 + pt\x) = 1 SetGadgetText(2,"MouseOver: Ja") Else SetGadgetText(2,"MouseOver: Nein") EndIf Delay(100) ForEver EndProcedure If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) ButtonGadget(1,10,10,100,20,"Test-Button",0) TextGadget(2,10,40,100,20,"",0) CreateThread(@Thread(),0) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf