ホーム › Web.InternetExplorer › IEDeleteFile
IEDeleteFile
関数IE保護モードでファイルを削除する。
シグネチャ
// Ieframe.dll
#include <windows.h>
BOOL IEDeleteFile(
LPCWSTR lpFileName
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| lpFileName | LPCWSTR | in | 削除する対象ファイルの名前を指す文字列を指定する。 |
戻り値の型: BOOL
各言語での呼び出し定義
// Ieframe.dll
#include <windows.h>
BOOL IEDeleteFile(
LPCWSTR lpFileName
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("Ieframe.dll", ExactSpelling = true)]
static extern bool IEDeleteFile(
[MarshalAs(UnmanagedType.LPWStr)] string lpFileName // LPCWSTR
);<DllImport("Ieframe.dll", ExactSpelling:=True)>
Public Shared Function IEDeleteFile(
<MarshalAs(UnmanagedType.LPWStr)> lpFileName As String ' LPCWSTR
) As Boolean
End Function' lpFileName : LPCWSTR
Declare PtrSafe Function IEDeleteFile Lib "ieframe" ( _
ByVal lpFileName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
IEDeleteFile = ctypes.windll.ieframe.IEDeleteFile
IEDeleteFile.restype = wintypes.BOOL
IEDeleteFile.argtypes = [
wintypes.LPCWSTR, # lpFileName : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('Ieframe.dll')
IEDeleteFile = Fiddle::Function.new(
lib['IEDeleteFile'],
[
Fiddle::TYPE_VOIDP, # lpFileName : LPCWSTR
],
Fiddle::TYPE_INT)#[link(name = "ieframe")]
extern "system" {
fn IEDeleteFile(
lpFileName: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("Ieframe.dll")]
public static extern bool IEDeleteFile([MarshalAs(UnmanagedType.LPWStr)] string lpFileName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Ieframe_IEDeleteFile' -Namespace Win32 -PassThru
# $api::IEDeleteFile(lpFileName)#uselib "Ieframe.dll"
#func global IEDeleteFile "IEDeleteFile" sptr
; IEDeleteFile lpFileName ; 戻り値は stat
; lpFileName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "Ieframe.dll"
#cfunc global IEDeleteFile "IEDeleteFile" wstr
; res = IEDeleteFile(lpFileName)
; lpFileName : LPCWSTR -> "wstr"; BOOL IEDeleteFile(LPCWSTR lpFileName)
#uselib "Ieframe.dll"
#cfunc global IEDeleteFile "IEDeleteFile" wstr
; res = IEDeleteFile(lpFileName)
; lpFileName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ieframe = windows.NewLazySystemDLL("Ieframe.dll")
procIEDeleteFile = ieframe.NewProc("IEDeleteFile")
)
// lpFileName (LPCWSTR)
r1, _, err := procIEDeleteFile.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpFileName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction IEDeleteFile(
lpFileName: PWideChar // LPCWSTR
): BOOL; stdcall;
external 'Ieframe.dll' name 'IEDeleteFile';result := DllCall("Ieframe\IEDeleteFile"
, "WStr", lpFileName ; LPCWSTR
, "Int") ; return: BOOL●IEDeleteFile(lpFileName) = DLL("Ieframe.dll", "bool IEDeleteFile(char*)")
# 呼び出し: IEDeleteFile(lpFileName)
# lpFileName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。