EnableExplicit Define EventID If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) If CreatePopupMenu(1) MenuItem(1,"Neu") EndIf PostMessage_(WindowID(0), #WM_COMMAND, 1, 0) Repeat EventID=WaitWindowEvent() If GetAsyncKeyState_(#VK_RBUTTON)<>0 DisplayPopupMenu(1,WindowID(0)) EndIf If EventID=#PB_Event_Menu Select EventMenu() Case 1 MessageRequester("","MenuItem ''Neu'' wurde ausgelöst.",0) EndSelect EndIf If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf