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