If I use the Windowed mode, everything OK. But when I switch to full screen mode, several seconds later, the computer crashed! Not every time, but the frequency is very high. It's very strange. Could someone tell me the reason? Lifepower?;-)

The Powerdraw initializing code here:

// initialize powerdraw
PowerDraw := TPowerDraw.Create(FVclForm);
PowerDraw.Width := 640;
PowerDraw.Height := 480;
PowerDraw.BitDepth := bd32;
PowerDraw.OnInitDevice := PowerDrawInitDevice;
PowerDraw.OnDoneDevice := PowerDrawDoneDevice;
PowerDraw.Initialize;
...

And the full screen switch code here:

procedure TDXApplication.FullScreen;
begin
// finalize video mode
PowerDraw.DoneDevice;
// switch windowed mode
PowerDraw.Windowed := not PowerDraw.Windowed;
// change border style
if PowerDraw.Windowed then FVclForm.BorderStyle:= bsSingle
else FVclForm.BorderStyle:= bsNone;
// TForm tends to change its size
FVclForm.ClientWidth := PowerDraw.Width;
FVclForm.ClientHeight := PowerDraw.Height;
// re-initialize video mode
PowerDraw.InitDevice;
end;