EnableExplicit Define PID If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) GetWindowThreadProcessId_(WindowID(0),@PID) MessageRequester("","PID: "+Str(PID),0) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf