Antonio,
it doesn't work for us, probably because we don't use these 'temporary' menus only for contextmenu but also for mdi-childs: If we open mdi-child "a", there is a main menu generatet, for example with the id's 20500-20510, then we open mdi-child "b" with the id's 20511-20520. Now "a" again gets the focus and 20500-20510 are being displayes. We close "a", but "b" is still open. But by the end-method, the id's 20511-20520 get destroyed however they are being showed. I think if you only generate context-menus that are directly destroyed after generating, it might work, but not with menus for mdi-childs.
And because of these mdi-childs the use of new id's is more elevated than in other programs, I think. Some mdi-childs use up to 100 ID's, and if you close and open these windows again and again, you can use these roughly 12.000 id's in little time.