昨天晚上闲着没事,看到了一篇技术论文,是跟珊瑚虫版QQ有关的,其中有反编译QQ的功能模块,有个是QQ窗口抖动功能类,感觉还是很简单的,代码比较少,废话不多说,上代码,具体实现的exe在我的资源里,可以自己去下载。
#include "resource.h"
#include "windows.h"
void shake(HWND hwnd)
{
RECT rect;
int cxWidth;
int cyHighth;
GetWindowRect(hwnd,&rect);
cxWidth=rect.right-rect.left;
cyHighth=rect.bottom-rect.top;
for (int i=0;i<=200;i+=100)
{
MoveWindow(hwnd, rect.left - 5, rect.top, cxWidth, cyHighth, TRUE);
Sleep(50);
MoveWindow(hwnd, rect.left - 5, rect.top + 5, cxWidth, cyHighth, TRUE);
Sleep(50);
MoveWindow(hwnd, rect.left, rect.top + 5, cxWidth, cyHighth, TRUE);
Sleep(50);
MoveWindow(hwnd, rect.left, rect.top, cxWidth, cyHighth, TRUE);
Sleep(50);
}
return;
}
BOOL CALLBACK control(HWND hwnd,UINT uMsg,WPARAM wparam,LPARAM lparam)
{
if (uMsg==WM_CLOSE)
{
EndDialog(hwnd,0);
}
if (uMsg==WM_COMMAND)
{
if (wparam==IDOK)
{
shake(hwnd);
}
}
return FALSE;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),HWND_DESKTOP,control);
return 0;
}