procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;procedure TF_main.WMDeviceChange(var Msg: TMessage);var myMsg : String;begin Case Msg.WParam of 32768: begin myMsg :='U盘插入'; MessageBox(0,'注意!U盘已插入!!!','AutoCopy Information',MB_ICONASTERISK and MB_ICONINFORMATION); end; 32772: begin myMsg :='U盘拔出'; MessageBox(0,'注意!U盘已取走!!!','AutoCopy Information',MB_ICONASTERISK and MB_ICONINFORMATION); end; end;end;