Win32 API 日本語リファレンス
ホームNetworking.WinInet › DeleteIE3Cache

DeleteIE3Cache

関数
IE3形式の古いキャッシュを削除する。
DLLWININET.dll呼出規約winapi

シグネチャ

// WININET.dll
#include <windows.h>

DWORD DeleteIE3Cache(
    HWND hwnd,
    HINSTANCE hinst,
    LPSTR lpszCmd,
    INT nCmdShow
);

パラメーター

名前方向
hwndHWNDin
hinstHINSTANCEin
lpszCmdLPSTRin
nCmdShowINTin

戻り値の型: DWORD

各言語での呼び出し定義

// WININET.dll
#include <windows.h>

DWORD DeleteIE3Cache(
    HWND hwnd,
    HINSTANCE hinst,
    LPSTR lpszCmd,
    INT nCmdShow
);
[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint DeleteIE3Cache(
    IntPtr hwnd,   // HWND
    IntPtr hinst,   // HINSTANCE
    [MarshalAs(UnmanagedType.LPStr)] string lpszCmd,   // LPSTR
    int nCmdShow   // INT
);
<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function DeleteIE3Cache(
    hwnd As IntPtr,   ' HWND
    hinst As IntPtr,   ' HINSTANCE
    <MarshalAs(UnmanagedType.LPStr)> lpszCmd As String,   ' LPSTR
    nCmdShow As Integer   ' INT
) As UInteger
End Function
' hwnd : HWND
' hinst : HINSTANCE
' lpszCmd : LPSTR
' nCmdShow : INT
Declare PtrSafe Function DeleteIE3Cache Lib "wininet" ( _
    ByVal hwnd As LongPtr, _
    ByVal hinst As LongPtr, _
    ByVal lpszCmd As String, _
    ByVal nCmdShow As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DeleteIE3Cache = ctypes.windll.wininet.DeleteIE3Cache
DeleteIE3Cache.restype = wintypes.DWORD
DeleteIE3Cache.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND
    wintypes.HANDLE,  # hinst : HINSTANCE
    wintypes.LPCSTR,  # lpszCmd : LPSTR
    ctypes.c_int,  # nCmdShow : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WININET.dll')
DeleteIE3Cache = Fiddle::Function.new(
  lib['DeleteIE3Cache'],
  [
    Fiddle::TYPE_VOIDP,  # hwnd : HWND
    Fiddle::TYPE_VOIDP,  # hinst : HINSTANCE
    Fiddle::TYPE_VOIDP,  # lpszCmd : LPSTR
    Fiddle::TYPE_INT,  # nCmdShow : INT
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wininet")]
extern "system" {
    fn DeleteIE3Cache(
        hwnd: *mut core::ffi::c_void,  // HWND
        hinst: *mut core::ffi::c_void,  // HINSTANCE
        lpszCmd: *mut u8,  // LPSTR
        nCmdShow: i32  // INT
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WININET.dll")]
public static extern uint DeleteIE3Cache(IntPtr hwnd, IntPtr hinst, [MarshalAs(UnmanagedType.LPStr)] string lpszCmd, int nCmdShow);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_DeleteIE3Cache' -Namespace Win32 -PassThru
# $api::DeleteIE3Cache(hwnd, hinst, lpszCmd, nCmdShow)
#uselib "WININET.dll"
#func global DeleteIE3Cache "DeleteIE3Cache" sptr, sptr, sptr, sptr
; DeleteIE3Cache hwnd, hinst, lpszCmd, nCmdShow   ; 戻り値は stat
; hwnd : HWND -> "sptr"
; hinst : HINSTANCE -> "sptr"
; lpszCmd : LPSTR -> "sptr"
; nCmdShow : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WININET.dll"
#cfunc global DeleteIE3Cache "DeleteIE3Cache" sptr, sptr, str, int
; res = DeleteIE3Cache(hwnd, hinst, lpszCmd, nCmdShow)
; hwnd : HWND -> "sptr"
; hinst : HINSTANCE -> "sptr"
; lpszCmd : LPSTR -> "str"
; nCmdShow : INT -> "int"
; DWORD DeleteIE3Cache(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmd, INT nCmdShow)
#uselib "WININET.dll"
#cfunc global DeleteIE3Cache "DeleteIE3Cache" intptr, intptr, str, int
; res = DeleteIE3Cache(hwnd, hinst, lpszCmd, nCmdShow)
; hwnd : HWND -> "intptr"
; hinst : HINSTANCE -> "intptr"
; lpszCmd : LPSTR -> "str"
; nCmdShow : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procDeleteIE3Cache = wininet.NewProc("DeleteIE3Cache")
)

// hwnd (HWND), hinst (HINSTANCE), lpszCmd (LPSTR), nCmdShow (INT)
r1, _, err := procDeleteIE3Cache.Call(
	uintptr(hwnd),
	uintptr(hinst),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszCmd))),
	uintptr(nCmdShow),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function DeleteIE3Cache(
  hwnd: THandle;   // HWND
  hinst: THandle;   // HINSTANCE
  lpszCmd: PAnsiChar;   // LPSTR
  nCmdShow: Integer   // INT
): DWORD; stdcall;
  external 'WININET.dll' name 'DeleteIE3Cache';
result := DllCall("WININET\DeleteIE3Cache"
    , "Ptr", hwnd   ; HWND
    , "Ptr", hinst   ; HINSTANCE
    , "AStr", lpszCmd   ; LPSTR
    , "Int", nCmdShow   ; INT
    , "UInt")   ; return: DWORD
●DeleteIE3Cache(hwnd, hinst, lpszCmd, nCmdShow) = DLL("WININET.dll", "dword DeleteIE3Cache(void*, void*, char*, int)")
# 呼び出し: DeleteIE3Cache(hwnd, hinst, lpszCmd, nCmdShow)
# hwnd : HWND -> "void*"
# hinst : HINSTANCE -> "void*"
# lpszCmd : LPSTR -> "char*"
# nCmdShow : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。