i got now this but i dont know how to retrieve the the clicked button
function main()
{
wait(1);
HMENU menu=CreateMenu();
HMENU hSubMenu=CreateMenu();
InsertMenu(hSubMenu,0,MF_BYPOSITION|MF_STRING,1,"BEEP");
InsertMenu(hSubMenu,2,MF_SEPARATOR|MF_BYPOSITION,0,"");
InsertMenu(hSubMenu,1,MF_BYPOSITION|MF_STRING,2,"QUIT");
InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"File");
SetWindowLong(hWnd,GWL_WNDPROC, WndProc);
SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_SIZEBOX);
SetMenu(hWnd,menu);
ShowWindow(hWnd,SW_SHOWMAXIMIZED);