找了一下以前写的代码 改了个简单的效果 你先看看吧 是屏幕地震 震一会儿会自己停下的。
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char *plCmdLine, int nCmdShow)
{
HWND hWnd;
HDC hdcScr, hdcMem;
HBITMAP hBitmap;
int cx, cy;
int i, j, n;
hWnd = GetDesktopWindow();
hdcScr = GetDCEx(hWnd,NULL,DCX_CACHE | DCX_LOCKWINDOWUPDATE);
hdcMem = CreateCompatibleDC(hdcScr);
cx = GetSystemMetrics(SM_CXSCREEN);
cy = GetSystemMetrics(SM_CYSCREEN);
hBitmap = CreateCompatibleBitmap(hdcScr,cx,cy);
SelectObject(hdcMem,hBitmap);
BitBlt(hdcMem,0,0,cx,cy,hdcScr,0,0,SRCCOPY);
for (n=20;n;n--)
for (i=-1;i<=1;i++)
for (j=-1;j<=1;j++)
{
BitBlt(hdcScr,0+i*n,0+j*n,cx,cy,hdcMem,0,0,SRCCOPY);
Sleep(50);
}
BitBlt(hdcScr,0,0,cx,cy,hdcMem,0,0,SRCCOPY);
DeleteObject(hBitmap);
DeleteDC(hdcMem);
ReleaseDC(hWnd,hdcScr);
}