1.Handling WM_INITMENUPOPUP
In this method, we will be handling WM_INITMENUPOPUP message. From MSDN, "The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu". What is done is that, when WM_INITMENUPOPUP is generated, the menu will already be created. So we will be using FindWindow() API to get HWND of the menu. Then we will be modifying menu, to suit our purpose. Class name for menu is #32768.