EnableExplicit Define EventID If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) EditorGadget(1, 0, 0, WindowWidth(0), WindowHeight(0), 0) SetActiveGadget(1) keybd_event_(#VK_INSERT, #Null, #Null, #Null) keybd_event_(#VK_INSERT, #Null, #KEYEVENTF_KEYUP, #Null) Repeat EventID = WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf