Xtreme Toolkit 常用代码
- 发表于
- VC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
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); |
原文连接:Xtreme Toolkit 常用代码
所有媒体,可在保留署名、
原文连接
的情况下转载,若非则不得使用我方内容。