15,471
社区成员
发帖
与我相关
我的任务
分享
DWORD WINAPI animate(LPVOID lpParam){
ANIMATE* lpAnimate=(ANIMATE*)lpParam;
lpAnimate->wndclass.style=CS_HREDRAW|CS_VREDRAW|CS_SAVEBITS;
lpAnimate->wndclass.lpfnWndProc=NULL;
lpAnimate->wndclass.cbClsExtra=0;
lpAnimate->wndclass.cbWndExtra=0;
lpAnimate->wndclass.hInstance=hMod;
lpAnimate->wndclass.hCursor=NULL;
lpAnimate->wndclass.hIcon=NULL;
lpAnimate->wndclass.hbrBackground=(HBRUSH)GetStockObject(0);
lpAnimate->wndclass.lpszMenuName=NULL;
lpAnimate->wndclass.lpszClassName=lpAnimate->ID;
if(!RegisterClass(&(lpAnimate->wndclass))){
MessageBox(NULL,TEXT(lpAnimate->ID),TEXT("CAN NOT SUPPORT THE SYSTEM"),MB_ICONERROR);
}
lpAnimate->hwnd=CreateWindow(lpAnimate->ID,
TEXT(""),
WS_BORDER|WS_POPUP,
lpAnimate->ini_x,
lpAnimate->ini_y,
64,
64,
NULL,
NULL,
hMod,
NULL);
AnimateWindow(lpAnimate->hwnd,500,AW_VER_POSITIVE);
return 0;
}
typedef struct ANIMATE{
HWND hwnd;
WNDCLASS wndclass;
TCHAR ID[9];
int ini_x;
int ini_y;
int obj_x;
int obj_y;
int pic_ID;
HBITMAP hBitmap;
HBRUSH hBrush;
}ANIMATE;
LRESULT CALLBACK ThreadWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
switch(uMsg)
{
case WM_PAINT:
BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
}
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
lpAnimate->wndclass.lpfnWndProc=ThreadWndProc;