本文整理汇总了C++中SetRectEmpty函数的典型用法代码示例。如果您正苦于以下问题:C++ SetRectEmpty函数的具体用法?C++ SetRectEmpty怎么用?C++ SetRectEmpty使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetRectEmpty函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetRectEmpty
// Setup the device context for drawing
void cef_dark_window::InitDeviceContext(HDC hdc)
{
RECT rectClipClient;
SetRectEmpty(&rectClipClient);
ComputeLogicalClientRect(rectClipClient);
// exclude the client area to reduce flicker
::ExcludeClipRect(hdc, rectClipClient.left, rectClipClient.top, rectClipClient.right, rectClipClient.bottom);
}
示例2: SetRectEmpty
void Outpin::AddVIH(
CMediaTypes& mtv,
const GUID& subtype,
REFERENCE_TIME AvgTimePerFrame,
LONG width,
LONG height,
DWORD dwBitCount,
DWORD dwSizeImage)
{
AM_MEDIA_TYPE mt;
VIDEOINFOHEADER vih;
BITMAPINFOHEADER& bmih = vih.bmiHeader;
mt.majortype = MEDIATYPE_Video;
mt.subtype = subtype;
mt.bFixedSizeSamples = TRUE;
mt.bTemporalCompression = FALSE;
mt.lSampleSize = 0;
mt.formattype = FORMAT_VideoInfo;
mt.pUnk = 0;
mt.cbFormat = sizeof vih;
mt.pbFormat = (BYTE*)&vih;
SetRectEmpty(&vih.rcSource);
SetRectEmpty(&vih.rcTarget);
vih.dwBitRate = 0;
vih.dwBitErrorRate = 0;
vih.AvgTimePerFrame = AvgTimePerFrame;
bmih.biSize = sizeof bmih;
bmih.biWidth = width;
bmih.biHeight = height;
bmih.biPlanes = 1; //because Microsoft says so
bmih.biBitCount = static_cast<WORD>(dwBitCount);
bmih.biCompression = subtype.Data1;
bmih.biSizeImage = dwSizeImage;
bmih.biXPelsPerMeter = 0;
bmih.biYPelsPerMeter = 0;
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
mtv.Add(mt);
}
示例3: imax
void StringItem::Measure(HDC hDC, SIZE *size)
{
MenuItem::Measure(hDC, size);
if (false == Settings_menu.showBroams)
{
size->cx = imax(size->cx + 20, 120);
size->cy += 6;
}
SetRectEmpty(&m_textrect);
}
示例4: mouse
/*
Effect: Handle any actions relating to the user pressing *down*
the left mouse button within the widget.
In particular, we need to prepare the widget for moving
|| sizing. To do this, we remove any drag blobs already
present on the widget.
We also capture the mouse input, so we can track the
movement of the mouse. We will release the capture
when the user releases the mouse key.
Since the window class style of the widget might not
accept double clicks, we will need to compute double
clicks ourselves.
If someone else has control of the mouse (like the
session window || another widget), we won't be getting
this mouse message.
See Also: WidgetLButtonUp, WidgetLMouseMove.
Called By: WidgetWndProc, in response to WM_LBUTTONDOWN messages.
LayoutWndProc, in response to WM_LBUTTONDOWN messages
when the mouse is over a drag blob.
*/
void WidgetLButtonDown(HWND hWnd, int nDragMode, POINT ptScreen)
{
RECT rcParentScreen;
HWND hWndParent, hWndPrev;
HDC hDC;
CurrentWidgetInfo.ptPrev = ptScreen;
hWndParent = GetParent(hWnd);
CurrentWidgetInfo.nDragMode = nDragMode;
hDC = GetDC(hWndParent);
/* Erase the drag blobs from the current widget. The blobs will */
/* be repainted in WidgetButtonUp after the user finishes dragging */
/* || sizing. */
GetWindowRect(hWnd, &CurrentWidgetInfo.rcPrevDots);
GetWindowRect(hWnd, &CurrentWidgetInfo.rcPrev);
hWndPrev = CurrentWidgetInfo.hWnd;
CurrentWidgetInfo.bDotsDrawn = FALSE;
CurrentWidgetInfo.bDotsDrawn = TRUE;
if (hWnd != CurrentWidgetInfo.hWnd)
{
if (KpsSetCurrentWidget(hWnd))
{
if (IsWindow(hWndPrev))
{
if (KpsIsAWidget(hWndPrev))
{
InvalidateRect(hWndPrev, NULL, TRUE);
UpdateWindow(hWndPrev);
}
}
}
InvalidateRect(hWnd, NULL, TRUE);
UpdateWindow(hWnd);
}
if (!CurrentWidgetInfo.bCapture)
{
SetCapture(hWnd);
GetClientRect(hWndParent, &rcParentScreen);
KpsClientRectToScreen(hWndParent, &rcParentScreen);
ClipCursor(&rcParentScreen);
CurrentWidgetInfo.bCapture = TRUE;
}
ReleaseDC(hWndParent, hDC);
/* Clear out the rectangle, indicating there is nothing to erase! */
SetRectEmpty(&rcPrev);
}
示例5: DrawInsert
/***********************************************************************
* DrawInsert (COMCTL32.15)
*
* Draws insert arrow by the side of the ListBox item in the parent window.
*
* RETURNS
* Nothing.
*/
VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem)
{
RECT rcItem, rcListBox, rcDragIcon;
HDC hdc;
DRAGLISTDATA * data;
TRACE("(%p %p %d)\n", hwndParent, hwndLB, nItem);
if (!hDragArrow)
hDragArrow = LoadIconW(COMCTL32_hModule, (LPCWSTR)IDI_DRAGARROW);
if (LB_ERR == SendMessageW(hwndLB, LB_GETITEMRECT, nItem, (LPARAM)&rcItem))
return;
if (!GetWindowRect(hwndLB, &rcListBox))
return;
/* convert item rect to parent co-ordinates */
if (!MapWindowPoints(hwndLB, hwndParent, (LPPOINT)&rcItem, 2))
return;
/* convert list box rect to parent co-ordinates */
if (!MapWindowPoints(HWND_DESKTOP, hwndParent, (LPPOINT)&rcListBox, 2))
return;
rcDragIcon.left = rcListBox.left - DRAGICON_HOTSPOT_X;
rcDragIcon.top = rcItem.top - DRAGICON_HOTSPOT_Y;
rcDragIcon.right = rcListBox.left;
rcDragIcon.bottom = rcDragIcon.top + DRAGICON_HEIGHT;
if (!GetWindowSubclass(hwndLB, DragList_SubclassWindowProc, DRAGLIST_SUBCLASSID, (DWORD_PTR*)&data))
return;
if (nItem < 0)
SetRectEmpty(&rcDragIcon);
/* prevent flicker by only redrawing when necessary */
if (!EqualRect(&rcDragIcon, &data->last_drag_icon_rect))
{
/* get rid of any previous inserts drawn */
RedrawWindow(hwndParent, &data->last_drag_icon_rect, NULL,
RDW_INTERNALPAINT | RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);
CopyRect(&data->last_drag_icon_rect, &rcDragIcon);
if (nItem >= 0)
{
hdc = GetDC(hwndParent);
DrawIcon(hdc, rcDragIcon.left, rcDragIcon.top, hDragArrow);
ReleaseDC(hwndParent, hdc);
}
}
}
示例6: while
//工具栏从停靠行脱离,调用本函数须确保dockbar有效
int RingDockSite::BarOutLine(RingDockBar* dockbar,BOOL bCalcSize,LPRINGBARLINEINFO& line)
{
int nMax=0,nExtra=0;
RingDockBar* bar = dockbar->m_lineInfo->m_first;
if(bCalcSize)
{
//计算除要删除的工具栏外行的总高/宽度
while(bar)
{
if(bar != dockbar)
{
if(bar->IsVisible())
nMax = max(nMax,bar->m_nSize);
}
bar = bar->m_next;
}
}
else
nMax = dockbar->m_lineInfo->m_maxSize;
line = dockbar->m_lineInfo;
//连接前后工具栏
if(dockbar->m_next)
dockbar->m_next->m_prev = dockbar->m_prev;
if(dockbar->m_prev)
dockbar->m_prev->m_next = dockbar->m_next;
else
line->m_first = dockbar->m_next;
//设置行的总高/宽度
line->m_maxSize = nMax;
if(dockbar->IsSizeBar())
{
line->m_nSizeBarCnt --;
if(line->m_nSizeBarCnt == 0)
{
nExtra = m_SplitterSize;
//已无SizeBar,清空调整线信息
if(line->m_SplitRc.right != 0)
SetRectEmpty(&line->m_SplitRc);
}
}
//清空工具栏连接信息
dockbar->m_lineInfo = NULL;
dockbar->m_prev = dockbar->m_next = NULL;
if(line->m_first == NULL) //行内没有工具栏了,返回NULL
line = NULL;
if(line && nMax == 0) //其他工具栏是隐藏的
line->isVisible = FALSE;
return min(0,nMax - dockbar->m_nSize - nExtra);
}
示例7: DECLARE_PTR
// See Directshow help topic for IAMStreamConfig for details on this method
HRESULT CVCamStream::GetMediaType(int iPosition, CMediaType *pmt)
{
if (iPosition < 0) return E_INVALIDARG;
if (iPosition > 8) return VFW_S_NO_MORE_ITEMS;
if (iPosition == 0)
{
*pmt = m_mt;
return S_OK;
}
// TODO: the pvi is mostly duplicated from GetStreamCaps
DECLARE_PTR(VIDEOINFOHEADER, pvi, pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER)));
ZeroMemory(pvi, sizeof(VIDEOINFOHEADER));
pvi->bmiHeader.biCompression = BI_RGB;
pvi->bmiHeader.biBitCount = 24;
pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pvi->bmiHeader.biWidth = 80 * iPosition;
pvi->bmiHeader.biHeight = 60 * iPosition;
pvi->bmiHeader.biPlanes = 1;
pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
pvi->bmiHeader.biClrImportant = 0;
pvi->AvgTimePerFrame = 1000000;
SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
pmt->SetType(&MEDIATYPE_Video);
pmt->SetFormatType(&FORMAT_VideoInfo);
pmt->SetTemporalCompression(TRUE);
// Work out the GUID for the subtype from the header info.
/*const GUID SubTypeGUID = GetBitmapSubtype(&pvi->bmiHeader);
pmt->SetSubtype(&SubTypeGUID);*/
pmt->SetSubtype(&MEDIASUBTYPE_H264);
pmt->SetSampleSize(pvi->bmiHeader.biSizeImage);
return NOERROR;
} // GetMediaType
示例8: cAutoLock
HRESULT CPushPinBitmapSet::GetMediaType(CMediaType *pMediaType)
{
CAutoLock cAutoLock(m_pFilter->pStateLock());
CheckPointer(pMediaType, E_POINTER);
// If the bitmap files were not loaded, just fail here.
if (!m_bFilesLoaded)
return E_FAIL;
// Allocate enough room for the VIDEOINFOHEADER and the color tables
VIDEOINFOHEADER *pvi =
(VIDEOINFOHEADER*)pMediaType->AllocFormatBuffer(SIZE_PREHEADER +
m_cbBitmapInfo[m_iCurrentBitmap]);
if (pvi == 0)
return(E_OUTOFMEMORY);
// Initialize the video info header
ZeroMemory(pvi, pMediaType->cbFormat);
pvi->AvgTimePerFrame = m_rtFrameLength;
// Copy the header info from the current bitmap
memcpy(&(pvi->bmiHeader), m_pBmi[m_iCurrentBitmap], m_cbBitmapInfo[m_iCurrentBitmap]);
// Set image size for use in FillBuffer
pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader);
// Clear source and target rectangles
SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered
SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
pMediaType->SetType(&MEDIATYPE_Video);
pMediaType->SetFormatType(&FORMAT_VideoInfo);
pMediaType->SetTemporalCompression(FALSE);
// Work out the GUID for the subtype from the header info.
const GUID SubTypeGUID = GetBitmapSubtype(&pvi->bmiHeader);
pMediaType->SetSubtype(&SubTypeGUID);
pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage);
return S_OK;
}
示例9: CheckPointer
HRESULT CTMReceiverOutputPin::GetMediaType(int iPosition, CMediaType *pmt){
CheckPointer(pmt,E_POINTER);
CAutoLock cAutoLock(m_pFilter->pStateLock());
if(iPosition < 0)
{
return E_INVALIDARG;
}
if(iPosition > 0)
{
return VFW_S_NO_MORE_ITEMS;
}
VIDEOINFO* pvih = (VIDEOINFO*)pmt->AllocFormatBuffer(sizeof(VIDEOINFO));
LPBITMAPINFOHEADER lpBitmapInfoHeader = &(pvih->bmiHeader);
lpBitmapInfoHeader->biSize = sizeof(BITMAPINFOHEADER);
lpBitmapInfoHeader->biBitCount = 32;
lpBitmapInfoHeader->biWidth = ((CTMReceiverSrc *)m_pFilter)->GetImageWidth()/4*4;
lpBitmapInfoHeader->biHeight = ((CTMReceiverSrc *)m_pFilter)->GetImageHeight();
lpBitmapInfoHeader->biPlanes = 1;
lpBitmapInfoHeader->biCompression = BI_RGB;
lpBitmapInfoHeader->biSizeImage = ((CTMReceiverSrc *)m_pFilter)->GetImageWidth() / 4 * 4 * ((CTMReceiverSrc *)m_pFilter)->GetImageHeight() * 4;
lpBitmapInfoHeader->biXPelsPerMeter = 0;
lpBitmapInfoHeader->biYPelsPerMeter =0;
lpBitmapInfoHeader->biClrUsed = 0;
lpBitmapInfoHeader->biClrImportant = 0;
pvih->AvgTimePerFrame = m_rtAvgTimePerFrame;
pmt->SetFormatType(&FORMAT_VideoInfo);
pmt->SetTemporalCompression(FALSE);
SetRectEmpty(&(pvih->rcSource)); // we want the whole image area rendered.
SetRectEmpty(&(pvih->rcTarget)); // no particular destination rectangle
pmt->SetType(&MEDIATYPE_Video);
// Work out the GUID for the subtype from the header info.
const GUID SubTypeGUID = GetBitmapSubtype(&pvih->bmiHeader);
pmt->SetSubtype(&SubTypeGUID);
pmt->SetSampleSize(pvih->bmiHeader.biSizeImage);
return S_OK;
}
示例10: xxxGetMenuItemRect
// ============================================================================
//
// GetMenuItemRect()
//
// ============================================================================
BOOL xxxGetMenuItemRect(PWND pwnd, PMENU pMenu, UINT uIndex, LPRECT lprcScreen)
{
PITEM pItem;
int dx, dy;
CheckLock(pwnd);
CheckLock(pMenu);
SetRectEmpty(lprcScreen);
if (uIndex >= pMenu->cItems)
return(FALSE);
/*
* Raid #315084: Compatiblity with NT4/Win95/98
*
* WordPerfect does a long complex way to calc the menu rect
* by calling this API. It calls GetMenuItemRect() with the app's
* window.
*/
if (pwnd == NULL || TestWF(pwnd, WFWIN50COMPAT)) {
pwnd = GetMenuPwnd(pwnd, pMenu);
}
/*
* If no pwnd, no go.
* IMPORTANT: for MFISPOPUP we might get a different pwnd but we don't lock
* it because we won't call back
*/
if (pwnd == NULL) {
return FALSE;
}
if (TestMF(pMenu, MFISPOPUP)) {
dx = pwnd->rcClient.left;
dy = pwnd->rcClient.top;
} else {
xxxMNRecomputeBarIfNeeded(pwnd, pMenu);
dx = pwnd->rcWindow.left;
dy = pwnd->rcWindow.top;
}
if (uIndex >= pMenu->cItems)
return(FALSE);
pItem = pMenu->rgItems + uIndex;
lprcScreen->right = pItem->cxItem;
lprcScreen->bottom = pItem->cyItem;
OffsetRect(lprcScreen, dx + pItem->xItem, dy + pItem->yItem);
return(TRUE);
}
示例11: ASSERT
CDelayRepaint::CDelayRepaint( CEdit *pCtrl )
{
ASSERT( pCtrl );
m_pCtrl = pCtrl;
ASSERT( m_pCtrl->m_nDelayPaint >= 0 );
if ( ++m_pCtrl->m_nDelayPaint == 1 )
{
m_pCtrl->m_Selection.HideCaret();
SetRectEmpty( &m_pCtrl->m_rcDelayPaint );
}
}
示例12: _calcTextDisplayLength
void CListViewNode::_init(int ix, bool before)
{
_calcTextDisplayLength();
m_selected = false;
m_focused = false;
m_editable = false;
SetRectEmpty(&m_iconRect);
SetRectEmpty(&m_textRect);
SetRectEmpty(&m_borderRect);
m_imageIndex = -1;
if ( m_listView )
{
m_editable = m_listView->is_Editable();
if ( ix < 0 )
m_listView->set_Node(m_listView->get_NodeCount(), this);
else
m_listView->ins_Node(ix, this, before);
m_listView->Update(TRUE);
}
}
示例13: SetRectEmpty
CEditView::CEditView( CEdit *pCtrl, CBuffer *pBuffer, int nLeftIndex, int nTopIndex )
{
m_pCtrl = pCtrl;
m_hWndView = pCtrl->GetWindow();
m_pBuffer = pBuffer;
SetRectEmpty( &m_rcAll );
SetRectEmpty( &m_rcView );
m_hWndHScroll = m_hWndVScroll = NULL;
m_nBottomIndex = m_nRightIndex = m_nBottomIndexFullyVisible = m_nRightIndexFullyVisible = 0;
m_nLeftIndex = nLeftIndex;
m_nTopIndex = nTopIndex;
m_nLineDamageStart = MAXROW;
m_nLineDamageEnd = -1;
m_nEditLevel = 0;
if ( !m_bInit )
{
CharFill( m_szSpace, _T(' '), CBuffer::MAX_TABSIZE );
m_bInit = TRUE;
}
OnFontChanged( pCtrl->GetFont( FALSE ), pCtrl->GetCharWidth() );
}
示例14: GetSystemMenu
BOOL CSkinBase::DoSysMenu(HWND hWnd, CPoint ptCursor, LPRECT prExclude, BOOL bCopy)
{
HMENU hMenu = GetSystemMenu(hWnd, FALSE);
ASSERT ( hMenu );
if ( hMenu )
{
TPMPARAMS tpmp;
tpmp.cbSize = sizeof(tpmp);
if (prExclude)
tpmp.rcExclude = *prExclude;
else
SetRectEmpty(&tpmp.rcExclude);
UINT uAlignFlags = TPM_LEFTALIGN | TPM_TOPALIGN | TPM_VERTICAL | TPM_RIGHTBUTTON | TPM_RETURNCMD;
UINT uID = 0;
if (bCopy) // skinning
{
HMENU hSysMenu = CSkinBase::MakeMenuCopy(hMenu);
ASSERT (hSysMenu);
if (hSysMenu)
{
InitSysMenu( hSysMenu, pWnd );
uID = ::TrackPopupMenuEx(hSysMenu, uAlignFlags,
ptCursor.x, ptCursor.y, hWnd, &tpmp);
::DestroyMenu(hSysMenu); // cleanup
}
}
else
{
InitSysMenu(hMenu, hWnd);
uID = ::TrackPopupMenuEx(hMenu, uAlignFlags,
ptCursor.x, ptCursor.y, hWnd, &tpmp);
}
if (uID & 0xf000) // syscommand
{
//MSG& curMsg = AfxGetThreadState()->m_lastSentMsg;
// always post this command to allow this function to unwind
// correctly before the command is handled
//pWnd->PostMessage(WM_SYSCOMMAND, (uID & 0xfff0), MAKELPARAM(curMsg.pt.x, curMsg.pt.y));
PostMessage(hWnd, WM_SYSCOMMAND, (uID & 0xfff0), MAKELPARAM(ptCursor.x, ptCursor.y));
}
}
return TRUE;
}
示例15: SetRectEmpty
// Setup the device context for drawing
void cef_dark_aero_window::InitDeviceContext(HDC hdc)
{
if (CanUseAeroGlass()) {
RECT rectClipClient;
SetRectEmpty(&rectClipClient);
GetRealClientRect(&rectClipClient);
// exclude the client area to reduce flicker
::ExcludeClipRect(hdc, rectClipClient.left, rectClipClient.top, rectClipClient.right, rectClipClient.bottom);
} else {
cef_dark_window::InitDeviceContext(hdc);
}
}