Win32 API 日本語リファレンス
ホームUI.Shell › FileIconInit

FileIconInit

関数
シェルのファイルアイコンキャッシュを初期化する。
DLLSHELL32.dllエントリ#660呼出規約winapi

シグネチャ

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

BOOL FileIconInit(
    BOOL fRestoreCache
);

パラメーター

名前方向
fRestoreCacheBOOLin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL FileIconInit(
    BOOL fRestoreCache
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern bool FileIconInit(
    bool fRestoreCache   // BOOL
);
<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function FileIconInit(
    fRestoreCache As Boolean   ' BOOL
) As Boolean
End Function
' fRestoreCache : BOOL
Declare PtrSafe Function FileIconInit Lib "shell32" Alias "#660" ( _
    ByVal fRestoreCache As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FileIconInit = ctypes.windll.shell32.FileIconInit
FileIconInit.restype = wintypes.BOOL
FileIconInit.argtypes = [
    wintypes.BOOL,  # fRestoreCache : BOOL
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHELL32.dll')
FileIconInit = Fiddle::Function.new(
  lib['#660'],
  [
    Fiddle::TYPE_INT,  # fRestoreCache : BOOL
  ],
  Fiddle::TYPE_INT)
#[link(name = "shell32")]
extern "system" {
    fn FileIconInit(
        fRestoreCache: i32  // BOOL
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHELL32.dll")]
public static extern bool FileIconInit(bool fRestoreCache);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_FileIconInit' -Namespace Win32 -PassThru
# $api::FileIconInit(fRestoreCache)
#uselib "SHELL32.dll"
#func global FileIconInit "#660" sptr
; FileIconInit fRestoreCache   ; 戻り値は stat
; fRestoreCache : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SHELL32.dll"
#cfunc global FileIconInit "#660" int
; res = FileIconInit(fRestoreCache)
; fRestoreCache : BOOL -> "int"
; BOOL FileIconInit(BOOL fRestoreCache)
#uselib "SHELL32.dll"
#cfunc global FileIconInit "#660" int
; res = FileIconInit(fRestoreCache)
; fRestoreCache : BOOL -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shell32 = windows.NewLazySystemDLL("SHELL32.dll")
	procFileIconInit = shell32.NewProc("#660")
)

// fRestoreCache (BOOL)
r1, _, err := procFileIconInit.Call(
	uintptr(fRestoreCache),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function FileIconInit(
  fRestoreCache: BOOL   // BOOL
): BOOL; stdcall;
  external 'SHELL32.dll' name '#660';
result := DllCall("SHELL32\#660"
    , "Int", fRestoreCache   ; BOOL
    , "Int")   ; return: BOOL
●FileIconInit(fRestoreCache) = DLL("SHELL32.dll", "bool #660(bool)")
# 呼び出し: FileIconInit(fRestoreCache)
# fRestoreCache : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。