コード例 #1
0
// Regen *Each* device
BOOL
Regen()
	{
	UINT	Index;
	char	s[20];

//	Index = 0;
//	while ( Index < CACHEDevices )
//		{
//		sprintf(s, "CACHE%d", Index);
//		printf("Regen Device '%s'\n", s);
//		Regen(s, TRUE);
//		++Index;
//		}

	Index = 0;
	while ( Index < JUKEBOXDevices )
		{
		sprintf(s, "JUKEBOX%d", Index);
		printf("Regen Device '%s'\n", s);
		Regen(s, TRUE);
		++Index;
		}

	Index = 0;
	while ( Index < MAGDevices )
		{
		sprintf(s, "MAG%d", Index);
		printf("Regen Device '%s'\n", s);
		Regen(s, FALSE);
		++Index;
		}

	return(FALSE);
	}
コード例 #2
0
ファイル: PubImgView.cpp プロジェクト: sanyaade-webdev/wpub
BOOL CPubImgView::OnEraseBkgnd(CDC* pDC) 
{	
	if ( pDC == NULL ) return FALSE;

	RECT rect;
	GetClientRect( &rect );

	HDC hDC = pDC->GetSafeHdc();

	// Create offscreen DC
	if ( m_offscreen.Create( hDC, &rect ) )
		hDC = m_offscreen;

	// Fill rect
	CGrDC::FillSolidRect( hDC, &rect, GetSysColor( COLOR_3DFACE ) );

	// Regen video if needed
	if ( m_video.GetSafeHdc() == NULL ) Regen();

	// Draw to screen
	m_video.Draw( hDC, &rect, FALSE );

	DWORD sel = m_pImgList->GetCurSel();

	if ( sel < m_pImgList->Size() )
	{
		RECT selbox;
		CopyRect( &selbox, &rect );

		long w = RW( rect );
		long h = RH( rect );

		// Where will the selection box be?
		if ( w > h ) { selbox.left += sel * h; selbox.right = selbox.left + h; }
		else { selbox.top += sel * w; selbox.bottom = selbox.top + w; }

		InflateRect( &selbox, -4, -4 );

		// Draw the selection box
		CGrDC::Box3d(	hDC, &selbox, 3,
						GetSysColor( COLOR_HIGHLIGHT ), 
						GetSysColor( COLOR_HIGHLIGHT ), TRUE );	
	} // end if

	// Update the screen
	m_offscreen.Draw( pDC->GetSafeHdc(), &rect );

	return TRUE;
//	return CWnd::OnEraseBkgnd(pDC);
}