var
bmpMain, bmpBut, oldBmp : hBitmap;
dc, ccdc : HDC;
Count :
Integer
;
function
MesPro(Handle: HWND; Msg: UINT; WParam:
Integer
; lParam:
Integer
):
Integer
;stdcall;
var
ps: PAINTSTRUCT;
begin
Result:=
0
;
case
msg
of
WM_CREATE:
begin
dc := GetDC(
0
);
ccdc := CreateCompatibleDC(dc);
bmpBut := LoadRes(hInstance,
'button_next'
,
'PNG'
);
OldBmp := SelectObject(ccdc, bmpBut);
SetTimer(Handle,
1
,
100
,
NIL
);
end
;
WM_TIMER :
begin
inc(Coount);
if
Count >
8
then
Count :=
1
;
bmpBut := LoadRes(hInstance,
'button_next'
, IntToStr(Count) +
'PNG'
);
SelectObject(ccdc, bmpBut);
InvalidateRect(Handle,
NIL
,
False
);
end
;
WM_PAINT:
begin
BeginPaint(Handle,ps);
BitBlt(ps
.
hdc,
414
,
383
,
34
,
34
,ccdc,
0
,
0
,SRCCOPY);
EndPaint(Handle,ps);
end
;
WM_DESTROY:
begin
KillTimer(Handle,
1
);
DeleteObject(SelectObject(ccdc, OldBmp));
DeleteDC(ccdc);
ReleaseDC(
0
, dc);
PostQuitMessage(
0
);
Exit;
end
;
end
;
Result:=DefWindowProc(Handle,Msg,WParam,LParam);
end
;