掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
CDを入れたドライブを取得してプログラムを実行するには? (ID:9258)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
CDドライブが一つならこれでいけるにゃ〜 複数なら全部のCDドライブの中のファイル探さにゃいとダメだにゃ〜 function GetCDRootDir: string; var DriveBits, BitMask : DWORD; i : Integer; begin result := 'A:\'; DriveBits := GetLogicalDrives; BitMask := 1; for i:=1 to 26 do begin if (DriveBits and BitMask) <> 0 then begin if GetDriveType(PChar(result)) = DRIVE_CDROM then break; end; BitMask := BitMask shl 1; Inc(result[1]); end; end; procedure TForm1.FormCreate(Sender: TObject); begin SystemParametersInfo (SPI_SETDESKWALLPAPER, 0, PChar(GetCDRootDir +'変更する壁紙.bmp'), SPIF_UPDATEINIFILE); end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.