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获取当前计算机所有盘符

Delphi 时间控制窗口标题栏文字或任务栏标题文字滚动

Delphi7调用Delphi xe2 中间层注意事项

datasnap 上传/下载大文件(本demo以图传片文件为例)

Delphi清空回收站

Delphi 遍历系统窗口标题可用于反外挂反破解

Delphi应用程序 paramstr()带有参数

Delphi vista以上系统的进程静音

Delphi 将自己的app.ico应用程序图表添加到dephi资源文件res中

Delphi char数组、string和pchar的相互转换

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



打赏

取消

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

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

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

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

评论

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