It works.. i have written the following message handler:

[pascal]
function TBF_CustomEngine.WndProc(hWnd,Msg,wParam,lParam:In teger): integer;
begin
case Msg of
WM_ACTIVATEAPP : begin
fFocus := Boolean(wParam);
if fFocus then
begin
//has focus
//Log('>>>Application activated');
ShowCursor(false);
end else begin
//has no focus
//Log('>>>Application deactivated');
ShowCursor(true);
end;
end;

WM_TIMER: begin
//FPS update only when game has focus
fUpdateFPS := true;
end;

WM_CLOSE: begin
{WM_CLOSE quit's rendering loop
all resources and devices will be destroyed in
BF_Core's destructor wich is called when BF_Core.Run ended}
PostQuitMessage(0);
Exit;
end;
WM_SYSKEYDOWN: begin
//ProcessKeyDown(wparam, lparam);
Result := 0;
Exit;
end;
WM_SYSKEYUP: begin
//ProcessKeyUp(wparam, lparam);
Result := 0;
Exit;
end;
end;

Result := DefWindowProc(hWnd,Msg,wParam,lParam);
end;
[/pascal]

I had to add the "exit;" statements because else the "defwindowProc" would be executed anyway.

Thanx for your help