本文整理匯總了C++中BeginDeferWindowPos函數的典型用法代碼示例。如果您正苦於以下問題:C++ BeginDeferWindowPos函數的具體用法?C++ BeginDeferWindowPos怎麽用?C++ BeginDeferWindowPos使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BeginDeferWindowPos函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: WriteLog
//隱藏列表按鈕
void CGameFrameDlg::OnBnClickedHideList()
{
CString strFile,strTemp;
CTime tmCur = CTime::GetCurrentTime();
CString strTime = tmCur.Format("%m%d");
strFile.Format("log\\%sOnBnClickedHideList.log",strTime);
strTemp.Format("%s", "OnBnClickedHideList()");
WriteLog(strFile, strTemp);
static bool bHideList=true;
int cx,cy;
CRect rect;
GetClientRect(rect);
cx=rect.Width();
cy=rect.Height();
if(bHideList)
{
if (m_VorSplitter.GetSafeHwnd())
{
UINT uSplitPos=cx-12;
// SafeMoveWindow(&m_VorSplitter,uSplitPos,GetTitleHight(),SPLIT_WIDE,cy-GetTitleHight());
HDWP hDwp=BeginDeferWindowPos(32);
DeferWindowPos(hDwp,m_VorSplitter,NULL,uSplitPos, 0,SPLIT_WIDE,cy, uFlags);
EndDeferWindowPos(hDwp);
RectifyControl(cx,cy);
strTemp.Format("bHideList cx=%d,cy=%d", cx,cy);
WriteLog(strFile, strTemp);
// FixControlStation(cx,cy);
}
// m_BtExpression.ShowWindow(SW_HIDE);
// m_BtSend.ShowWindow(SW_HIDE);
}
else
{
if (m_VorSplitter.GetSafeHwnd())
{
//UINT uSplitPos=__max(cx*2/3-SPLIT_WIDE,350);
//UINT uSplitPos=__max(cx*17/24-SPLIT_WIDE,350);
UINT uSplitPos = cx - INFO_WIDTH - BUTTON_WIDE - 1;
// SafeMoveWindow(&m_VorSplitter,uSplitPos,GetTitleHight(),SPLIT_WIDE,cy-GetTitleHight());
HDWP hDwp=BeginDeferWindowPos(32);
DeferWindowPos(hDwp,m_VorSplitter,NULL,uSplitPos,0,SPLIT_WIDE,cy, uFlags);
EndDeferWindowPos(hDwp);
m_VorSplitter.InitSplitBar(cx*3/5,cx-250,false);
// FixControlStation(cx,cy);
RectifyControl(cx,cy);
strTemp.Format("cx=%d,cy=%d", cx,cy);
WriteLog(strFile, strTemp);
}
// m_BtExpression.ShowWindow(SW_SHOW);
// m_BtSend.ShowWindow(SW_SHOW);
}
bHideList=!bHideList;
return;
}
示例2: GetClientRect
void SPLASH::Show()
{
//get size of hSplashWnd (width and height)
int x,y;
int pwidth,pheight;
int tx,ty;
HDWP windefer;
RECT rect,prect;
GetClientRect(hSplashWnd,&rect);
x=rect.right;y=rect.bottom;
//get parent screen coordinates
GetWindowRect(this->hParentWindow,&prect);
//center splash window on parent window
pwidth=prect.right-prect.left;
pheight=prect.bottom - prect.top;
tx=(pwidth/2) - (x/2);
ty=(pheight/2) - (y/2);
tx+=prect.left;
ty+=prect.top;
windefer=BeginDeferWindowPos(1);
DeferWindowPos(windefer,hSplashWnd,HWND_NOTOPMOST,tx,ty,50,50,SWP_NOSIZE|SWP_SHOWWINDOW|SWP_NOZORDER);
EndDeferWindowPos(windefer);
ShowWindow(hSplashWnd,SW_SHOWNORMAL);
UpdateWindow(hSplashWnd);
this->SHOWING = TRUE;
}
示例3: GetClientRect
void CChatWnd::OnSize(UINT nType, int cx, int cy)
{
if ( nType != 1982 ) CPanelWnd::OnSize( nType, cx, cy );
CRect rc;
GetClientRect( &rc );
if ( rc.Width() < m_nUsersSize + SPLIT_SIZE )
{
m_nUsersSize = max( 0, rc.Width() - SPLIT_SIZE );
}
HDWP hDWP = BeginDeferWindowPos( 4 );
DeferWindowPos( hDWP, m_wndView, NULL, rc.left, rc.top,
rc.Width() - m_nUsersSize - SPLIT_SIZE, rc.Height() - TOOLBAR_HEIGHT - EDIT_HEIGHT, SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndUsers, NULL, rc.left + rc.Width() - m_nUsersSize, rc.top,
m_nUsersSize, rc.Height() - TOOLBAR_HEIGHT - EDIT_HEIGHT, SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndToolBar, NULL,
rc.left, rc.bottom - TOOLBAR_HEIGHT - EDIT_HEIGHT,
rc.Width(), TOOLBAR_HEIGHT, SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndEdit, NULL, rc.left, rc.bottom - EDIT_HEIGHT,
rc.Width(), EDIT_HEIGHT, SWP_NOZORDER );
EndDeferWindowPos( hDWP );
m_wndUsers.SetColumnWidth( 0, m_nUsersSize - GetSystemMetrics( SM_CXVSCROLL ) );
}
示例4: BeginDeferWindowPos
void CSearchAdvancedBox::OnSize(UINT nType, int cx, int cy)
{
CTaskBox::OnSize( nType, cx, cy );
HDWP hDWP = BeginDeferWindowPos( 3 );
if ( m_wndCheckBoxG2.m_hWnd != NULL )
DeferWindowPos( hDWP, m_wndCheckBoxG2, NULL, BOX_MARGIN + 21, 28,
( cx - BOX_MARGIN * 3 ) / 2 - 20, 14,
SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
if ( m_wndCheckBoxG1.m_hWnd != NULL )
DeferWindowPos( hDWP, m_wndCheckBoxG1, NULL, BOX_MARGIN + 21, 48,
( cx - BOX_MARGIN * 3 ) / 2 - 20, 14,
SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
if ( m_wndCheckBoxED2K.m_hWnd != NULL )
DeferWindowPos( hDWP, m_wndCheckBoxED2K, NULL, ( cx / 2 ) + BOX_MARGIN / 2 + 26, 28,
( cx - BOX_MARGIN * 3 ) / 2 - 20, 14,
SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
if ( m_wndCheckBoxDC.m_hWnd != NULL )
DeferWindowPos( hDWP, m_wndCheckBoxDC, NULL, ( cx / 2 ) + BOX_MARGIN / 2 + 26, 48,
( cx - BOX_MARGIN * 3 ) / 2 - 20, 14,
SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
if ( m_wndSizeMin.m_hWnd != NULL )
{
int width = ( cx - BOX_MARGIN * 6 ) / 2;
DeferWindowPos( hDWP, m_wndSizeMin, NULL, BOX_MARGIN, 81,
width, 219, SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndSizeMax, NULL, cx - BOX_MARGIN - width, 81,
width, 219, SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndSizeMinMax, NULL, BOX_MARGIN + width, 81 + 2,
BOX_MARGIN * 4, 18, SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
}
EndDeferWindowPos( hDWP );
}
示例5: GetDlgItem
void ipod_browse_photo_dialog::on_size (HWND wnd, unsigned width, unsigned height)
{
HWND wnd_close = GetDlgItem(wnd, IDCANCEL);
HWND wnd_next = GetDlgItem(wnd, IDC_NEXT);
HWND wnd_last = GetDlgItem(wnd, IDC_LAST);
HWND wnd_prev = GetDlgItem(wnd, IDC_PREVIOUS);
HWND wnd_nextf = GetDlgItem(wnd, IDC_NEXT_FORMAT);
HWND wnd_prevf = GetDlgItem(wnd, IDC_PREVIOUS_FORMAT);
HDWP dwp = BeginDeferWindowPos(6);
RECT rc_close, rc_next, rc_next_format, rc_prev, rc_prev_format, rc_last;
GetWindowRect(wnd_close, &rc_close);
GetRelativeRect(wnd_next, wnd, &rc_next);
GetRelativeRect(wnd_last, wnd, &rc_last);
GetRelativeRect(wnd_nextf, wnd, &rc_next_format);
GetRelativeRect(wnd_prev, wnd, &rc_prev);
GetRelativeRect(wnd_prevf, wnd, &rc_prev_format);
unsigned cy_close = rc_close.bottom - rc_close.top;
unsigned cx_close = rc_close.right - rc_close.left;
dwp = DeferWindowPos(dwp, m_viewer.get_wnd(), NULL, 0, 0, width, height-cy_close-2, SWP_NOZORDER);
dwp = DeferWindowPos(dwp, wnd_close, NULL, width-cx_close, height-cy_close, cx_close, cy_close, SWP_NOZORDER|SWP_NOSIZE);
int cx = width-cx_close-2-rc_next.right+rc_next.left;
dwp = DeferWindowPos(dwp, wnd_last, NULL, cx, height-cy_close, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
dwp = DeferWindowPos(dwp, wnd_next, NULL, cx -= (rc_last.right-rc_last.left +2), height-cy_close, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
dwp = DeferWindowPos(dwp, wnd_prev, NULL, cx -= (rc_prev.right-rc_prev.left +2), height-cy_close, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
dwp = DeferWindowPos(dwp, wnd_nextf, NULL, cx -= (rc_next_format.right-rc_next_format.left + 2), height-cy_close,0, 0, SWP_NOZORDER|SWP_NOSIZE);
dwp = DeferWindowPos(dwp, wnd_prevf, NULL, cx -= (rc_prev_format.right-rc_prev_format.left + 2), height-cy_close, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
EndDeferWindowPos(dwp);
}
示例6: BeginDeferWindowPos
void CImportPatchDlg::DoSize(int delta)
{
this->RemoveAllAnchors();
auto hdwp = BeginDeferWindowPos(6);
hdwp = CSplitterControl::ChangeRect(hdwp, GetDlgItem(IDC_LIST_PATCH), 0, 0, 0, delta);
hdwp = CSplitterControl::ChangeRect(hdwp, GetDlgItem(IDC_AM_TAB), 0, delta, 0, 0);
hdwp = CSplitterControl::ChangeRect(hdwp, GetDlgItem(IDC_CHECK_3WAY), 0, delta, 0, delta);
hdwp = CSplitterControl::ChangeRect(hdwp, GetDlgItem(IDC_CHECK_IGNORE_SPACE), 0, delta, 0, delta);
hdwp = CSplitterControl::ChangeRect(hdwp, GetDlgItem(IDC_SIGN_OFF), 0, delta, 0, delta);
hdwp = CSplitterControl::ChangeRect(hdwp, GetDlgItem(IDC_KEEP_CR), 0, delta, 0, delta);
EndDeferWindowPos(hdwp);
this->AddAmAnchor();
// adjust the minimum size of the dialog to prevent the resizing from
// moving the list control too far down.
CRect rcLogMsg;
m_cList.GetClientRect(rcLogMsg);
SetMinTrackSize(CSize(m_DlgOrigRect.Width(), m_DlgOrigRect.Height()-m_PatchListOrigRect.Height()+rcLogMsg.Height()));
SetSplitterRange();
// m_CommitList.Invalidate();
// GetDlgItem(IDC_LOGMESSAGE)->Invalidate();
this->m_ctrlTabCtrl.Invalidate();
}
示例7: childresize_resize
void childresize_resize(HWND hwndDlg, ChildWndResizeItem *list, int num)
{
RECT r;
GetClientRect(hwndDlg,&r);
int x;
HDWP hdwp=BeginDeferWindowPos(num);
for (x = 0; x < num; x ++) if (list[x].type&0xf0000) {
RECT r2;
if (list[x].type&0xF000) r2.left=r.right-list[x].rinfo.left;
else r2.left=list[x].rinfo.left;
if (list[x].type&0x0F00) r2.top=r.bottom-list[x].rinfo.top;
else r2.top=list[x].rinfo.top;
if (list[x].type&0x00F0) r2.right=r.right-list[x].rinfo.right;
else r2.right=list[x].rinfo.right;
if (list[x].type&0x000F) r2.bottom=r.bottom-list[x].rinfo.bottom;
else r2.bottom=list[x].rinfo.bottom;
HWND h=GetDlgItem(hwndDlg,list[x].id);
DeferWindowPos(hdwp, h, NULL, r2.left,r2.top,r2.right-r2.left,r2.bottom-r2.top, SWP_NOZORDER|SWP_NOACTIVATE);
};
EndDeferWindowPos(hdwp);
}
示例8: LayoutTransfers
static void LayoutTransfers(HWND hwnd, struct TFtPageData *dat)
{
int top = 0;
RECT rc;
GetClientRect(hwnd, &rc);
dat->scrollPos = GetScrollPos(hwnd, SB_VERT);
dat->height = rc.bottom - rc.top;
if (dat->wnds->realCount) {
HDWP hdwp = BeginDeferWindowPos(dat->wnds->realCount);
top -= dat->scrollPos;
for (int i = 0; i < dat->wnds->realCount; ++i) {
int height = dat->wnds->items[i]->rc.bottom - dat->wnds->items[i]->rc.top;
hdwp = DeferWindowPos(hdwp, dat->wnds->items[i]->hwnd, NULL, 0, top, rc.right, height, SWP_NOZORDER);
top += height;
}
top += dat->scrollPos;
EndDeferWindowPos(hdwp);
}
dat->dataHeight = top;
SCROLLINFO si = { 0 };
si.cbSize = sizeof(si);
si.fMask = SIF_DISABLENOSCROLL | SIF_PAGE | SIF_RANGE;
si.nPage = dat->height;
si.nMin = 0;
si.nMax = dat->dataHeight;
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
}
示例9: RectifyControl
//調整控件
VOID CWndUserInfoCtrl::RectifyControl(INT nWidth, INT nHeight)
{
//設置區域
m_rcUnderWrite.SetRect(127,52,nWidth-13,72);
//變量定義
HDWP hDwp=BeginDeferWindowPos(64);
UINT uFlags=SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOSIZE;
//按鈕大小
CRect rcButton;
m_btUserInfo1.GetWindowRect(&rcButton);
//間隔定義
UINT nSpace=14;
UINT nStartPos=18;
//調整按鈕
DeferWindowPos(hDwp,m_btUserInfoSet,NULL,69,15,0,0,uFlags);
DeferWindowPos(hDwp,m_btUserInfo1,NULL,nStartPos,nHeight-rcButton.Height()-9,0,0,uFlags);
DeferWindowPos(hDwp,m_btUserInfo2,NULL,nStartPos+rcButton.Width()+nSpace,nHeight-rcButton.Height()-9,0,0,uFlags);
DeferWindowPos(hDwp,m_btUserInfo3,NULL,nStartPos+(rcButton.Width()+nSpace)*2,nHeight-rcButton.Height()-9,0,0,uFlags);
//結束調整
EndDeferWindowPos(hDwp);
return;
}
示例10: GetClientRect
void CPlayerWnd::OnSize(UINT nType, int cx, int cy)
{
if ( nType != SIZE_INTERNAL ) CChildWnd::OnSize( nType, cx, cy );
CRect rc;
GetClientRect( &rc );
if ( rc.Width() < 32 || rc.Height() < 32 ) return;
HDWP hDWP = BeginDeferWindowPos( 3 );
DeferWindowPos( hDWP, wndPanel.GetSafeHwnd(), NULL,
rc.left, rc.top, PANEL_WIDTH, rc.Height(), SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndHeaderBar.GetSafeHwnd(), NULL,
rc.left + PANEL_WIDTH, rc.top, rc.Width() - PANEL_WIDTH, BAR_HEIGHT, SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndBottom.GetSafeHwnd(), NULL,
rc.left + PANEL_WIDTH, rc.bottom - BAR_HEIGHT, rc.Width() - PANEL_WIDTH, BAR_HEIGHT, SWP_NOZORDER );
EndDeferWindowPos( hDWP );
if ( ! m_bPlaying ) return;
CRect rect(
rc.left + PANEL_WIDTH, rc.top + BAR_HEIGHT,
rc.right, rc.bottom - BAR_HEIGHT );
m_wndPlayer.PutIntoWindow( m_hWnd, rect );
}
示例11: rcNew
void CMsgSignalSelect::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
int iXDelta = cx - m_szInitial.cx;
int iYDelta = cy - m_szInitial.cy;
HDWP hDefer = NULL;
for (MovingChildren::iterator p = m_MovingChildren.begin(); p != m_MovingChildren.end(); ++p)
{
if (p->m_hWnd != NULL)
{
CRect rcNew(p->m_rcInitial);
rcNew.OffsetRect(int(iXDelta * p->m_dXMoveFrac), int(iYDelta * p->m_dYMoveFrac));
rcNew.right += int(iXDelta * p->m_dXSizeFrac);
rcNew.bottom += int(iYDelta * p->m_dYSizeFrac);
if (hDefer == NULL)
{
hDefer = BeginDeferWindowPos(m_MovingChildren.size());
}
UINT uFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER;
if ((p->m_dXSizeFrac != 0.0) || (p->m_dYSizeFrac != 0.0))
{
uFlags |= SWP_NOCOPYBITS;
}
DeferWindowPos(hDefer, p->m_hWnd, NULL, rcNew.left, rcNew.top, rcNew.Width(), rcNew.Height(), uFlags);
}
}
if (hDefer != NULL)
{
EndDeferWindowPos(hDefer);
}
//if (m_hGripper != NULL)
// ::ShowWindow(m_hGripper, (nType == SIZE_MAXIMIZED) ? SW_HIDE : SW_SHOW);
}
示例12: rcNew
void CBaseDialog::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
int iXDelta = cx - m_szInitial.cx;
int iYDelta = cy - m_szInitial.cy;
HDWP hDefer = NULL;
for (MovingChildren::iterator p = m_MovingChildren.begin(); p != m_MovingChildren.end(); ++p)
{
if (p->m_hWnd != NULL)
{
CRect rcNew(p->m_rcInitial);
rcNew.OffsetRect(int(iXDelta * p->m_dXMoveFrac), int(iYDelta * p->m_dYMoveFrac));
rcNew.right += int(iXDelta * p->m_dXSizeFrac);
rcNew.bottom += int(iYDelta * p->m_dYSizeFrac);
if (hDefer == NULL)
hDefer = BeginDeferWindowPos(m_MovingChildren.size());
UINT uFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER;
if ((p->m_dXSizeFrac != 0.0) || (p->m_dYSizeFrac != 0.0))
uFlags |= SWP_NOCOPYBITS;
DeferWindowPos(hDefer, p->m_hWnd, NULL, rcNew.left, rcNew.top, rcNew.Width(), rcNew.Height(), uFlags);
}
}
if (hDefer != NULL)
EndDeferWindowPos(hDefer);
}
示例13: SimpleCEFDLL_ResizeBrowser
//We must call in WM_SIZE event, hWnd will be the our window handle
void SimpleCEFDLL_ResizeBrowser( HWND hWnd )
{
//Get the CEF handle
CefRefPtr<zSimpleCefHandler> simpleCefHandler;
if( !g_App->GetCEFHandler( hWnd, simpleCefHandler ) )
return;
if( !simpleCefHandler.get() )
return;
if( !simpleCefHandler->GetBrowser().get() )
return;
if( !simpleCefHandler->GetBrowser()->GetHost().get() )
return;
CefWindowHandle hWndBrowser = simpleCefHandler->GetBrowser()->GetHost()->GetWindowHandle();
if( hWndBrowser )
{
//Get the size of our window
RECT rect;
GetClientRect( hWnd, &rect );
//Set the size to the browser
HDWP hdwp = BeginDeferWindowPos (1);
hdwp = DeferWindowPos (hdwp, hWndBrowser, NULL,rect.left,
rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);
EndDeferWindowPos (hdwp);
}
}
示例14: GetClientRect
void TFrameWindow::size()
{
RECT rt;
HDWP hdwp;
int n = 0, bottom_extra = 0;
if (m_status) n++;
if (m_client) n++;
if (n==0) return;
GetClientRect(m_hwnd,&rt);
hdwp = BeginDeferWindowPos(n);
if (m_status) {
DeferWindowPos(hdwp,m_status,NULL,0,0, //???
rt.right - rt.left, 20, SWP_NOZORDER);
bottom_extra = 20;
}
if (m_client)
DeferWindowPos(hdwp,m_client->handle(),NULL,0,0,
rt.right - rt.left, rt.bottom-rt.top - bottom_extra,
SWP_NOZORDER | SWP_NOMOVE);
EndDeferWindowPos(hdwp);
}
示例15: WC_D
void CBaseDialog::OnSize(UINT/* nType*/, int cx, int cy)
{
HRESULT hRes = S_OK;
HDWP hdwp = NULL;
WC_D(hdwp, BeginDeferWindowPos(1));
if (hdwp)
{
int iHeight = GetStatusHeight();
int iNewCY = cy - iHeight;
RECT rcStatus = { 0 };
::GetClientRect(m_hWnd, &rcStatus);
if (rcStatus.bottom - rcStatus.top > iHeight)
{
rcStatus.top = rcStatus.bottom - iHeight;
}
// Tell the status bar it needs repainting
::InvalidateRect(m_hWnd, &rcStatus, false);
if (m_lpFakeSplitter && m_lpFakeSplitter->m_hWnd)
{
DeferWindowPos(hdwp, m_lpFakeSplitter->m_hWnd, NULL, 0, 0, cx, iNewCY, SWP_NOZORDER);
}
WC_B(EndDeferWindowPos(hdwp));
}
} // CBaseDialog::OnSize