Delphi U盘插入拨出检测
Delphi U盘插入拨出检测:
1、新建工程;
2、在form1上放一个Label;
3、定义一个私有过程
procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;
完整代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, AppEvnts, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
private
{ Private declarations }
procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMDeviceChange (var Msg: TMessage);
var
myMsg : String;
begin
Case Msg.WParam of
32768:
begin
myMsg :='U盘插入';
Label1.Caption:=myMsg
end;
32772:
begin
myMsg :='U盘拔出';
Label1.Caption:=myMsg;
end;
end;
end;
end.
相关文档:
Delphi从6.0就开始支持Web Services的开发和应用了,本文通过使用Delphi 7.0调用新浪发送短信的Web Service进行短信应用程序开发这一实例详细的介绍在Delphi中如何开发基于Web Services的应用系统。
第一步,准备工作,了解新浪短信Web Service。新浪发送短信的Web Service地址是http://smsinter.sina.com.cn/ws/smswebs ......
exit: 退出函数体
abort: 遇到异常,安静处理,就是不显示不提示
break: 退出当前循环体,包括for ,while, repeat等循环体
continue: 结束循环内的本次处理,继续从循环体的开始位置继续执行
Exit 是跳出当前代码块,也就是当前函数,跳出后是要继续向下执行的(如果有后续代码)。
Abort 是从 EAbort 过来的,可以激发 ex ......
procedure TForm2.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Screen.Cursor := -2;
end;
const
crDefault = TCursor(0);
crNone = TCursor(-1);
crArrow = TCursor(-2);
&n ......
Delphi TStream 详细介绍
Stream对象,又称流式对象,是TStream、THandleStream、TFileStream、TMemoryStream、TResourceStream和TBlobStream等的统称。它们分别代表了在各种媒介上存储数据的能力,它们将各种数据类型(包括对象和部件)
在内存、外存和数据库字段中的管理操作抽象为对象方法,并且充分利用了面向对 ......