本文整理汇总了C++中ModifyStyle函数的典型用法代码示例。如果您正苦于以下问题:C++ ModifyStyle函数的具体用法?C++ ModifyStyle怎么用?C++ ModifyStyle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ModifyStyle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindowPlacement
void CWarnPopVideo::FullScreenPopVideo(void)
{
if (m_bFullScreen==false) //full screen
{
//Hide OK Button
CButton *pBtnOK = (CButton *)GetDlgItem(IDOK);
if (pBtnOK)
pBtnOK->ShowWindow(SW_HIDE);
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_TIMEOUT);
if (pEdit)
pEdit->ShowWindow(SW_HIDE);
CButton *pBtnPause = (CButton*)GetDlgItem(IDC_PAUSE_ALARM);
if (pBtnPause)
pBtnPause->ShowWindow(SW_HIDE);
//Full Video Screen
GetWindowPlacement(&m_struOldPlacement);
//Remove WS_SIZEBOX windows style. or not the window can't be full-creen.
ModifyStyle(WS_SIZEBOX,0,0);
CRect WindowRect, ClientRect;
RECT m_FullScreenRect;
//ReDraw the window. Get the correct edge value.
GetWindowRect(&WindowRect);
WindowRect.left+=1;
WindowRect.right+=1;
MoveWindow(CRect(0,0,352,288),TRUE);
GetWindowRect(&WindowRect);
GetClientRect(&ClientRect);
ClientToScreen(&ClientRect);
//get the dest window rect.
int x = GetSystemMetrics(SM_CXSCREEN);
int y = GetSystemMetrics(SM_CYSCREEN);
m_FullScreenRect.left = WindowRect.left - ClientRect.left;
m_FullScreenRect.top = WindowRect.top - ClientRect.top;
m_FullScreenRect.right = WindowRect.right - ClientRect.right + x;
m_FullScreenRect.bottom = WindowRect.bottom - ClientRect.bottom + y;
// m_FullScreenRect.left = 0;
// m_FullScreenRect.top = 0;
// m_FullScreenRect.right = GetSystemMetrics(SM_CXSCREEN);
// m_FullScreenRect.bottom = GetSystemMetrics(SM_CYSCREEN);
//Move the main window to the dest rect.
WINDOWPLACEMENT wndpl;
wndpl.length = sizeof(WINDOWPLACEMENT);
wndpl.flags = 0;
wndpl.showCmd = SW_SHOWNORMAL;
wndpl.rcNormalPosition = m_FullScreenRect;
SetWindowPlacement(&wndpl);
//Move the view winow to full-screen.
RECT rc;
GetClientRect(&rc);
m_pPopView->MoveWindow(&rc,TRUE);
//
m_bFullScreen = true;
}
else //Restore normal screen
{
//Show OK Button
CRect btnRect;
CButton *pBtnOK = (CButton *)GetDlgItem(IDOK);
if (pBtnOK)
{
pBtnOK->ShowWindow(SW_SHOW);
pBtnOK->GetClientRect(&btnRect);
}
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_TIMEOUT);
if (pEdit)
pEdit->ShowWindow(SW_SHOW);
CButton *pBtnPause = (CButton*)GetDlgItem(IDC_PAUSE_ALARM);
if (pBtnPause)
pBtnPause->ShowWindow(SW_SHOW);
//Restore old position
ModifyStyle(0,WS_SIZEBOX,0);
SetWindowPlacement(&m_struOldPlacement);
RECT rc;
GetClientRect(&rc);
rc.bottom -= (btnRect.Height()+3);
m_pPopView->MoveWindow(&rc,TRUE);
//SetWindowSize();
//
m_bFullScreen = false;
}
}
示例2: ModifyStyle
/**
* @param hwndEdit - window handle.
*/
void CNumEdit::SubclassWindow(HWND hwndEdit)
{
CWindowImpl::SubclassWindow(hwndEdit);
ModifyStyle(0, ES_UPPERCASE);
UpdateRadixTitle();
}
示例3: OnApplicationLook
//.........这里部分代码省略.........
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE, ID_VIEW_CUSTOMIZE, strCustomize);
// 允许用户定义的工具栏操作:
InitUserToolbars(NULL, uiFirstUserToolBarId, uiLastUserToolBarId);
if (!m_wndStatusBar.Create(this))
{
TRACE0("未能创建状态栏\n");
return -1; // 未能创建
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
// TODO: 如果您不希望工具栏和菜单栏可停靠,请删除这五行
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
// 启用 Visual Studio 2005 样式停靠窗口行为
CDockingManager::SetDockingMode(DT_SMART);
// 启用 Visual Studio 2005 样式停靠窗口自动隐藏行为
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// 加载菜单项图像(不在任何标准工具栏上):
CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0);
// 创建停靠窗口
if (!CreateDockingWindows())
{
TRACE0("未能创建停靠窗口\n");
return -1;
}
m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
m_wndClassView.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndFileView);
CDockablePane* pTabbedBar = NULL;
m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
m_wndOutput.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndOutput);
m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndProperties);
// 启用增强的窗口管理对话框
EnableWindowsDialog(ID_WINDOW_MANAGER, ID_WINDOW_MANAGER, TRUE);
// 启用工具栏和停靠窗口菜单替换
EnablePaneMenu(TRUE, ID_VIEW_CUSTOMIZE, strCustomize, ID_VIEW_TOOLBAR);
// 启用快速(按住 Alt 拖动)工具栏自定义
CMFCToolBar::EnableQuickCustomization();
if (CMFCToolBar::GetUserImages() == NULL)
{
// 加载用户定义的工具栏图像
if (m_UserImages.Load(_T(".\\UserImages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
}
// 启用菜单个性化(最近使用的命令)
// TODO: 定义您自己的基本命令,确保每个下拉菜单至少有一个基本命令。
CList<UINT, UINT> lstBasicCommands;
lstBasicCommands.AddTail(ID_FILE_NEW);
lstBasicCommands.AddTail(ID_FILE_OPEN);
lstBasicCommands.AddTail(ID_FILE_SAVE);
lstBasicCommands.AddTail(ID_FILE_PRINT);
lstBasicCommands.AddTail(ID_APP_EXIT);
lstBasicCommands.AddTail(ID_EDIT_CUT);
lstBasicCommands.AddTail(ID_EDIT_PASTE);
lstBasicCommands.AddTail(ID_EDIT_UNDO);
lstBasicCommands.AddTail(ID_APP_ABOUT);
lstBasicCommands.AddTail(ID_VIEW_STATUS_BAR);
lstBasicCommands.AddTail(ID_VIEW_TOOLBAR);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2003);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_VS_2005);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLUE);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_SILVER);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_BLACK);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_OFF_2007_AQUA);
lstBasicCommands.AddTail(ID_VIEW_APPLOOK_WINDOWS_7);
lstBasicCommands.AddTail(ID_SORTING_SORTALPHABETIC);
lstBasicCommands.AddTail(ID_SORTING_SORTBYTYPE);
lstBasicCommands.AddTail(ID_SORTING_SORTBYACCESS);
lstBasicCommands.AddTail(ID_SORTING_GROUPBYTYPE);
CMFCToolBar::SetBasicCommands(lstBasicCommands);
// 将文档名和应用程序名称在窗口标题栏上的顺序进行交换。这
// 将改进任务栏的可用性,因为显示的文档名带有缩略图。
ModifyStyle(0, FWS_PREFIXTITLE);
return 0;
}
示例4: SetItemArgs
void CXTPReportInplaceList::Create(XTP_REPORTRECORDITEM_ARGS* pItemArgs, CXTPReportRecordItemConstraints* pConstaints)
{
SetItemArgs(pItemArgs);
CRect rect(pItemArgs->rcItem);
if (!m_hWnd)
{
CListBox::CreateEx(WS_EX_TOOLWINDOW | (pControl->GetExStyle() & WS_EX_LAYOUTRTL), _T("LISTBOX"), _T(""), LBS_NOTIFY | WS_CHILD | WS_BORDER | WS_VSCROLL, CRect(0, 0, 0, 0), pControl, 0);
SetOwner(pControl);
}
SetFont(pControl->GetPaintManager()->GetTextFont());
ResetContent();
int dx = rect.right - rect.left + 1;
CWindowDC dc(pControl);
CXTPFontDC font(&dc, GetFont());
int nThumbLength = GetSystemMetrics(SM_CXHTHUMB);
CString strCaption = pItem->GetCaption(pColumn);
DWORD dwData = pItem->GetSelectedConstraintData(pItemArgs);
for (int i = 0; i < pConstaints->GetCount(); i++)
{
CXTPReportRecordItemConstraint* pConstaint = pConstaints->GetAt(i);
CString str = pConstaint->m_strConstraint;
int nIndex = AddString(str);
SetItemDataPtr(nIndex, pConstaint);
dx = max(dx, dc.GetTextExtent(str).cx + nThumbLength);
if ((dwData == (DWORD)-1 && strCaption == str) || (dwData == pConstaint->m_dwData))
SetCurSel(nIndex);
}
int nHeight = GetItemHeight(0);
rect.top = rect.bottom;
//rect.bottom += nHeight * min(10, GetCount()) + 2;
rect.bottom += nHeight * min(m_Items2Show, GetCount()) + 2;
rect.left = rect.right - dx;
pControl->ClientToScreen(&rect);
CRect rcWork = XTPMultiMonitor()->GetWorkArea(rect);
if (rect.bottom > rcWork.bottom && rect.top > rcWork.CenterPoint().y)
rect.OffsetRect(0, - rect.Height() - pItemArgs->rcItem.Height());
if (rect.left < rcWork.left) rect.OffsetRect(rcWork.left - rect.left, 0);
if (rect.right > rcWork.right) rect.OffsetRect(rcWork.right - rect.right, 0);
SetFocus();
if (!m_hWnd) // Can be destroyed after focus set
return;
SetWindowLongPtr(m_hWnd, GWLP_HWNDPARENT, 0);
ModifyStyle(WS_CHILD, WS_POPUP);
SetWindowLongPtr(m_hWnd, GWLP_HWNDPARENT, (LONG_PTR)pControl->m_hWnd);
SetWindowPos(&CWnd::wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
CXTPMouseMonitor::SetupHook(this);
}
示例5: ModifyStyle
void CxStatic::SetMoveable(BOOL moveAble)
{
ModifyStyle(0, SS_NOTIFY);
m_bAllowMove = moveAble;
}
示例6: ASSERT
void CExtMiniDockFrameWnd::_ResizingStart(
UINT nHitTest,
const CPoint & point
)
{
ASSERT( m_nResizingMode == HTNOWHERE );
ASSERT( IsWindowVisible() );
CExtPopupMenuWnd::CancelMenuTracking();
CWnd::CancelToolTips();
CExtControlBar * pExtBar = GetControlBarExt();
ASSERT_VALID( pExtBar );
if( !pExtBar->_IsShowContentWhenDragging()
&& pExtBar->IsFixedMode()
)
{
m_nResizingMode = HTNOWHERE;
pExtBar->m_pDockContext->StartResize(nHitTest, point);
return;
}
switch( nHitTest )
{
case HTLEFT:
case HTRIGHT:
case HTTOP:
case HTTOPLEFT:
case HTTOPRIGHT:
case HTBOTTOM:
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
m_nResizingMode = nHitTest;
break;
default:
return;
} // switch( nHitTest )
#ifdef _DEBUG
int nPos = 1;
CControlBar * pDebugDummyBar = NULL;
while(
pDebugDummyBar == NULL
&& nPos < m_wndDockBar.m_arrBars.GetSize()
)
pDebugDummyBar =
reinterpret_cast<CExtDockBar&>
(m_wndDockBar).
GetDockedControlBar(nPos++);
ASSERT(pDebugDummyBar != NULL);
ASSERT_KINDOF(CExtControlBar, pDebugDummyBar);
ASSERT(pDebugDummyBar->m_pDockContext != NULL);
// CBRS_SIZE_DYNAMIC toolbars cannot have the CBRS_FLOAT_MULTI style
ASSERT((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0);
#endif // _DEBUG
ASSERT( pExtBar == pDebugDummyBar );
ASSERT(pExtBar->m_pDockContext != NULL);
if( !pExtBar->IsFixedMode() )
ModifyStyle( __REMOVED_NONFIXMODE_STYLES, 0 );
BringWindowToTop();
CExtMouseCaptureSink::SetCapture( GetSafeHwnd() );
GetWindowRect( &m_rcWndResizingStart );
while( m_nResizingMode != HTNOWHERE )
{
::WaitMessage();
MSG msg;
// Process all the messages in the message queue
while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) )
{
bool bStop = false;
switch( msg.message )
{
case WM_ACTIVATEAPP:
case WM_COMMAND:
bStop = true;
break;
default:
if( WM_KEYFIRST <= msg.message
&& msg.message <= WM_KEYLAST
)
bStop = true;
break;
} // switch( msg.message )
if( (!bStop) &&
CExtMouseCaptureSink::GetCapture() != GetSafeHwnd()
)
bStop = true;
if( bStop )
{
_ResizingEnd();
return;
}
if( !AfxGetThread()->PumpMessage() )
{
PostQuitMessage(0);
return; // Signal WM_QUIT received
} // if( !AfxGetThread()->PumpMessage() )
//.........这里部分代码省略.........
示例7: ModifyStyle
//初始化函数
BOOL CGameFrameDlg::OnInitDialog()
{
__super::OnInitDialog();
//设置属性
ModifyStyle(WS_CAPTION|WS_BORDER,0,0);
//读取配置
m_bAllowSound=AfxGetApp()->GetProfileInt(TEXT("GameOption"),TEXT("EnableSound"),TRUE)?true:false;
//创建控制
m_pGameFrameControl=new CGameFrameControl(this);
if (m_pGameFrameControl==NULL) throw TEXT("游戏框架创建失败");
//创建组件
if (m_MessageProxyHelper.CreateInstance()==false) throw TEXT("信息组件创建失败");
m_MessageProxyHelper->SetRichEditHwnd(&m_pGameFrameControl->m_ChatMessage);
//设置界面
m_VorSplitter.SetSplitterSink(this);
//创建组件
if (m_UserFaceResHelper.CreateInstance()==false) throw TEXT("头像组件加载失败");
if (m_ClientKernelHelper.CreateInstance()==false) throw TEXT("游戏框架内核模块加载失败");
//创建游戏视图
CRect rcGameView(0,0,0,0);
m_pGameFrameControl->Create(IDD_FRAME_CONTROL,this);
if (m_pGameFrameControl->SetUserFaceRes(m_UserFaceResHelper.GetInterface())==false) throw TEXT("头像资源接口设置失败");
m_pGameFrameView->Create(NULL,NULL,WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,rcGameView,this,10);
if (m_pGameFrameView->SetUserFaceRes(m_UserFaceResHelper.GetInterface())==false) throw TEXT("头像资源接口设置失败");
CVideoServiceManager * pVideoServiceManager=CVideoServiceManager::GetInstance();
if (pVideoServiceManager!=NULL && pVideoServiceManager->SetUserFaceRes(m_UserFaceResHelper.GetInterface())==false) throw TEXT("头像资源接口设置失败");
//初始化内核
LPCTSTR lpszCmdLine=AfxGetApp()->m_lpCmdLine;
bool bSuccess=m_ClientKernelHelper->InitClientKernel(lpszCmdLine,m_pKernelSink);
if (bSuccess==false) throw TEXT("游戏框架逻辑模块初始化失败");
bSuccess=m_ClientKernelHelper->SetMessageProxy(m_MessageProxyHelper.GetInterface());
if (bSuccess==false) throw TEXT("获取消息输出模块失败");
//初始化游戏
m_pGameFrameControl->SetClientKernel(m_ClientKernelHelper.GetInterface());
if (InitGameFrame()==false) throw TEXT("游戏框架初始化失败");
//加载资源
UpdateSkinResource();
//移动窗口
INT nXScreen=GetSystemMetrics(SM_CXSCREEN);
INT nYScreen=GetSystemMetrics(SM_CYSCREEN);
SetWindowPos(NULL,0,0,__min(nXScreen,1024),__min(nYScreen,730),SWP_NOZORDER|SWP_NOMOVE);
//显示窗口
m_bInitDialog=true;
m_pGameFrameView->ShowWindow(SW_SHOW);
m_pGameFrameControl->ShowWindow(SW_SHOW);
//显示窗口
CenterWindow();
MaxSizeWindow();
ShowWindow(SW_SHOW);
return TRUE;
}
示例8: ModifyStyle
//建立消息
int CGameFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (__super::OnCreate(lpCreateStruct)==-1) return -1;
//设置属性
ModifyStyle(WS_CAPTION|WS_BORDER,0,0);
//设置图标
HICON hIcon=LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME));
SetIcon(hIcon,TRUE);
SetIcon(hIcon,FALSE);
//设置标题
CString strTitle;
strTitle.LoadString(AfxGetInstanceHandle(),IDS_MAIN_TITLE);
SetWindowText(strTitle);
//广告控件
m_BrowerAD.Create(NULL,NULL,WS_VISIBLE|WS_CHILD,CRect(0,0,0,0),this,IDC_BROWER_AD,NULL);
m_BrowerAD.Navigate(TEXT("http://127.0.0.1:8086/AD/GamePlazaAD.asp"),NULL,NULL,NULL,NULL);
//拆分条控件
m_Splitter.Create(NULL,NULL,WS_VISIBLE|WS_CHILD,CRect(0,0,0,0),this,IDC_SPLITTER,NULL);
m_Splitter.SetSplitterSink(this);
//用户视图
m_UserInfoView.Create(IDD_USER_INFO,this);
m_UserInfoView.ShowWindow(SW_SHOW);
//服务器视图
m_ServerItemView.Create(WS_VISIBLE|WS_CHILD,CRect(0,0,0,0),this,IDC_SERVER_ITEM_VIEW);
m_ServerItemView.InitServerItemView(this);
g_GlobalUnits.m_ServerListManager.InitServerListManager(&m_ServerItemView);
//好友列表
m_wShowListType = IDC_BT_LIST_CONTROL_1;
m_UserCompanionList.Create(WS_CHILD,CRect(0,0,0,0),this,IDC_COMPANION_LIST);
//创建按钮
m_btMin.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_MIN);
m_btMax.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_MAX);
m_btClose.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_CLOSE);
m_btExChangeSkin.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_EXCHANGE_SINK);
m_btExChangeSkin.ShowWindow(SW_HIDE);
m_btButton1.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_BUTTON_1);
m_btButton2.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_BUTTON_2);
m_btButton3.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_BUTTON_3);
m_btButton4.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_BUTTON_4);
m_btButton5.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_BUTTON_5);
m_btGamePlaza.Create(TEXT("游戏大厅"),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_PLAZA);
m_btSelfOption.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_SELF_OPTION);
m_btSwitchUser.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_SWITCH_ACCOUNTS);
m_btGlobalOption.Create(TEXT(""),WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_SYSTEM_OPTION);
m_btListControl1.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_LIST_CONTROL_1);
m_btListControl2.Create(NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,IDC_BT_LIST_CONTROL_2);
for (WORD i=0;i<CountArray(m_btViewItem);i++)
{
CRect rcCreate(0,0,0,0);
m_btViewItem[i].Create(NULL,WS_CHILD,rcCreate,this,IDC_BT_VIEW_ITEM+i);
}
//皮肤资源
UpdateSkinResource();
//建立提示控件
m_ToolTipCtrl.Create(this);
m_ToolTipCtrl.Activate(TRUE);
m_ToolTipCtrl.AddTool(GetDlgItem(IDC_BT_MIN),TEXT("最小化游戏广场"));
m_ToolTipCtrl.AddTool(GetDlgItem(IDC_BT_CLOSE),TEXT("退出游戏广场"));
//创建控件
m_DlgGamePlaza.Create(IDD_GAME_PLAZA,this);
ActivePlazaViewItem();
//注册热键
g_GlobalUnits.RegisterHotKey(m_hWnd,IDI_HOT_KEY_BOSS,g_GlobalOption.m_wBossHotKey);
//窗口位置
CRect rcArce;
SystemParametersInfo(SPI_GETWORKAREA,0,&rcArce,SPIF_SENDCHANGE);
//显示窗口
MaxSizeWindow();
ShowWindow(SW_SHOW);
//默认位置
m_rcNormalSize.left=(rcArce.Width()-LESS_SCREEN_X)/2;
m_rcNormalSize.top=(rcArce.Height()-LESS_SCREEN_Y)/2;
m_rcNormalSize.right=(rcArce.Width()+LESS_SCREEN_X)/2;
m_rcNormalSize.bottom=(rcArce.Height()+LESS_SCREEN_Y)/2;
return 0;
}
示例9: ModifyStyle
void CMyColorList::PreSubclassWindow()
{
ModifyStyle(0,LVS_OWNERDRAWFIXED);
}
示例10: ModifyStyle
void CBmpTab::PreSubclassWindow()
{
// TODO: Add your specialized code here and/or call the base class
ModifyStyle(0,SS_NOTIFY);
CStatic::PreSubclassWindow();
}
示例11: ModifyStyle
void CNewHeaderCtrl::Init()
{
ModifyStyle(0, HDS_FLAT);
}
示例12: GetStyle
bool CSkinDialog::LoadSkin(const char * szSkinPath /* = NULL */, const char * szControlName)
{
if(szSkinPath==NULL)
{
CImgSkin::Unload();
return true;
}
if(!CImgSkin::Load(szSkinPath, szControlName))
return false;
m_dwStyle = GetStyle();
// 去掉标题栏,边框,只留客户区
// ModifyStyle(WS_CAPTION|WS_THICKFRAME, 0);
ModifyStyle(WS_CAPTION, 0);
CRect rcWindow;
CRect rcClient;
CRect rc;
GetWindowRect(&rcWindow);
GetClientRect(&m_rcClient);
// 圆角
SetWindowRgn(CreateRoundRectRgn(0, 0, rcWindow.Width(), rcWindow.Height(), m_mapRect["RoundCorner"].Width, m_mapRect["RoundCorner"].Height), TRUE);
if(!HasStyle(WS_CHILD))
{
// 调整窗口自己
rcWindow.left -= m_mapRect["BorderLeft"].Width;
rcWindow.right += m_mapRect["BorderRight"].Width;
rcWindow.top -= m_mapRect["TitleLeft"].Height;
rcWindow.bottom += m_mapRect["BorderBot"].Height;
CWnd * pParent = GetParent();
if(pParent==NULL) pParent = GetDesktopWindow();
//pParent->ScreenToClient(&rcWindow);
//MoveWindow(rcWindow, FALSE);
GetClientRect(&rcClient);
POINT ptOffset = {0};
CRect rcChild;
CWnd* pWndChild;
// 菜单
CMenu * pMenu = GetMenu();
if(pMenu)
{
m_wndMenuBar.CreateToolBar(WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this, ID_MENU_BAR);
m_wndMenuBar.LoadMenu(pMenu);
m_wndMenuBar.SetFlags(xtpFlagStretched);
SetMenu(NULL);
CXTPPaintManager::SetTheme(xtpThemeOffice2003);
m_wndMenuBar.LoadSkin(szSkinPath);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, reposDefault, NULL, &rcClient);
AddAnchor(m_wndMenuBar, ANCHOR_TOPLEFT|ANCHOR_TOPRIGHT);
m_wndMenuBar.GetWindowRect(&rc);
ptOffset.y += rc.Height();
pWndChild = GetWindow(GW_CHILD);
while (pWndChild)
{
if(pWndChild!=&m_wndMenuBar)
{
pWndChild->GetWindowRect(rcChild);
rcChild.OffsetRect(ptOffset);
ScreenToClient(&rcChild);
pWndChild->MoveWindow(rcChild, FALSE);
}
pWndChild = pWndChild->GetNextWindow();
}
}
// 调整子窗口
/*
ptOffset.x = m_mapRect["BorderLeft"].Width;
ptOffset.y = m_mapRect["TitleLeft"].Height;
pWndChild = GetWindow(GW_CHILD);
while (pWndChild)
{
pWndChild->GetWindowRect(rcChild);
rcChild.OffsetRect(ptOffset);
ScreenToClient(&rcChild);
pWndChild->MoveWindow(rcChild, FALSE);
pWndChild = pWndChild->GetNextWindow();
}
m_rcClient.left = ptOffset.x;
m_rcClient.right = m_rcClient.left+rcClient.Width();
m_rcClient.top += ptOffset.y;
m_rcClient.bottom = m_rcClient.top+rcClient.Height();
*/
}
//.........这里部分代码省略.........
示例13: ModifyStyle
void CImgButton::PreSubclassWindow()
{
ModifyStyle(0, BS_OWNERDRAW, 0);
CButton::PreSubclassWindow();
}
示例14: OnApplicationLook
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
BOOL bNameValid;
// set the visual manager and style based on persisted value
OnApplicationLook(theApp.m_nAppLook);
CMDITabInfo mdiTabParams;
mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_ONENOTE; // other styles available...
mdiTabParams.m_bActiveTabCloseButton = TRUE; // set to FALSE to place close button at right of tab area
mdiTabParams.m_bTabIcons = FALSE; // set to TRUE to enable document icons on MDI taba
mdiTabParams.m_bAutoColor = TRUE; // set to FALSE to disable auto-coloring of MDI tabs
mdiTabParams.m_bDocumentMenu = TRUE; // enable the document menu at the right edge of the tab area
EnableMDITabbedGroups(TRUE, mdiTabParams);
m_wndRibbonBar.Create(this);
m_wndRibbonBar.LoadFromResource(IDR_RIBBON);
if (!m_wndStatusBar.Create(this))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
CString strTitlePane1;
CString strTitlePane2;
bNameValid = strTitlePane1.LoadString(IDS_STATUS_PANE1);
ASSERT(bNameValid);
bNameValid = strTitlePane2.LoadString(IDS_STATUS_PANE2);
ASSERT(bNameValid);
m_wndStatusBar.AddElement(new CMFCRibbonStatusBarPane(ID_STATUSBAR_PANE1, strTitlePane1, TRUE), strTitlePane1);
m_wndStatusBar.AddExtendedElement(new CMFCRibbonStatusBarPane(ID_STATUSBAR_PANE2, strTitlePane2, TRUE), strTitlePane2);
// enable Visual Studio 2005 style docking window behavior
CDockingManager::SetDockingMode(DT_SMART);
// enable Visual Studio 2005 style docking window auto-hide behavior
EnableAutoHidePanes(CBRS_ALIGN_ANY);
// Load menu item image (not placed on any standard toolbars):
CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES, theApp.m_bHiColorIcons ? IDB_MENU_IMAGES_24 : 0);
// create docking windows
if (!CreateDockingWindows())
{
TRACE0("Failed to create docking windows\n");
return -1;
}
m_wndFileView.EnableDocking(CBRS_ALIGN_ANY);
m_wndClassView.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndFileView);
CDockablePane* pTabbedBar = NULL;
m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
m_wndOutput.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndOutput);
m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndProperties);
// Enable enhanced windows management dialog
EnableWindowsDialog(ID_WINDOW_MANAGER, ID_WINDOW_MANAGER, TRUE);
// Switch the order of document name and application name on the window title bar. This
// improves the usability of the taskbar because the document name is visible with the thumbnail.
ModifyStyle(0, FWS_PREFIXTITLE);
return 0;
}
示例15: CDisplay
HRESULT BKMainFrame::initDirectDraw()
{
if ( display ) { delete display; display = NULL; }
display = new CDisplay();
if ( isFullScreenMode() ) {
CDC* dc = CWnd::GetDesktopWindow()->GetDC();
int bpp = dc->GetDeviceCaps( BITSPIXEL );
CWnd::GetDesktopWindow()->ReleaseDC( dc );
if ( display->CreateFullScreenDisplay( this, 512, 256, bpp ) != S_OK ) {
AfxMessageBox( "Failed initializing DirectDraw." );
return -1;
}
ModifyStyle( WS_OVERLAPPEDWINDOW, 0 );
SetMenu( NULL );
fullWindowWidth = display->getSurfaceDesc()->dwWidth;
fullWindowHeight = display->getSurfaceDesc()->dwHeight;
} else {
if ( display->CreateWindowedDisplay( this, bk_width, bk_height ) != S_OK ) {
AfxMessageBox( "Failed initializing DirectDraw." );
return -1;
}
ModifyStyle( 0, WS_OVERLAPPEDWINDOW );
SetMenu( CMenu::FromHandle( ::LoadMenu( NULL, MAKEINTRESOURCE( IDR_MAINFRAME ) ) ) );
}
::SystemParametersInfo( SPI_GETWORKAREA, 0, &screenRect, 0 );
updateBounds();
ShowCursor( !fullScreenMode );
bytePerPixel = display->getSurfaceDesc()->ddpfPixelFormat.dwRGBBitCount >> 3;
if ( bytePerPixel > 1 ) {
DWORD rMask = display->getSurfaceDesc()->ddpfPixelFormat.dwRBitMask;
DWORD gMask = display->getSurfaceDesc()->ddpfPixelFormat.dwGBitMask;
DWORD bMask = display->getSurfaceDesc()->ddpfPixelFormat.dwBBitMask;
DWORD mask;
rBits = 0;
gBits = 0;
bBits = 0;
rZero = 0;
gZero = 0;
bZero = 0;
mask = rMask;
while ( (mask & 0x1) == 0 ) {
mask = mask >> 1;
rZero++;
}
while ( mask & 0x1 ) {
mask = mask >> 1;
rBits++;
}
mask = gMask;
while ( (mask & 0x1) == 0 ) {
mask = mask >> 1;
gZero++;
}
while ( mask & 0x1 ) {
mask = mask >> 1;
gBits++;
}
mask = bMask;
while ( (mask & 0x1) == 0 ) {
mask = mask >> 1;
bZero++;
}
while ( mask & 0x1 ) {
mask = mask >> 1;
bBits++;
}
rBits = 8 - rBits;
gBits = 8 - gBits;
bBits = 8 - bBits;
}