Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » About... menu is disabled. Collapse All
Subject Author Date
Sujang Lee Jun 17, 2006 - 7:07 PM

When I appy theme to my project(Dialog based), the about menu in system menu is always disabled.


Code :
    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
        CExtSafeString strAboutMenu;
        if(        g_ResourceManager->LoadString( strAboutMenu, IDS_ABOUTBOX )
            &&    ( ! strAboutMenu.IsEmpty() )
            )
        {
            pSysMenu->AppendMenu( MF_SEPARATOR );
            pSysMenu->AppendMenu(
                MF_STRING,
                IDM_ABOUTBOX,
                strAboutMenu
                );
        }
    }

Screen : http://lsujang.zetyx.net

Technical Support Jun 19, 2006 - 3:20 AM

Here is the solution:

// IN YOUR OnInitDialog() METHOD:
 
CExtSafeString strAboutMenu;
    g_ResourceManager->LoadString( strAboutMenu, IDS_ABOUTBOX );
LPCTSTR strProfile = g_CmdManager->ProfileNameFromWnd( m_hWnd );
CExtCmdItem * pCmdItem = g_CmdManager->CmdAllocPtr( strProfile, ID_APP_ABOUT );
    if( pCmdItem != NULL )
        pCmdItem->m_sMenuText strAboutMenu; // = _T("About");
CMenu * pSysMenu = GetSystemMenu( FALSE );
    if( pSysMenu != NULL )
    {
        pSysMenu->AppendMenu( MF_SEPARATOR );
        pSysMenu->AppendMenu(
            MF_STRING,
            ID_APP_ABOUT,
            strAboutMenu
            );
    }

 
// IN YOUR DIALOG CLASS DECLARATION:
 
afx_msg void OnAppAbout();

 
// IN YOUR DIALOG CLASS MESSAGE MAP ENTRY:
 
ON_COMMAND( ID_APP_ABOUT, OnAppAbout )

 
// HANDLER METHOD:
 
void CYourDialogClassNameHere::OnAppAbout() 
{
    VERIFY( ProfUISAbout() );
}