ILFindChild
関数親PIDL配下の子PIDLの位置を検索する。
シグネチャ
// SHELL32.dll
#include <windows.h>
ITEMIDLIST* ILFindChild(
ITEMIDLIST* pidlParent,
ITEMIDLIST* pidlChild
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pidlParent | ITEMIDLIST* | in |
| pidlChild | ITEMIDLIST* | in |
戻り値の型: ITEMIDLIST*
各言語での呼び出し定義
// SHELL32.dll
#include <windows.h>
ITEMIDLIST* ILFindChild(
ITEMIDLIST* pidlParent,
ITEMIDLIST* pidlChild
);[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern IntPtr ILFindChild(
IntPtr pidlParent, // ITEMIDLIST*
IntPtr pidlChild // ITEMIDLIST*
);<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function ILFindChild(
pidlParent As IntPtr, ' ITEMIDLIST*
pidlChild As IntPtr ' ITEMIDLIST*
) As IntPtr
End Function' pidlParent : ITEMIDLIST*
' pidlChild : ITEMIDLIST*
Declare PtrSafe Function ILFindChild Lib "shell32" ( _
ByVal pidlParent As LongPtr, _
ByVal pidlChild As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ILFindChild = ctypes.windll.shell32.ILFindChild
ILFindChild.restype = ctypes.c_void_p
ILFindChild.argtypes = [
ctypes.c_void_p, # pidlParent : ITEMIDLIST*
ctypes.c_void_p, # pidlChild : ITEMIDLIST*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
ILFindChild = Fiddle::Function.new(
lib['ILFindChild'],
[
Fiddle::TYPE_VOIDP, # pidlParent : ITEMIDLIST*
Fiddle::TYPE_VOIDP, # pidlChild : ITEMIDLIST*
],
Fiddle::TYPE_VOIDP)#[link(name = "shell32")]
extern "system" {
fn ILFindChild(
pidlParent: *mut ITEMIDLIST, // ITEMIDLIST*
pidlChild: *mut ITEMIDLIST // ITEMIDLIST*
) -> *mut ITEMIDLIST;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHELL32.dll")]
public static extern IntPtr ILFindChild(IntPtr pidlParent, IntPtr pidlChild);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_ILFindChild' -Namespace Win32 -PassThru
# $api::ILFindChild(pidlParent, pidlChild)#uselib "SHELL32.dll"
#func global ILFindChild "ILFindChild" sptr, sptr
; ILFindChild varptr(pidlParent), varptr(pidlChild) ; 戻り値は stat
; pidlParent : ITEMIDLIST* -> "sptr"
; pidlChild : ITEMIDLIST* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "SHELL32.dll" #cfunc global ILFindChild "ILFindChild" var, var ; res = ILFindChild(pidlParent, pidlChild) ; pidlParent : ITEMIDLIST* -> "var" ; pidlChild : ITEMIDLIST* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SHELL32.dll" #cfunc global ILFindChild "ILFindChild" sptr, sptr ; res = ILFindChild(varptr(pidlParent), varptr(pidlChild)) ; pidlParent : ITEMIDLIST* -> "sptr" ; pidlChild : ITEMIDLIST* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; ITEMIDLIST* ILFindChild(ITEMIDLIST* pidlParent, ITEMIDLIST* pidlChild) #uselib "SHELL32.dll" #cfunc global ILFindChild "ILFindChild" var, var ; res = ILFindChild(pidlParent, pidlChild) ; pidlParent : ITEMIDLIST* -> "var" ; pidlChild : ITEMIDLIST* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; ITEMIDLIST* ILFindChild(ITEMIDLIST* pidlParent, ITEMIDLIST* pidlChild) #uselib "SHELL32.dll" #cfunc global ILFindChild "ILFindChild" intptr, intptr ; res = ILFindChild(varptr(pidlParent), varptr(pidlChild)) ; pidlParent : ITEMIDLIST* -> "intptr" ; pidlChild : ITEMIDLIST* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procILFindChild = shell32.NewProc("ILFindChild")
)
// pidlParent (ITEMIDLIST*), pidlChild (ITEMIDLIST*)
r1, _, err := procILFindChild.Call(
uintptr(pidlParent),
uintptr(pidlChild),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // ITEMIDLIST*function ILFindChild(
pidlParent: Pointer; // ITEMIDLIST*
pidlChild: Pointer // ITEMIDLIST*
): Pointer; stdcall;
external 'SHELL32.dll' name 'ILFindChild';result := DllCall("SHELL32\ILFindChild"
, "Ptr", pidlParent ; ITEMIDLIST*
, "Ptr", pidlChild ; ITEMIDLIST*
, "Ptr") ; return: ITEMIDLIST*●ILFindChild(pidlParent, pidlChild) = DLL("SHELL32.dll", "void* ILFindChild(void*, void*)")
# 呼び出し: ILFindChild(pidlParent, pidlChild)
# pidlParent : ITEMIDLIST* -> "void*"
# pidlChild : ITEMIDLIST* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。