Delphi中启用禁止CD驱动器自动运行播放


本文整理自网络,侵删。

 

type
TAutoPlayForm = class(TForm)
chkNoAutoPlay: TCheckBox;
procedure FormCreate(Sender: TObject) ;
private
procedure WindowProcedure(var Msg : TMessage) ;
end;

var
AutoPlayForm: TAutoPlayForm;

Message_QueryCancelAutoPlay : Cardinal;

implementation

{$R *.dfm}

procedure TAutoPlayForm.WindowProcedure(var Msg: TMessage) ;
begin
if (Message_QueryCancelAutoPlay = Msg.Msg) then
begin
if chkNoAutoPlay.Checked then
Msg.Result := 1 //disable auto-play
else
// www.delphitop.com
Msg.Result := 0; //enable auto-play
end
else
inherited WndProc (Msg) ;
end;

procedure TAutoPlayForm.FormCreate(Sender: TObject) ;
begin
Self.WindowProc := WindowProcedure;

Message_QueryCancelAutoPlay := RegisterWindowMessage('QueryCancelAutoPlay') ;
end;

相关阅读 >>

Delphi文件 fileopen 、fileseek等的用法(看红色字体)

Delphi 使用 {$include} 或 {$i} 指令管理和调用自定义函数

Delphi pagecontrol不显示tab方式

Delphi twebbrowser流程讲解及如何判断下载网页成功

Delphi firemonkey应用程序取得控制的位置(坐标)的话

Delphi firedac 的recordcount 相关测试 记录

Delphi用mapfileandchecksum 函数检测 exe 或 dll 是否被修改

Delphi nativexml的中文支持

Delphi的datetostr strtodate格式灵活用法

Delphi 执行程序并等待完成2

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...