确实没印象,恶搞倒是有一个,也可以整得稀烂
#include <ScreenCapture.au3>
Global $hDwmApiDll = DllOpen('dwmapi.dll')
Local $sChkAero = DllStructCreate('int;')
DllCall($hDwmApiDll, 'int', 'DwmIsCompositionEnabled', 'ptr', DllStructGetPtr($sChkAero))
Global $aero = DllStructGetData($sChkAero, 1)
If $aero Then DllCall($hDwmApiDll, 'int', 'DwmEnableComposition', 'uint', False)
Sleep(500)
Opt('GUIOnEventMode', 1)
Global $hDC0 = _GetDC(0)
Global $fTmp = @TempDir & '\xxx.bmp'
_ScreenCapture_Capture($fTmp, 0, 0, -1, -1, False)
Global $hGui = GUICreate('', @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000)
GUISetOnEvent(-3, '_Exit')
GUICtrlCreatePic($fTmp, 0, 0, @DesktopWidth, @DesktopHeight)
Global $hDC1 = _GetDC($hGui)
GUISetState()
Local $iRaW, $iRaH
While 1
$iRaW = (@DesktopWidth - 128) * Random(0, 1)
$iRaH = (@DesktopHeight - 128) * Random(0, 1)
DllCall('gdi32.dll', 'bool', 'BitBlt', 'handle', $hDC1, 'int', $iRaW + (2 * Random(0, 1) - 1), 'int', $iRaH + (2 * Random(0, 1) - 1), 'int', 128, 'int', 128, 'handle', $hDC0, 'int', $iRaW, 'int', $iRaH, 'dword', 0x00CC0020)
WEnd
Func _Exit()
If $aero Then DllCall($hDwmApiDll, 'int', 'DwmEnableComposition', 'uint', True)
DllCall('user32.dll', 'int', 'ReleaseDC', 'hwnd', $hGui, 'handle', $hDC1)
DllCall('user32.dll', 'int', 'ReleaseDC', 'hwnd', 0, 'handle', $hDC0)
FileDelete($fTmp)
Exit
EndFunc ;==>_Exit
Func _GetDC($hh)
Local $aRt = DllCall('user32.dll', 'handle', 'GetDC', 'hwnd', $hh)
Return $aRt[0]
EndFunc ;==>_GetDC
|