指定の拡張子と関連付けられている実行プログラム名を取得する
Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" _
(ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" _
(ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Integer
HINSTANCE FindExecutable(
LPCTSTR lpFile,
LPCTSTR lpDirectory,
LPTSTR lpResult
);
引数
lpFile
指定の拡張子を持つファイル名lpDirectory
デフォルトのディレクトリlpResult
vbNullStringを指定したときはカレントディレクトリ
(戻り値)プログラム名を受け取るバッファ戻り値
正常終了のとき 32以上サンプル
エラーのとき 31以下の定数
ダウンロード(FindExecutable.lzh 1.88KB)
0 メモリ不足
ERROR_FILE_NOT_FOUND = 2 ファイルが見つからない
ERROR_PATH_NOT_FOUND = 3 パスが見つからない
ERROR_BAD_FORMAT = 11 ファイルが無効
31 関連付けられているファイルがない