WEB开发网
开发学院软件开发C++ 实现关机时的效果的一段代码 阅读

实现关机时的效果的一段代码

 2008-03-08 12:47:43 来源:WEB开发网   
核心提示:unsigned char bybits[16]={0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0};HANDLE hBitmap,hBrush;//---void __fastcall TForm1::Button1Cli

  unsigned char bybits[16]={0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,
             0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0};
HANDLE hBitmap,hBrush;

//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  /使屏幕暗下来
  HANDLE hdc5;
  hBitmap=CreateBitmap(8,8,1,1,&bybits[0]);
  hBrush=CreatePatternBrush(hBitmap);
  hdc5=GetDC(0);
  SelectObject(hdc5,hBrush);
  PatBlt(hdc5,0,0,Screen->Width,Screen->Height,0xa000c9);
  DeleteObject(hBrush);
  DeleteObject(hBitmap);
  ReleaseDC(0,hdc5);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  //复原屏幕
  InvalidateRect(0,0,1);
}
//---------------------------------------------------------------------------

Tags:实现 关机 效果

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接