![]() |
How to skin tray menu? |
Post Reply
|
| Author | |
ryotyankou
Newbie
Joined: 17 September 2008 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
ryotyankou
Newbie
Joined: 17 September 2008 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 January 2010 at 9:56pm |
|
Help pls.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |