var
DC,SaveDC:HDC;
SaveBitmap:HBITMAP;
Map:Cardinal;
// unwichtig
function WndProc(Win:HWND;uMsg:UINT;wParam:wParam;lParam:lParam):lResult;
stdcall;
var
P:Windows.TPoint;
begin
Result:=0;
case uMsg
of
WM_CREATE:
begin
DC:=GetDC(Win);
SaveDC:=CreateCompatibleDC(
DC);
SaveBitmap:=CreateBitmap(GetMapWidth(Map),GetMapHeight(Map),1,24,
nil);
SaveBitmap:=SelectObject(SaveDC,SaveBitmap);
DrawSmallMap(Map,SaveDC,0,0);
// irgendeine Graifik wird auf SaveDC gezeichnet
end;
WM_PAINT:BitBlt(
DC,(WindowWidth-GetMapWidth(Map))
div 2,(WindowHeight-GetMapHeight(Map))
div 2,GetMapWidth(Map),GetMapHeight(Map),SaveDC,0,0,SRCCOPY);
WM_MOUSEMOVE:
if wParam=1
then
begin
GetCursorPos(P);
MoveWindow(Win,P.X-WindowWidth
div 2,P.Y-WindowHeight
div 2,WindowWidth,WindowHeight,True);
end;
WM_DESTROY:
begin
DeleteObject(SaveBitmap);
DeleteDC(SaveDC);
ReleaseDC(Win,
DC);
PostQuitMessage(0);
end;
else Result:=DefWindowProc(Win,uMsg,wParam,lParam);
end;
end;