Meinst du so?
Code: Alles auswählen
ParantWindow = FindWindow_("notepad", #Null);Dein Zielfenster auswählen
OpenWindow(0,0,0,200,200,"Help",#PB_Window_WindowCentered|#PB_Window_BorderLess, ParantWindow)
CreateImage(0,200,200,24,#Red)
ImageGadget(0,0,0,200,200,ImageID(0))
oldStyle=GetWindowLongPtr_(WindowID(0),#GWL_STYLE)
SetWindowLongPtr_(WindowID(0),#GWL_STYLE,oldStyle|#WS_CHILD &(~#WS_POPUP))
SetWindowPos_(WindowID(0), 0,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE|#SWP_NOZORDER|#SWP_FRAMECHANGED)
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_Gadget
If EventGadget() = 0 And EventType() = #PB_EventType_LeftClick
Debug "Klick"
EndIf
Case #PB_Event_CloseWindow
End
EndSelect
ForEver