EnableExplicit Define EventID Structure Point64 StructureUnion p.POINT q.q EndStructureUnion EndStructure Procedure Thread(z) Protected cursor.POINT64 Protected hndl Repeat GetCursorPos_(cursor.POINT64) hndl = WindowFromPoint_( cursor\q ) SetGadgetText(1,"Handle-Nummer unter Maus: "+Str(hndl)) Delay(100) ForEver EndProcedure If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) TextGadget(1,10,10,WindowWidth(0)-20,20,"",0) CreateThread(@Thread(),0) Repeat EventID=WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf