How to remove the 'New' menu item from my PocketPC app?
-
I know I am missing a simple setting somewhere but I can't find it. Google was unfortunately no help either. I am developing an MFC app (for now) and it has a menu resource. The menu appears how I want it but when deployed on the PocketPC 2003 (emulator or actual device), the 'New' menu option appears but it is disabled. How do 1) I remove it altogether or 2) take advantage of it? Thanks, Paul
-
I know I am missing a simple setting somewhere but I can't find it. Google was unfortunately no help either. I am developing an MFC app (for now) and it has a menu resource. The menu appears how I want it but when deployed on the PocketPC 2003 (emulator or actual device), the 'New' menu option appears but it is disabled. How do 1) I remove it altogether or 2) take advantage of it? Thanks, Paul
I found an answer and so I am posting the result here in case anyone else wants to do this.... First, this article was a big help: http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.Menu[^] So what I did was remove all instances of the CCommandBar (m_wndCommandBar) from the CMainFrame class that VS2005 automatically put in. In the CMainFrame::OnCreate() method, after the m_wndView.Init(), I added:
SHMENUBARINFO mbi; memset(&mbi, 0, sizeof(SHMENUBARINFO)); mbi.cbSize = sizeof(SHMENUBARINFO); mbi.dwFlags = SHCMBF_HMENU; mbi.hwndParent = m_hWnd; mbi.nToolBarId = IDR_MAINFRAME; mbi.hInstRes = theApp.m_hInstance; SHCreateMenuBar(&mbi);
This had the added benefit of allowing me to rename the main menu item (popup) as well. I am not sure of all the ramifications (portability, button access, etc.) but it seems to work fine for my PocketPC use.