本文整理汇总了C++中GetExStyle函数的典型用法代码示例。如果您正苦于以下问题:C++ GetExStyle函数的具体用法?C++ GetExStyle怎么用?C++ GetExStyle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetExStyle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetParent
void CXTPSkinObjectFrame::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{
CXTPSkinObject::OnWindowPosChanging(lpwndpos);
if ((m_pManager->HasApplyOptions(xtpSkinApplyMetrics | xtpSkinApplyFrame)) &&
((GetExStyle() & WS_EX_MDICHILD) == WS_EX_MDICHILD) &&
((GetStyle() & WS_MAXIMIZE) == WS_MAXIMIZE))
{
RECT rc;
GetParent()->GetClientRect(&rc);
int cx = rc.right - rc.left;
int cy = rc.bottom - rc.top;
if (lpwndpos->cx > cx + m_rcBorders.left + m_rcBorders.right)
{
lpwndpos->cx = cx + m_rcBorders.left + m_rcBorders.right;
lpwndpos->cy = cy + m_rcBorders.top + m_rcBorders.bottom;
lpwndpos->x = -m_rcBorders.left;
lpwndpos->y = -m_rcBorders.top;
}
}
CSize szFrameRegion(lpwndpos->cx, lpwndpos->cy);
if (((lpwndpos->flags & SWP_NOSIZE) == 0) && (m_szFrameRegion != szFrameRegion))
{
if ((GetExStyle() & WS_EX_LAYOUTRTL) == 0)
UpdateFrameRegion(szFrameRegion);
}
}
示例2: SetWindowPos
TopWindow& TopWindow::TopMost(bool b, bool stay_top)
{
GuiLock __;
HWND hwnd;
if(hwnd = GetHWND())
SetWindowPos(hwnd, b ? HWND_TOPMOST : (stay_top ? HWND_NOTOPMOST : HWND_BOTTOM),
0,0,0,0,SWP_NOMOVE|SWP_NOSIZE );
return ExStyle(b ? GetExStyle() | WS_EX_TOPMOST : GetExStyle() & ~WS_EX_TOPMOST);
}
示例3: GetStyle
//-----------------------------------------------------------------------------
// Name: PreSubclassWindow
// Description: Makes some initialisations before the actuall
// subclassing occurs
//-----------------------------------------------------------------------------
void CCheckBox::PreSubclassWindow()
{
// text on left side?
//
unsigned style = GetStyle ();
unsigned ex_style = GetExStyle ();
if ((style & BS_LEFTTEXT) ||
(style & BS_RIGHTBUTTON) ||
(ex_style & WS_EX_RIGHT) )
m_bLeftText = true;
GetWindowText (m_text, 64); // get text
m_font = (HFONT) GetParent()->SendMessage (WM_GETFONT, 0, 0); // get font
if (!IsWindowEnabled ()) {
m_bDisabled = true;
m_nState = BOX_DISABLED_2;
}
// prevent any drawing by the control itself
//
ModifyStyle (0,BS_OWNERDRAW,0);
CButton::PreSubclassWindow();
}
示例4: switch
LRESULT QFrame::OnHtmlNotify( UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch(((NMHDR*)lParam)->code)
{
case HLN_DOCUMENT_COMPLETE:
{
if ( !_HasFlag(GetStyle(),WS_CHILD) )
{
WTL::CRect r;
GetWindowRect(&r);
// 非子窗口,调整窗体为合适大小
int nWidth = max(HTMLayoutGetMinWidth(m_hWnd), (UINT)r.Width());
WTL::CRect rcNew;
rcNew.SetRect(r.left, r.top,
nWidth + r.left,
r.top + max((UINT)r.Height(), HTMLayoutGetMinHeight(m_hWnd,nWidth)));
AdjustWindowRectEx( &rcNew, GetStyle(), FALSE, GetExStyle());
// 调整大小,位置不变
SetWindowPos(NULL, 0, 0, rcNew.Width(), rcNew.Height(), SWP_NOZORDER | SWP_NOMOVE);
size_min_ = rcNew.Size();
// 设置title
ctl_title_ = GetCtrl("#wc-title");
if (ctl_title_.is_valid())
{
SetWindowText(ctl_title_.GetText());
}
}
break;
}
}
return QView::OnHtmlNotify(uMsg, wParam, lParam);
}
示例5: GetSystemMetrics
template <class BASE> void CDialogMinTrayBtn<BASE>::MinTrayBtnUpdatePosAndSize()
{
bool bNrmWnd = (GetExStyle() & WS_EX_TOOLWINDOW) == 0;
int iXSz;
if (IsWindowsClassicStyle())
iXSz = GetSystemMetrics(bNrmWnd ? SM_CXSIZE : SM_CXSMSIZE) - 2;
else
// SM_SX*SIZE seems wrong when theming is on, as buttons are squares, we use Y size.
iXSz = GetSystemMetrics(bNrmWnd ? SM_CYSIZE : SM_CYSMSIZE) - 4;
m_MinTrayBtnSize = CSize(iXSz, GetSystemMetrics(bNrmWnd ? SM_CYSIZE : SM_CYSMSIZE) - 4);
DWORD dwStyle = GetStyle();
bool bSzFrm = (dwStyle & WS_THICKFRAME) != 0;
CRect rcWnd;
GetWindowRect(&rcWnd);
iXSz += CAPTION_BUTTONSPACE;
m_MinTrayBtnPos = CSize( rcWnd.Width() - ((iXSz + CAPTION_BUTTONSPACE) << 1) + GetSystemMetrics(bSzFrm ? SM_CXSIZEFRAME : SM_CXFIXEDFRAME),
CAPTION_BUTTONSPACE + GetSystemMetrics(bSzFrm ? SM_CYSIZEFRAME : SM_CYFIXEDFRAME) );
// If it isn't a toolbox and minimize/maximize buttons are present, include their size
if (bNrmWnd && (dwStyle & (WS_MINIMIZEBOX | WS_MAXIMIZEBOX)) != 0)
m_MinTrayBtnPos.x -= IsWindowsClassicStyle() ? ((iXSz << 1) + CAPTION_BUTTONSPACE) : ((iXSz + CAPTION_BUTTONSPACE) << 1);
}
示例6: ScreenToFrame
LRESULT CXTPSkinObjectFrame::HandleNcHitTest(CPoint point)
{
ScreenToFrame(&point);
DWORD dwStyle = GetStyle();
if ((dwStyle & WS_VSCROLL) && m_spi[SB_VERT].fVisible && ::PtInRect(&m_spi[SB_VERT].rc, point))
return (LRESULT)HTVSCROLL;
if ((dwStyle & WS_HSCROLL) &&m_spi[SB_HORZ].fVisible && ::PtInRect(&m_spi[SB_HORZ].rc, point))
return (LRESULT)HTHSCROLL;
if ((dwStyle & WS_VSCROLL) && m_spi[SB_VERT].fVisible && (dwStyle & WS_HSCROLL) && m_spi[SB_HORZ].fVisible && IsSizeBox())
{
CRect rcSizeGripper(m_spi[SB_HORZ].rc.right, m_spi[SB_VERT].rc.bottom,
m_spi[SB_VERT].rc.right, m_spi[SB_HORZ].rc.bottom);
if (rcSizeGripper.PtInRect(point))
return GetExStyle() & WS_EX_LAYOUTRTL ? HTBOTTOMLEFT : HTBOTTOMRIGHT;
}
CCaptionButton* pButtonHot = HitTestButton(point);
if (pButtonHot)
{
return pButtonHot->m_nHTCode;
}
return (LRESULT)HTNOWHERE;
}
示例7: rc
void CXTPSkinObjectFrame::ResizeFrame()
{
if (HasCaption() && m_pManager->IsEnabled())
{
CXTPWindowRect rc(this);
DWORD dwStyle = GetStyle();
DWORD dwExStyle = GetExStyle();
if ((m_pManager->GetApplyOptions() & xtpSkinApplyMetrics) && ((dwStyle & WS_CHILD) == 0))
{
CRect rcWindow(rc);
AdjustWindowRectEx(rcWindow, dwStyle, FALSE, dwExStyle);
CRect rcSysWindow(rc);
CXTPSkinManagerApiHook::AdjustWindowRectExOrig(rcSysWindow, dwStyle, FALSE, dwExStyle);
rc.bottom -= rcSysWindow.Height() - rcWindow.Height();
rc.right -= rcSysWindow.Width() - rcWindow.Width();
MoveWindow(rc, FALSE);
}
UpdateFrameRegion(rc.Size());
}
}
示例8: GetStyle
BOOL CSkinDialog::OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
{
DWORD dwStyle = GetStyle();
m_bHasMinBtn = dwStyle & WS_MINIMIZEBOX;
m_bHasMaxBtn = dwStyle & WS_MAXIMIZEBOX;
m_bHasCloseBtn = dwStyle & WS_CAPTION;
m_bSizeBox = dwStyle & WS_SIZEBOX;
dwStyle &= ~WS_CAPTION;
dwStyle &= ~DS_3DLOOK;
dwStyle &= ~DS_FIXEDSYS;
dwStyle |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
SetWindowLong(GWL_STYLE, dwStyle);
DWORD dwStyleEx = GetExStyle();
dwStyleEx = WS_EX_STATICEDGE | WS_EX_APPWINDOW;
SetWindowLong(GWL_EXSTYLE, dwStyleEx);
SetWindowPos(NULL, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
CalcTitleBarRect();
return TRUE;
}
示例9: SetLayeredWindowAttributes
BOOL CXTPPopupControl::SetLayeredWindowAttributes(int bAlpha)
{
if (bAlpha > 255)
bAlpha = 255;
if (bAlpha == m_nCurrentTransparency)
return TRUE;
m_nCurrentTransparency = bAlpha;
if (m_pfnSetLayeredWindowAttributes && (GetExStyle() & WS_EX_LAYERED))
{
if (m_bLayered)
{
BLENDFUNCTION bf;
bf.BlendOp = AC_SRC_OVER;
bf.BlendFlags = 0;
bf.SourceConstantAlpha = (BYTE)bAlpha;
bf.AlphaFormat = 0x01;
return m_pfnUpdateLayeredWindow(m_hWnd, (HDC)0, 0, 0, 0, 0, 0, &bf, 0x02);
}
//if pointer to transparent func - valid
return m_pfnSetLayeredWindowAttributes(m_hWnd, 0x00, (BYTE)bAlpha, LWA_ALPHA);
}
return FALSE;
}
示例10: UpdateClientEdge
BOOL CMDIChildWnd::UpdateClientEdge(LPRECT lpRect)
{
CMDIFrameWnd* pFrameWnd=GetMDIFrame();
HWND hChild=pFrameWnd->MDIGetActive();
if (hChild==NULL || hChild==m_hWnd)
{
DWORD dwStyle=::GetWindowLong(pFrameWnd->m_hWndMDIClient,GWL_EXSTYLE);
DWORD dwNewStyle=dwStyle;
if (hChild!=NULL && !(GetExStyle()&WS_EX_CLIENTEDGE) && (GetStyle()&WS_MAXIMIZE))
dwNewStyle&=~(WS_EX_CLIENTEDGE);
else
dwNewStyle|=WS_EX_CLIENTEDGE;
if (dwStyle!=dwNewStyle)
{
::RedrawWindow(pFrameWnd->m_hWndMDIClient,NULL,NULL,RDW_INVALIDATE|RDW_ALLCHILDREN);
::SetWindowLong(pFrameWnd->m_hWndMDIClient,GWL_EXSTYLE,dwNewStyle);
::SetWindowPos(pFrameWnd->m_hWndMDIClient,NULL,0,0,0,0,SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOCOPYBITS);
if (lpRect!=NULL)
::GetClientRect(pFrameWnd->m_hWndMDIClient,lpRect);
return TRUE;
}
}
return FALSE;
}
示例11: GetExStyle
void CView::CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType)
{
if (nAdjustType != 0)
{
// allow for special client-edge style
::AdjustWindowRectEx(lpClientRect, 0, FALSE, GetExStyle());
// default behavior for in-place editing handles scrollbars
DWORD dwStyle = GetStyle();
if (dwStyle & WS_VSCROLL)
{
int nAdjust = afxData.cxVScroll;
if (dwStyle & WS_BORDER)
nAdjust -= CX_BORDER;
lpClientRect->right += nAdjust;
}
if (dwStyle & WS_HSCROLL)
{
int nAdjust = afxData.cyHScroll;
if (dwStyle & WS_BORDER)
nAdjust -= CY_BORDER;
lpClientRect->bottom += nAdjust;
}
return;
}
// call default to place borders outside of client rect
CWnd::CalcWindowRect(lpClientRect, nAdjustType);
}
示例12: OnInitDialog
//*************************************************************************************
BOOL CBCGPDialog::OnInitDialog()
{
if (AfxGetMainWnd() == this)
{
globalData.m_bIsRTL = (GetExStyle() & WS_EX_LAYOUTRTL);
CBCGPToolBarImages::EnableRTL(globalData.m_bIsRTL);
}
CDialog::OnInitDialog();
m_Impl.m_bHasBorder = (GetStyle () & WS_BORDER) != 0;
m_Impl.m_bHasCaption = (GetStyle() & WS_CAPTION) != 0;
if (IsVisualManagerStyle ())
{
m_Impl.EnableVisualManagerStyle (TRUE, IsVisualManagerNCArea ());
}
if (m_Impl.HasAeroMargins ())
{
m_Impl.EnableAero (m_Impl.m_AeroMargins);
}
if (IsBackstageMode())
{
m_Impl.EnableBackstageMode();
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例13: GetSystemMetrics
void CSkinDialog::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
{
// TODO: Add your message handler code here and/or call default
if(CImgSkin::IsLoaded() && !((GetStyle()&WS_CHILD)))
{
int cyFrame = GetSystemMetrics(SM_CYFRAME);
int cyBorder = GetSystemMetrics(SM_CYBORDER);
int cxBorder = GetSystemMetrics(SM_CXBORDER);
if(GetExStyle()&WS_EX_TOOLWINDOW)
{
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(
SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS),
&ncm,
0);
lpncsp->rgrc[0].top -= cyFrame + cyBorder - m_mapRect["TitleLeftActive"].Height;
}
else
//lpncsp->rgrc[0].top -= cyFrame - m_mapRect["TitleLeftActive"].Height - ((GetStyle()&DS_MODALFRAME)?cyBorder:1);
lpncsp->rgrc[0].top -= cyFrame - m_mapRect["TitleLeftActive"].Height - cyBorder;
lpncsp->rgrc[0].left -= cyFrame - m_mapRect["BorderLeftActive"].Width- cxBorder;//((GetStyle()&DS_MODALFRAME)?cxBorder:0);
lpncsp->rgrc[0].right += cyFrame - m_mapRect["BorderRightActive"].Width-cxBorder-cxBorder;//((GetStyle()&DS_MODALFRAME)?cxBorder:0);
lpncsp->rgrc[0].bottom += m_mapRect["BorderBot"].Height;// -= cyFrame - m_mapRect["BorderBotActive"].Height-cyBorder-cyBorder;//((GetStyle()&DS_MODALFRAME)?cyBorder:0);
}
CXTPDialog::OnNcCalcSize(bCalcValidRects, lpncsp);
}
示例14: GetExStyle
void CDownloadMonitorDlg::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
{
DWORD nCheck = ( GetExStyle() & WS_EX_TOPMOST ) ? MF_CHECKED : MF_UNCHECKED;
pPopupMenu->CheckMenuItem( SC_NEXTWINDOW, MF_BYCOMMAND|nCheck );
CSkinDialog::OnInitMenuPopup( pPopupMenu, nIndex, bSysMenu );
}
示例15: DefWindowProc
LRESULT CXTPSkinObjectFrame::OnPrint(WPARAM wParam, LPARAM lParam)
{
LRESULT lResult = TRUE;
if (lParam != PRF_NONCLIENT)
{
m_bLockFrameDraw++;
lResult = DefWindowProc(WM_PRINT, wParam, lParam);
m_bLockFrameDraw--;
}
if (lParam & PRF_NONCLIENT)
{
if (m_spi[SB_VERT].fVisible) m_spi[SB_VERT].fVisible = GetStyle() & WS_VSCROLL;
if (m_spi[SB_HORZ].fVisible) m_spi[SB_HORZ].fVisible = GetStyle() & WS_HSCROLL;
CDC* pDC = CDC::FromHandle((HDC)wParam);
if ((GetExStyle() & WS_EX_LAYOUTRTL) && !XTPDrawHelpers()->IsContextRTL(pDC))
XTPDrawHelpers()->SetContextRTL(pDC, 1);
DrawFrame(pDC);
}
return lResult;
}