?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DirectDraw; // <-- 促撈泛飄 靛肺快 蠟粗撈 眠啊 登菌促.
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClick(Sender: TObject);
private
{ Private declarations }
FDDraw: IDirectDraw7;
public
{ Public declarations }
function InitDirectDraw(): LongBool;
procedure KillDirectDraw();
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.InitDirectDraw(): LongBool;
var
hr: HResult;
begin
Result := False;
// 促撈泛飄 靛肺快甫 積己
hr := DirectDrawCreateEx(nil, FDDraw, IID_IDirectDraw7, nil);
if hr <> DD_OK then // 府畔罐籃 藹撈 DD_OK啊 酒聰擱 俊礬.
Exit;
// 刀痢葛靛 汲瀝
// 傈眉拳擱 趣籃, 擴檔快 葛靛肺 積己俊 靜烙
hr := FDDraw.SetCooperativeLevel(Handle, DDSCL_FULLSCREEN or DDSCL_EXCLUSIVE);
if hr <> DD_OK then
Exit;
// 秦惑檔甫 官廁
hr := FDDraw.SetDisplayMode(640, 480, 16, 0, 0);
if hr <> DD_OK then
Exit;
Result := True;
end;
procedure TForm1.KillDirectDraw();
begin
// 積己等 按眉甸闌 副府令 矯挪促.
// 積己等 按眉甸籃 積己等 鑒輯 館措肺 副府令 矯難具 茄促.
if Pointer(FDDraw) <> nil then
begin
// 副府令
FDDraw._Release;
// 副府令竅絆, 葛電 按眉綽 nil肺 父甸絹 林絹具茄促.
Pointer(FDDraw) := nil;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// 傈眉 拳擱俊輯綽 坷弗率 蓋困(芒 農扁 煉例, 輛豐 滾瓢..)俊 滾瓢甸撈 鞘夸絕扁
// 錠鞏俊, 汽闌 None 屈怕肺 官層霖促.
BorderStyle := bsNone;
if not InitDirectDraw() then
begin
ShowMessage('傈眉拳擱 檬扁拳俊 角菩沁嚼聰促.');
// 橇肺弊伐 輛豐 矯虐扁
Application.Terminate;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
KillDirectDraw();
end;
procedure TForm1.FormClick(Sender: TObject);
begin
Close;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -