VC完成屏幕變暗效果
發(fā)表時間:2024-02-09 來源:明輝站整理相關軟件相關文章人氣:
[摘要]網(wǎng)絡上有很多利用VB編程實現(xiàn)屏幕變暗的效果(像關閉Win95時的效果),我用VC改寫了一下,權利屬于原文作者! 正文 HDC hdc; //屏幕的寬度個高度 int SCRWidth,SCRHeight; if(m_Bool) BYTE bybits...
網(wǎng)絡上有很多利用VB編程實現(xiàn)屏幕變暗的效果(像關閉Win95時的效果),我用VC改寫了一下,權利屬于原文作者!
正文
HDC hdc;
//屏幕的寬度個高度
int SCRWidth,SCRHeight;
if(m_Bool)
{
BYTE bybits[] = {0x55, 0x0, 0xAA, 0x0,
0x55, 0x0, 0xAA, 0x0,
0x55, 0x0, 0xAA, 0x0,
0x55, 0x0, 0xAA, 0x0};
hBitmap = ::CreateBitmap(8, 8, 1, 1, bybits);
hBrush = ::CreatePatternBrush(hBitmap);
hdc = ::GetDC(NULL);
SCRWidth = ::GetSystemMetrics(SM_CXSCREEN);
SCRHeight = ::GetSystemMetrics(SM_CYSCREEN);
::SelectObject(hdc,hBrush);
//0xA000C9
::PatBlt(hdc,0,0,SCRWidth,SCRHeight,0xA000C9);
::DeleteObject(hBrush);
::ReleaseDC(0, hdc);
}
else
//重畫整個屏幕
::InvalidateRect(NULL, 0, 1);
正文完,本文源代碼:
http://www.vchelp.net/ASP/ibr_upload/656.rar