Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to skin tray menu?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to skin tray menu?

 Post Reply Post Reply
Author
Message
ryotyankou View Drop Down
Newbie
Newbie


Joined: 17 September 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryotyankou Quote  Post ReplyReply Direct Link To This Post Topic: How to skin tray menu?
    Posted: 15 January 2010 at 1:29am
I use toolkit pro 13.2.1. This is what i did in my project.(MFC dialog based application.)
1. Add
#include <XTToolkitPro.h> to stdafx.h.
2. Initialize the skin in CXXXApp::InitInstance
    void InitializeSkin()
    {
        CString pathToSkinFiles = GetSkinFolderPath() ;

        XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyColors | xtpSkinApplyMetrics);
        XTPSkinManager()->LoadSkin(pathToSkinFiles, _T("default.INI"));
    }
3. Change every used CDialog to CXTResizeDialog.
I add a tray menu to my application. Everything(dialog skin) ok, except the tray menu. What should i do to skin the menu? My code is:
LRESULT CXXXXDlg::OnNotify(WPARAM wParam, LPARAM lParam)
{
    if((UINT)wParam == IDR_MAINFRAME)
    {
        UINT eventID = static_cast<UINT>(lParam);
        if(eventID == WM_LBUTTONDBLCLK)
        {
            OnShoworHideMainWindow(!iswindowshow_, 0);
        }

        if(eventID == WM_RBUTTONDOWN)
        {
            SetForegroundWindow();

            POINT pt;
            GetCursorPos(&pt);//get mouse pos

            HMENU hMenu = LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_TRAY_MENU));
            HMENU hSubMenu = GetSubMenu(hMenu, 0);
            SetMenuDefaultItem(hSubMenu, ID_APP_CONFIG, FALSE);
            TrackPopupMenuEx(hSubMenu, TPM_RIGHTALIGN,    pt.x, pt.y, m_hWnd, NULL);
            DestroyMenu(hMenu);
        }
    }

    return 0;
}
TIA.
Back to Top
ryotyankou View Drop Down
Newbie
Newbie


Joined: 17 September 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote ryotyankou Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2010 at 9:56pm
Help pls.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.110 seconds.