Original Post
I'm creating a POP-UP menu in my window using the following code.. HMENU hmenu, ShadowMenu, ShadedMenu, LightingMenu; hmenu = CreatePopupMenu(); ShadowMenu = CreatePopupMenu(); ShadedMenu = CreatePopupMenu(); LightingMenu = CreatePopupMenu(); InsertMenu(ShadowMenu, 0, NULL, 2000, "Yes"); InsertMenu(ShadowMenu, 1, NULL, 2001, "No"); InsertMenu(ShadedMenu, 0, NULL, 3000, "Flat"); InsertMenu(ShadedMenu, 1, NULL, 3001, "Smooth"); InsertMenu(LightingMenu, 0, NULL, 4000, "Spotlight"); InsertMenu(LightingMenu, 1, NULL, 4001, "Point"); InsertMenu(hmenu, 0, NULL, 1000, "Default View Point"); InsertMenu(hmenu, 1, NULL, 1001, "Fog Options"); InsertMenu(hmenu, 2, NULL, 1002, "Texture Mapping" ); InsertMenu(hmenu, 3, MF_POPUP, (UINT_PTR)ShadowMenu, "Shadow" ); InsertMenu(hmenu, 4, NULL, 1004, "Blending Shadow" ); InsertMenu(hmenu, 5, NULL, 1005, "Quit" ); InsertMenu(hmenu, 6, NULL, 1006, "Wire Frame" ); InsertMenu(hmenu, 7, MF_POPUP, (UINT_PTR)ShadedMenu, "Shading" ); InsertMenu(hmenu, 8, MF_POPUP, (UINT_PTR)LightingMenu, "Lighting" ); I inserted all this in my WndProc at the beginning (probably a lame place to put it.. I then use case WM_CONTEXTMENU: TrackPopupMenu(hmenu, NULL, LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL); break; to load the menu... The submenu works fine after the first couple or so tries, but at one pt the submenu doesnt show at all! and it doesnt show until I restart the program.. Sometimes the submenu works for 10 times, sometimes it stops showing after only 2 times! How can I make it so the popup menu shows up ALL THE TIME? I wonder why it stops working? Does anyone know whats going on?