本文整理匯總了C++中EndDeferWindowPos函數的典型用法代碼示例。如果您正苦於以下問題:C++ EndDeferWindowPos函數的具體用法?C++ EndDeferWindowPos怎麽用?C++ EndDeferWindowPos使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EndDeferWindowPos函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: SetWindowText
//初始化函數
BOOL CChessManual::OnInitDialog()
{
__super::OnInitDialog();
//設置標題
SetWindowText(TEXT("中國象棋棋譜:"));
//移動窗口
CImageHandle ImageHandeBack(&m_ImageBack);
SetWindowPos(NULL,0,0,m_ImageBack.GetWidth(),m_ImageBack.GetHeight(),SWP_NOZORDER|SWP_NOMOVE);
//獲取大小
CRect rcClient;
GetClientRect(&rcClient);
//創建控件
const CSize & BoradSize=m_ChessBorad.GetChessBoradSize();
m_ChessBorad.Create(NULL,NULL,WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,10);
//設置按鈕
HINSTANCE hInstance=AfxGetInstanceHandle();
m_btOpen.SetButtonImage(IDB_MANUAL_BT_OPEN,hInstance,false);
m_btReLoad.SetButtonImage(IDB_MANUAL_BT_RELOAD,hInstance,false);
m_btFirst.SetButtonImage(IDB_MANUAL_BT_FIRST,hInstance,false);
m_btBefore.SetButtonImage(IDB_MANUAL_BT_BEFORE,hInstance,false);
m_btNext.SetButtonImage(IDB_MANUAL_BT_NEXT,hInstance,false);
m_btLast.SetButtonImage(IDB_MANUAL_BT_LAST,hInstance,false);
m_btCancel.SetButtonImage(IDB_MANUAL_BT_CLOSE,hInstance,false);
//計算位置
CRect rcButton;
m_btOpen.GetWindowRect(&rcButton);
int nXButtonSpace=(rcClient.Width()-rcButton.Width()*7)/8;
int nYPos=rcClient.Height()-rcButton.Height()-30;
//移動按鈕
HDWP hDwp=BeginDeferWindowPos(7);
const UINT uFlags=SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOCOPYBITS|SWP_NOSIZE;
DeferWindowPos(hDwp,m_btOpen,NULL,nXButtonSpace,nYPos,0,0,uFlags);
DeferWindowPos(hDwp,m_btReLoad,NULL,nXButtonSpace*2+rcButton.Width(),nYPos,0,0,uFlags);
DeferWindowPos(hDwp,m_btFirst,NULL,nXButtonSpace*3+rcButton.Width()*2,nYPos,0,0,uFlags);
DeferWindowPos(hDwp,m_btBefore,NULL,nXButtonSpace*4+rcButton.Width()*3,nYPos,0,0,uFlags);
DeferWindowPos(hDwp,m_btNext,NULL,nXButtonSpace*5+rcButton.Width()*4,nYPos,0,0,uFlags);
DeferWindowPos(hDwp,m_btLast,NULL,nXButtonSpace*6+rcButton.Width()*5,nYPos,0,0,uFlags);
DeferWindowPos(hDwp,m_btCancel,NULL,nXButtonSpace*7+rcButton.Width()*6,nYPos,0,0,uFlags);
EndDeferWindowPos(hDwp);
//移動控件
m_ChessBorad.MoveWindow(29,29,BoradSize.cx,BoradSize.cy);
m_ManualList.MoveWindow(BoradSize.cx+37,32,rcClient.Width()-BoradSize.cx-66,BoradSize.cy-8);
//更新棋譜
OnReLoad();
return TRUE;
}
示例2: EtwDiskNetworkLayoutGraphs
VOID EtwDiskNetworkLayoutGraphs(
_In_ PET_DISKNET_CONTEXT Context
)
{
HDWP deferHandle;
RECT clientRect;
RECT panelRect;
RECT margin = { PH_SCALE_DPI(13), PH_SCALE_DPI(13), PH_SCALE_DPI(13), PH_SCALE_DPI(13) };
RECT innerMargin = { PH_SCALE_DPI(10), PH_SCALE_DPI(20), PH_SCALE_DPI(10), PH_SCALE_DPI(10) };
LONG between = PH_SCALE_DPI(3);
ULONG graphWidth;
ULONG graphHeight;
PhLayoutManagerLayout(&Context->LayoutManager);
Context->DiskGraphState.Valid = FALSE;
Context->NetworkGraphState.Valid = FALSE;
GetClientRect(Context->WindowHandle, &clientRect);
// Limit the rectangle bottom to the top of the panel.
GetWindowRect(Context->PanelHandle, &panelRect);
MapWindowPoints(NULL, Context->WindowHandle, (PPOINT)&panelRect, 2);
clientRect.bottom = panelRect.top + 10; // +10 removing extra spacing
graphWidth = clientRect.right - margin.left - margin.right;
graphHeight = (clientRect.bottom - margin.top - margin.bottom - between * 2) / 2;
deferHandle = BeginDeferWindowPos(4);
deferHandle = DeferWindowPos(deferHandle, Context->DiskGroupBox, NULL, margin.left, margin.top, graphWidth, graphHeight, SWP_NOACTIVATE | SWP_NOZORDER);
deferHandle = DeferWindowPos(
deferHandle,
Context->DiskGraphHandle,
NULL,
margin.left + innerMargin.left,
margin.top + innerMargin.top,
graphWidth - innerMargin.left - innerMargin.right,
graphHeight - innerMargin.top - innerMargin.bottom,
SWP_NOACTIVATE | SWP_NOZORDER
);
deferHandle = DeferWindowPos(deferHandle, Context->NetworkGroupBox, NULL, margin.left, margin.top + graphHeight + between, graphWidth, graphHeight, SWP_NOACTIVATE | SWP_NOZORDER);
deferHandle = DeferWindowPos(
deferHandle,
Context->NetworkGraphHandle,
NULL,
margin.left + innerMargin.left,
margin.top + graphHeight + between + innerMargin.top,
graphWidth - innerMargin.left - innerMargin.right,
graphHeight - innerMargin.top - innerMargin.bottom,
SWP_NOACTIVATE | SWP_NOZORDER
);
EndDeferWindowPos(deferHandle);
}
示例3: SetRadius
void CTestClockDlg::OnSize(UINT nType, int cx, int cy)
{
if (m_bInit == TRUE)
{
SetRadius(cx, cy);
SetCenterPoint(cx, cy);
SetGradationPoints();
m_nHourGradSize = MulDiv(DEFAULT_HOUR_GRAD_SIZE, m_nRadius, m_nRadiusOrg);
m_nMinuteGradSize = MulDiv(DEFAULT_MINUTE_GRAD_SIZE, m_nRadius, m_nRadiusOrg);
m_nSecondHandSize = MulDiv(DEFAULT_SECOND_HAND_SIZE, m_nRadius, m_nRadiusOrg);
m_nCenterPointSize = MulDiv(DEFAULT_CENTER_POINT_SIZE, m_nRadius, m_nRadiusOrg);
SetClockHandPoints();
// Set position of the 'OK' and 'Cancel' button
CRect rect;
CRect rectBtnOk;
CRect rectBtnOkToMove;
CRect rectBtnCancel;
CRect rectBtnCancelToMove;
GetClientRect(rect);
ClientToScreen(rect);
m_btnOk.GetWindowRect(rectBtnOk);
ScreenToClient(rectBtnOk);
m_btnCancel.GetWindowRect(rectBtnCancel);
ScreenToClient(rectBtnCancel);
rectBtnOkToMove.right = rect.Width() - m_marginBtnOk.right;
rectBtnOkToMove.bottom = rect.Height() - m_marginBtnOk.bottom;
rectBtnOkToMove.left = rectBtnOkToMove.right - rectBtnOk.Width();
rectBtnOkToMove.top = rectBtnOkToMove.bottom - rectBtnOk.Height();
rectBtnCancelToMove.right = rect.Width() - m_marginBtnCancel.right;
rectBtnCancelToMove.bottom = rect.Height() - m_marginBtnCancel.bottom;
rectBtnCancelToMove.left = rectBtnCancelToMove.right - rectBtnCancel.Width();
rectBtnCancelToMove.top = rectBtnCancelToMove.bottom - rectBtnCancel.Height();
HDWP hdwp = ::BeginDeferWindowPos(2);
if (hdwp)
hdwp = DeferWindowPos(hdwp, m_btnOk.GetSafeHwnd(), HWND_TOP, rectBtnOkToMove.left, rectBtnOkToMove.top, rectBtnOkToMove.Width(), rectBtnOkToMove.Height(), SWP_NOZORDER);
if (hdwp)
DeferWindowPos(hdwp, m_btnCancel.GetSafeHwnd(), HWND_TOP, rectBtnCancelToMove.left, rectBtnCancelToMove.top, rectBtnCancelToMove.Width(), rectBtnCancelToMove.Height(), SWP_NOZORDER);
if (hdwp)
EndDeferWindowPos(hdwp);
Invalidate();
UpdateWindow();
}
CDialog::OnSize(nType, cx, cy);
}
示例4: GetClientRect
void
CConsoleWindow::Layout()
{
RECT rc;
GetClientRect(&rc);
HDWP hdwp = BeginDeferWindowPos(1);
hdwp = m_LoggerConsole.DeferWindowPos(hdwp, NULL, 0, 0, rc.right, rc.bottom, SWP_NOZORDER);
EndDeferWindowPos(hdwp);
}
示例5: ResizeWnd
static void ResizeWnd(int cx, int cy)
{
HDWP hdwp = BeginDeferWindowPos(2);
RECT rt = {0, 0, cx, cy};
cx = g_pChildWnd->nSplitPos + SPLIT_WIDTH/2;
DeferWindowPos(hdwp, g_pChildWnd->hTreeWnd, 0, rt.left, rt.top, g_pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
DeferWindowPos(hdwp, g_pChildWnd->hListWnd, 0, rt.left+cx , rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
EndDeferWindowPos(hdwp);
}
示例6: Test_OneParamRoutine_BeginDeferWindowPos
void
Test_OneParamRoutine_BeginDeferWindowPos(void) /* 0x1e */
{
HDWP hWinPosInfo;
hWinPosInfo = (HDWP)NtUserCallOneParam(5, 0x1e);
TEST(hWinPosInfo != 0);
TEST(EndDeferWindowPos(hWinPosInfo) != 0);
}
示例7: clnt_rect
void ResizeManager::HandleSize(int cx, int cy)
{
ClientRect clnt_rect(_hwnd);
SIZE new_size = {cx, cy};
int dx = new_size.cx - _last_size.cx;
int dy = new_size.cy - _last_size.cy;
if (!dx && !dy)
return;
_last_size = new_size;
HDWP hDWP = BeginDeferWindowPos(size());
for(ResizeManager::const_iterator it=begin(); it!=end(); ++it) {
const ResizeEntry& e = *it;
RECT move = {0};
if (e._flags & MOVE_LEFT) // Die verschiedenen Transformationsmatrizen in move ließen sich eigentlich
move.left += dx; // cachen oder vorausberechnen, da sie nur von _flags und der Größenänderung abhängig sind.
if (e._flags & MOVE_RIGHT)
move.right += dx;
if (e._flags & MOVE_TOP)
move.top += dy;
if (e._flags & MOVE_BOTTOM)
move.bottom += dy;
UINT flags = 0;
if (!move.left && !move.top)
flags = SWP_NOMOVE;
if (move.right==move.left && move.bottom==move.top)
flags |= SWP_NOSIZE;
if (flags != (SWP_NOMOVE|SWP_NOSIZE)) {
HWND hwnd = GetDlgItem(_hwnd, e._id);
WindowRect rect(hwnd);
ScreenToClient(_hwnd, rect);
rect.left += move.left;
rect.right += move.right;
rect.top += move.top;
rect.bottom += move.bottom;
hDWP = DeferWindowPos(hDWP, hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, flags|SWP_NOACTIVATE|SWP_NOZORDER);
}
}
EndDeferWindowPos(hDWP);
}
示例8: DeferWindowPos
//調整控件
void CGameFrameControl::RectifyControl(int nWidth, int nHeight)
{
//狀態判斷
if (m_bInitDialog==false) return;
if ((nWidth==0)||(nHeight==0)) return;
//變量定義
const int nComminutePos=nHeight*3/7;
const UINT uFlags=SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOCOPYBITS;
//移動控件
HDWP hDwp=BeginDeferWindowPos(20);
//廣告區域
DeferWindowPos(hDwp,m_BrowerAD,NULL,LIST_LEFT,7,nWidth-LIST_LEFT-LIST_RIGHT,115,uFlags);
//列表區域
DeferWindowPos(hDwp,m_UserListView,NULL,LIST_LEFT,LIST_TOP,nWidth-LIST_LEFT-LIST_RIGHT,nComminutePos-LIST_TOP-LIST_BOTTOM,uFlags);
//聊天區域
DeferWindowPos(hDwp,m_ChatMessage,NULL,CHAT_LEFT,nComminutePos+CHAT_TOP,nWidth-CHAT_RIGHT-CHAT_LEFT,
nHeight-nComminutePos-CHAT_TOP-CHAT_BOTTOM,uFlags);
//聊天區域
CRect rcButton;
m_btPhrase.GetWindowRect(&rcButton);
CButton * pButtonArray[]={&m_btExpression,&m_btColorSet,&m_btCleanScreen};
for (int i=0;i<CountArray(pButtonArray);i++)
{
DeferWindowPos(hDwp,pButtonArray[i]->m_hWnd,NULL,CHAT_LEFT+(rcButton.Width()+5)*i,nHeight-61,rcButton.Width(),rcButton.Height(),uFlags);
}
m_btSendChat.GetWindowRect(&rcButton);
DeferWindowPos(hDwp,m_btSendChat,NULL,nWidth-rcButton.Width()-8,nHeight-33,rcButton.Width(),rcButton.Height(),uFlags);
DeferWindowPos(hDwp,m_ChatObject,NULL,8,nHeight-33,70,200,uFlags);
DeferWindowPos(hDwp,m_ChatInput,NULL,81,nHeight-33,nWidth-rcButton.Width()-93,19,uFlags);
//功能按鈕
m_btSound.GetWindowRect(&rcButton);
int nBeginPos=22,nEndPos=nWidth-17;
int nButtonSpace=(nEndPos-nBeginPos-4*rcButton.Width())/3,nYPosButton=nComminutePos-rcButton.Height()-7;
DeferWindowPos(hDwp,m_btSound,NULL,nBeginPos,nYPosButton,rcButton.Width(),rcButton.Height(),uFlags);
DeferWindowPos(hDwp,m_btLookOn,NULL,nBeginPos+nButtonSpace+rcButton.Width(),nYPosButton,rcButton.Width(),rcButton.Height(),uFlags);
DeferWindowPos(hDwp,m_btGameRule,NULL,nBeginPos+nButtonSpace*2+rcButton.Width()*2,nYPosButton,rcButton.Width(),rcButton.Height(),uFlags);
DeferWindowPos(hDwp,m_btGameOption,NULL,nBeginPos+nButtonSpace*3+rcButton.Width()*3,nYPosButton,rcButton.Width(),rcButton.Height(),uFlags);
EndDeferWindowPos(hDwp);
//重畫界麵
Invalidate(FALSE);
UpdateWindow();
return;
}
示例9: BeginDeferWindowPos
void ViewFilesDialog::ShiftControls(int deltaX, int deltaY)
{
HDWP hdwp;
/*
* Use deferred reposn so that they don't end up drawing on top of each
* other and getting all weird.
*
* IMPORTANT: the DeferWindowPos stuff changes the tab order of the
* items in the window. The controls must be added in the reverse
* order in which they appear in the window.
*/
hdwp = BeginDeferWindowPos(15);
hdwp = MoveControl(hdwp, this, AFX_IDW_SIZE_BOX, deltaX, deltaY);
hdwp = MoveControl(hdwp, this, IDHELP, deltaX, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_FONT, deltaX, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_PRINT, deltaX, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_FIND, deltaX, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_FMT_RAW, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_FMT_HEX, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_FMT_BEST, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_PREV, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_NEXT, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_CMMT, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_RSRC, 0, deltaY);
hdwp = MoveControl(hdwp, this, IDC_FVIEW_DATA, 0, deltaY);
hdwp = MoveStretchControl(hdwp, this, IDC_FVIEW_FORMATSEL, 0, deltaY, deltaX, 0);
hdwp = StretchControl(hdwp, this, IDC_FVIEW_EDITBOX, deltaX, deltaY);
hdwp = MoveControl(hdwp, this, IDOK, deltaX, deltaY);
if (!EndDeferWindowPos(hdwp)) {
LOGI("EndDeferWindowPos failed");
}
/*
* Work around buggy CRichEdit controls. The inner edit area is only
* resized when the box is shrunk, not when it's expanded, and the
* results are inconsistent between Win98 and Win2K.
*
* Set the internal size equal to the size of the entire edit box.
* This should be large enough to make everything work right, but small
* enough to avoid funky scrolling behavior. (If you want to set this
* more precisely, don't forget that scroll bars are not part of the
* edit control client area, and their sizes must be factored in.)
*/
CRect rect;
CRichEditCtrl* pEdit = (CRichEditCtrl*) GetDlgItem(IDC_FVIEW_EDITBOX);
ASSERT(pEdit != NULL);
//pEdit->GetClientRect(&rect);
pEdit->GetWindowRect(&rect);
//GetClientRect(&rect);
rect.left = 2;
rect.top = 2;
pEdit->SetRect(&rect);
}
示例10: BeginDeferWindowPos
void CNetworkMonitorBox::OnSize(UINT nType, int cx, int cy)
{
CTaskBox::OnSize( nType, cx, cy );
HDWP hDWP = BeginDeferWindowPos( 2 );
DeferWindowPos( hDWP, m_wndStart, NULL, BOX_MARGIN, 7, 55, 23, SWP_NOZORDER );
DeferWindowPos( hDWP, m_wndClock, NULL, BOX_MARGIN + 61, 7, 13 * 8, 23, SWP_NOZORDER );
EndDeferWindowPos( hDWP );
}
示例11: BeginDeferWindowPos
//---------------------------------------------------------------------------
void __fastcall TTVPMainForm::WMRearrangeModalWindows(TMessage &Msg)
{
if(TVPFullScreenedWindow != NULL && TVPGetModalWindowRearrangeInFullScreen())
{
HDWP hdwp = BeginDeferWindowPos(1);
hdwp = TVPShowModalAtTimer(hdwp);
hdwp = TVPShowFontSelectFormTop(hdwp);
hdwp = TVPShowHintWindowTop(hdwp);
EndDeferWindowPos(hdwp);
}
}
示例12: GetClientRect
void
CHelperbarWindow::UpdateLayout()
{
RECT rc;
GetClientRect(&rc);
HDWP hdwp = BeginDeferWindowPos(2);
hdwp = m_Toolbar.DeferWindowPos(hdwp, NULL, 0, 0, rc.right, m_ToolbarHeight, SWP_NOZORDER);
hdwp = m_Console.DeferWindowPos(hdwp, NULL, 0, m_ToolbarHeight, rc.right, rc.bottom - m_ToolbarHeight, SWP_NOZORDER);
EndDeferWindowPos(hdwp);
}
示例13: GetClientRect
void DialogBehaviorTreeEditor::OnSize( UINT nType, int cx, int cy )
{
CRect rcClient;
GetClientRect(rcClient);
RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposDefault, 0, rcClient);
RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposQuery, rcClient, rcClient);
HDWP hdwp = BeginDeferWindowPos(1);
DeferWindowPos(hdwp, m_pView->GetSafeHwnd(), nullptr, rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), SWP_NOZORDER);
EndDeferWindowPos(hdwp);
}
示例14: PhLayoutManagerLayout
VOID PhLayoutManagerLayout(
_Inout_ PPH_LAYOUT_MANAGER Manager
)
{
ULONG i;
Manager->LayoutNumber++;
GetClientRect(Manager->RootItem.Handle, &Manager->RootItem.Rect);
for (i = 0; i < Manager->List->Count; i++)
{
PPH_LAYOUT_ITEM item = (PPH_LAYOUT_ITEM)Manager->List->Items[i];
PhpLayoutItemLayout(Manager, item);
}
for (i = 0; i < Manager->List->Count; i++)
{
PPH_LAYOUT_ITEM item = (PPH_LAYOUT_ITEM)Manager->List->Items[i];
if (item->DeferHandle)
{
EndDeferWindowPos(item->DeferHandle);
item->DeferHandle = NULL;
}
if (item->Anchor & PH_LAYOUT_FORCE_INVALIDATE)
{
InvalidateRect(item->Handle, NULL, FALSE);
}
}
if (Manager->RootItem.DeferHandle)
{
EndDeferWindowPos(Manager->RootItem.DeferHandle);
Manager->RootItem.DeferHandle = NULL;
}
}
示例15: BeginDeferWindowPos
void QCefWebView::ResizeBrowser(const QSize& size) {
if (qcef_client_handler.get() && qcef_client_handler->GetBrowser()) {
CefWindowHandle hwnd =
qcef_client_handler->GetBrowser()->GetHost()->GetWindowHandle();
if (hwnd) {
HDWP hdwp = BeginDeferWindowPos(1);
hdwp = DeferWindowPos(hdwp, hwnd, NULL,
0, 0, size.width(), size.height(),
SWP_NOZORDER);
EndDeferWindowPos(hdwp);
}
}
}