给你句代码研究研究,可以象关机一样使屏幕变暗:<br>var bBmp:array[0..15] of integer;<br>begin<br>bBmp[0]:=$55;<br>bBmp[2]:=$aA;<br>bBmp[4]:=$55;<br>bBmp[6]:=$aA;<br>bBmp[8]:=$55;<br>bBmp[10]:=$aA;<br>bBmp[12]:=$55;<br>bBmp[14]:=$aA;<br>end;<br>procedure TForm1.Button1Click(Sender: TObject);<br>var a:HBitmap;<br>pattern:hgdiobj;<br>oldh:THandle;<br>v:hdc;<br>begin<br>a:=createbitmap(8,8,1,1,@bmp);<br>pattern:=createpatternbrush(a);<br><br>v:=getdc(0);<br>oldh:=selectobject(v,pattern);<br>bitblt(v,0,0,800,600,v,0,0,mergecopy);<br>selectobject(v,oldh);<br>releasedc(0,v);<br>deleteobject(a);<br>deleteobject(pattern);<br><br><br>end;<br><br>恢复屏幕<br>procedure TForm1.Button2Click(Sender: TObject);<br>var arect:Trect;<br>begin<br>arect:=rect(0,0,800,600);<br>invalidaterect(0,@arect,true);<br>end;<br><br>end. <br> <br>