=> 'Hak'
MkDir('New Folder') // '\New Folder' でも 'New Folder\'でもない
RootFolder : String; SelectFolder : String;
RootFolder := ''; SelectFolder := '';
if SelectDirectory('フォルダの指定', RootFolder, SelectFolder, [sdNewUI, sdNewFolder, sdShowEdit], Self) then begin MessageBox(Handle, PChar(SelectFolder), '選択フォルダ', MB_ICONINFORMATION); end;
セキュリティ面の強化を前提に、リムーバルドライブなどの外部装置へのファイル転送を監視したいと考えています。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
TForm1 = class(TForm) ListBox1: TListBox; private { Private 宣言 } public { Public 宣言 } procedure WmDevChange(var Mess: TMessage); message WM_DEVICECHANGE; end;
Form1: TForm1;
EMode := SetErrorMode(SEM_FAILCRITICALERRORS); try if DiskSize(Ord('A')-$40) <> -1 then ShowMessage('Disk in drive A: !') else ShowMessage('No disk in drive A: !'); finally SetErrorMode(EMode); end;