现在的位置: 首页 > 综合 > 正文

Xtreme Toolkit 常用代码

2013年08月03日 ⁄ 综合 ⁄ 共 1675字 ⁄ 字号 评论关闭

 m_myStatic_MenuIcon.Create(_T(""), WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE, CRect(5,5,24,24), pMenuBar,0x1234);
m_myStatic_MenuIcon.SetBitmap(::LoadBitmap(AfxGetApp()->m_hInstance,(LPCTSTR)IDB_BITMAP1));

XTP_COMMANDBARS_ICONSINFO* pIconsInfo = XTPPaintManager()->GetIconsInfo();//设置图标的一些属性
pIconsInfo->bUseDisabledIcons =TRUE;
pIconsInfo->bIconsWithShadow = FALSE;
pIconsInfo->bUseFadedIcons=TRUE;

RedrawWindow(0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN);   
GetCommandBars()->GetPaintManager()->RefreshMetrics(); 
GetCommandBars()->RedrawCommandBars();

ModifyStyle(WS_THICKFRAME,0);
ModifyStyle(0,WS_THICKFRAME);//去掉状态栏下面拖动的Gripper

pMenuBar->ModifyBarStyle(CBRS_GRIPPER,0);//去掉菜单或工具条前面的Gripper
pMenuBar->EnableDocking(xtpFlagHideWrap | xtpFlagStretched);//菜单或工具条延伸

CXTPCommandBarsOptions* pOptions = pCommandBars->GetCommandBarsOptions();
pOptions->bShowExpandButtonAlways=FALSE;//不显示扩展按钮

pToolBar->ShowTextBelowIcons();//字显示在工具条图标下面

//设置菜单项前面小图标
UINT nCommands[] ={ID_TASKS_BEGIN,ID_TASKS_STOP,ID_NEW_DOWNLOAD,ID_TASKS_DELETE,
ID_OPEN_PATH,ID_HELP,ID_HOMEPAGE,ID_APP_EXIT,ID_TASKS_UP,ID_TASKS_DOWN};
 XTPImageManager()->SetIcons(IDB_SmallIcon, nCommands, sizeof(nCommands)/sizeof(UINT), CSize(16, 16) );

//设置皮肤和样式
XTPPaintManager()->SetCustomTheme(new CWinMountTheme());//自己写的新的样式类
XTPPaintManager()->SetTheme(xtpThemeNativeWinXP);//系统自带的

//在所有窗口的上面
SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOREPOSITION | SWP_NOMOVE );

//子窗口一直在主窗口下面
CChildDlg *pdlg;
pdlg=new CChildDlg;
pdlg->Create(IDD_DIALOG1,GetDesktopWindow());
pdlg->SetWindowPos(this,0,0,30,50,SWP_NOSIZE);
pdlg->ShowWindow(SW_SHOW);
CWnd*   pMainWnd   =   AfxGetMainWnd();
pMainWnd->SetWindowPos(&wndTopMost,  0,  0,  0, 0, SWP_NOSIZE|SWP_NOMOVE);
 
 
 
   

抱歉!评论已关闭.