How can I keep Windows from deleting a dynamically created menu that uses SetMenu?? I've read that any menus created with CreateMenu and assigned with SetMenu are automatically deleted upon losing window focus. If you recreate the menu upon recieving focus, the user sees a menu disappear and reappear.

I've tried using InsertMenuItem without SetMenu, but this only works if you first create a menu at design-time with at least one menu and then step through the code. If you don't step through, it deletes it that way also.
Original question and some pretty cool code
Thanks,
Wade

Edited by WadeD on 03-15-2000 at 04:58 PM