im sorry to reply so latter. i have gone to another city. and i know them problem now, i got the right menu, menuitems and menuIDs, but sent the menu message to a wrong hwnd. The program has more than one toplevel hwnd, so, i retieve all its top level hwnds and send menu message it them. then, when i got the right hwnd, the message would send successfully.