⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shellload.cpp.bak

📁 wince下实现开机动画的代码
💻 BAK
📖 第 1 页 / 共 2 页
字号:
				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 1;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;

				if(index>50)
				break;
			}
		}
	}
	::ExitThread(2);
	return 0;

}

DWORD WINAPI Thread3Proc(PVOID lpParameter)
{
	static int index = 3;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent2, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(2);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
				SetEvent(hThreadEvent3);				
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,2);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 2;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;

				if(index>50)
					break;
			}
		}
	}
	::ExitThread(3);
	return 0;

}

DWORD WINAPI Thread4Proc(PVOID lpParameter)
{
	static int index = 4;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent3, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(3);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
				SetEvent(hThreadEvent4);
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,3);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 3;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;

				if(index>50)
				break;
			}
		}
	}
	::ExitThread(4);
	return 0;

}

DWORD WINAPI Thread5Proc(PVOID lpParameter)
{
	static int index = 5;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent4, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(4);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
				SetEvent(hThreadEvent5);
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,4);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 4;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;

				if(index>50)
				break;
			}
		}
	}
	::ExitThread(5);
	return 0;

}
DWORD WINAPI Thread6Proc(PVOID lpParameter)
{
	static int index = 6;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent5, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(5);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
				SetEvent(hThreadEvent6);
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,5);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 5;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;

				if(index>50)
				break;
			}
		}
	}
	::ExitThread(6);
	return 0;

}

DWORD WINAPI Thread7Proc(PVOID lpParameter)
{
	static int index = 7;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent6, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(6);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,6);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 6;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;
				SetEvent(hThreadEvent1);
				if(index>50)
				break;
			}
		}
	}
	::ExitThread(7);
	return 0;

}

DWORD WINAPI Thread8Proc(PVOID lpParameter)
{
	static int index = 8;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent6, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(7);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,7);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 7;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;
				SetEvent(hThreadEvent1);
				if(index>50)
				break;
			}
		}
	}
	::ExitThread(8);
	return 0;

}

DWORD WINAPI Thread9Proc(PVOID lpParameter)
{
	static int index = 9;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent6, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(8);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,8);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 8;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;
				SetEvent(hThreadEvent1);
				if(index>50)
				break;
			}
		}
	}
	::ExitThread(9);
	return 0;

}

DWORD WINAPI Thread10Proc(PVOID lpParameter)
{
	static int index = 10;
	static BOOL bFlags = FALSE;
	static unsigned int nIndexHDC;
	static DWORD dwStatus;
	RECT		rc={0,0,800,270};
	HBITMAP		hOldBitmap;
	wchar_t lpFileName[50] = {0};
	while(1)
	{
		dwStatus = WaitForSingleObject(hThreadEvent6, 2000);
		if(dwStatus == WAIT_OBJECT_0)
		{
			pClsPngAnimation->Lock();
			bFlags = pClsPngAnimation->GetFlags(9);
			pClsPngAnimation->UnLock();

			if(bFlags == FALSE)
			{
	#if DRAW_METHOD
	//			pClsPngAnimation->Lock();
				pClsPngAnimation->PngDraw(index,9);
	//			pClsPngAnimation->UnLock();
	#else

				wsprintf(lpFileName,DATA_PATH L"PowerOn\\On_%04d.png",index);
				nIndexHDC = 9;

				HRESULT hResult = pClsPngAnimation->m_pImgFactory->CreateImageFromFile(lpFileName, &(pClsPngAnimation->m_pImageBmp[nIndexHDC]));

				if((SUCCEEDED(hResult))/* && (SUCCEEDED(pImageBmp->GetImageInfo(&imageInfo)))*/)
				{

					info(TEXT("Png Draw %s \r\n"),lpFileName);
					hOldBitmap = (HBITMAP)SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],pClsPngAnimation->m_hBitmap);
					FillRect(pClsPngAnimation->m_hArrayDC[nIndexHDC],&rc,pClsPngAnimation->m_hBrush);

					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Draw(pClsPngAnimation->m_hArrayDC[nIndexHDC], &rc,NULL);

					::SelectObject(pClsPngAnimation->m_hArrayDC[nIndexHDC],hOldBitmap);
					pClsPngAnimation->Lock();
					pClsPngAnimation->m_blArrayDC[nIndexHDC] = TRUE;
					pClsPngAnimation->UnLock();
				}

				if(pClsPngAnimation->m_pImageBmp[nIndexHDC])
				{
					pClsPngAnimation->m_pImageBmp[nIndexHDC]->Release();
					pClsPngAnimation->m_pImageBmp[nIndexHDC] = NULL;
				}


	#endif
				index = index+THEAD_NUM;
				SetEvent(hThreadEvent1);
				if(index>50)
				break;
			}
		}
	}
	::ExitThread(10);
	return 0;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -