Win32 API 日本語リファレンス
ホームGaming › ShowPlayerPickerUIForUser

ShowPlayerPickerUIForUser

関数
指定ユーザー向けにプレイヤー選択UIを表示する。
DLLapi-ms-win-gaming-tcui-l1-1-2.dll呼出規約winapi

シグネチャ

// api-ms-win-gaming-tcui-l1-1-2.dll
#include <windows.h>

HRESULT ShowPlayerPickerUIForUser(
    IInspectable* user,
    HSTRING promptDisplayText,
    const HSTRING* xuids,
    UINT_PTR xuidsCount,
    const HSTRING* preSelectedXuids,   // optional
    UINT_PTR preSelectedXuidsCount,
    UINT_PTR minSelectionCount,
    UINT_PTR maxSelectionCount,
    PlayerPickerUICompletionRoutine completionRoutine,
    void* context   // optional
);

パラメーター

名前方向
userIInspectable*in
promptDisplayTextHSTRINGin
xuidsHSTRING*in
xuidsCountUINT_PTRin
preSelectedXuidsHSTRING*inoptional
preSelectedXuidsCountUINT_PTRin
minSelectionCountUINT_PTRin
maxSelectionCountUINT_PTRin
completionRoutinePlayerPickerUICompletionRoutinein
contextvoid*inoptional

戻り値の型: HRESULT

各言語での呼び出し定義

// api-ms-win-gaming-tcui-l1-1-2.dll
#include <windows.h>

HRESULT ShowPlayerPickerUIForUser(
    IInspectable* user,
    HSTRING promptDisplayText,
    const HSTRING* xuids,
    UINT_PTR xuidsCount,
    const HSTRING* preSelectedXuids,   // optional
    UINT_PTR preSelectedXuidsCount,
    UINT_PTR minSelectionCount,
    UINT_PTR maxSelectionCount,
    PlayerPickerUICompletionRoutine completionRoutine,
    void* context   // optional
);
[DllImport("api-ms-win-gaming-tcui-l1-1-2.dll", ExactSpelling = true)]
static extern int ShowPlayerPickerUIForUser(
    IntPtr user,   // IInspectable*
    IntPtr promptDisplayText,   // HSTRING
    IntPtr xuids,   // HSTRING*
    UIntPtr xuidsCount,   // UINT_PTR
    IntPtr preSelectedXuids,   // HSTRING* optional
    UIntPtr preSelectedXuidsCount,   // UINT_PTR
    UIntPtr minSelectionCount,   // UINT_PTR
    UIntPtr maxSelectionCount,   // UINT_PTR
    IntPtr completionRoutine,   // PlayerPickerUICompletionRoutine
    IntPtr context   // void* optional
);
<DllImport("api-ms-win-gaming-tcui-l1-1-2.dll", ExactSpelling:=True)>
Public Shared Function ShowPlayerPickerUIForUser(
    user As IntPtr,   ' IInspectable*
    promptDisplayText As IntPtr,   ' HSTRING
    xuids As IntPtr,   ' HSTRING*
    xuidsCount As UIntPtr,   ' UINT_PTR
    preSelectedXuids As IntPtr,   ' HSTRING* optional
    preSelectedXuidsCount As UIntPtr,   ' UINT_PTR
    minSelectionCount As UIntPtr,   ' UINT_PTR
    maxSelectionCount As UIntPtr,   ' UINT_PTR
    completionRoutine As IntPtr,   ' PlayerPickerUICompletionRoutine
    context As IntPtr   ' void* optional
) As Integer
End Function
' user : IInspectable*
' promptDisplayText : HSTRING
' xuids : HSTRING*
' xuidsCount : UINT_PTR
' preSelectedXuids : HSTRING* optional
' preSelectedXuidsCount : UINT_PTR
' minSelectionCount : UINT_PTR
' maxSelectionCount : UINT_PTR
' completionRoutine : PlayerPickerUICompletionRoutine
' context : void* optional
Declare PtrSafe Function ShowPlayerPickerUIForUser Lib "api-ms-win-gaming-tcui-l1-1-2" ( _
    ByVal user As LongPtr, _
    ByVal promptDisplayText As LongPtr, _
    ByVal xuids As LongPtr, _
    ByVal xuidsCount As LongPtr, _
    ByVal preSelectedXuids As LongPtr, _
    ByVal preSelectedXuidsCount As LongPtr, _
    ByVal minSelectionCount As LongPtr, _
    ByVal maxSelectionCount As LongPtr, _
    ByVal completionRoutine As LongPtr, _
    ByVal context As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ShowPlayerPickerUIForUser = ctypes.windll.LoadLibrary("api-ms-win-gaming-tcui-l1-1-2.dll").ShowPlayerPickerUIForUser
ShowPlayerPickerUIForUser.restype = ctypes.c_int
ShowPlayerPickerUIForUser.argtypes = [
    ctypes.c_void_p,  # user : IInspectable*
    wintypes.HANDLE,  # promptDisplayText : HSTRING
    ctypes.c_void_p,  # xuids : HSTRING*
    ctypes.c_size_t,  # xuidsCount : UINT_PTR
    ctypes.c_void_p,  # preSelectedXuids : HSTRING* optional
    ctypes.c_size_t,  # preSelectedXuidsCount : UINT_PTR
    ctypes.c_size_t,  # minSelectionCount : UINT_PTR
    ctypes.c_size_t,  # maxSelectionCount : UINT_PTR
    ctypes.c_void_p,  # completionRoutine : PlayerPickerUICompletionRoutine
    ctypes.POINTER(None),  # context : void* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-gaming-tcui-l1-1-2.dll')
ShowPlayerPickerUIForUser = Fiddle::Function.new(
  lib['ShowPlayerPickerUIForUser'],
  [
    Fiddle::TYPE_VOIDP,  # user : IInspectable*
    Fiddle::TYPE_VOIDP,  # promptDisplayText : HSTRING
    Fiddle::TYPE_VOIDP,  # xuids : HSTRING*
    Fiddle::TYPE_UINTPTR_T,  # xuidsCount : UINT_PTR
    Fiddle::TYPE_VOIDP,  # preSelectedXuids : HSTRING* optional
    Fiddle::TYPE_UINTPTR_T,  # preSelectedXuidsCount : UINT_PTR
    Fiddle::TYPE_UINTPTR_T,  # minSelectionCount : UINT_PTR
    Fiddle::TYPE_UINTPTR_T,  # maxSelectionCount : UINT_PTR
    Fiddle::TYPE_VOIDP,  # completionRoutine : PlayerPickerUICompletionRoutine
    Fiddle::TYPE_VOIDP,  # context : void* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-gaming-tcui-l1-1-2")]
extern "system" {
    fn ShowPlayerPickerUIForUser(
        user: *mut core::ffi::c_void,  // IInspectable*
        promptDisplayText: *mut core::ffi::c_void,  // HSTRING
        xuids: *mut *mut core::ffi::c_void,  // HSTRING*
        xuidsCount: usize,  // UINT_PTR
        preSelectedXuids: *mut *mut core::ffi::c_void,  // HSTRING* optional
        preSelectedXuidsCount: usize,  // UINT_PTR
        minSelectionCount: usize,  // UINT_PTR
        maxSelectionCount: usize,  // UINT_PTR
        completionRoutine: *const core::ffi::c_void,  // PlayerPickerUICompletionRoutine
        context: *mut ()  // void* optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("api-ms-win-gaming-tcui-l1-1-2.dll")]
public static extern int ShowPlayerPickerUIForUser(IntPtr user, IntPtr promptDisplayText, IntPtr xuids, UIntPtr xuidsCount, IntPtr preSelectedXuids, UIntPtr preSelectedXuidsCount, UIntPtr minSelectionCount, UIntPtr maxSelectionCount, IntPtr completionRoutine, IntPtr context);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-gaming-tcui-l1-1-2_ShowPlayerPickerUIForUser' -Namespace Win32 -PassThru
# $api::ShowPlayerPickerUIForUser(user, promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
#uselib "api-ms-win-gaming-tcui-l1-1-2.dll"
#func global ShowPlayerPickerUIForUser "ShowPlayerPickerUIForUser" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ShowPlayerPickerUIForUser user, promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context   ; 戻り値は stat
; user : IInspectable* -> "sptr"
; promptDisplayText : HSTRING -> "sptr"
; xuids : HSTRING* -> "sptr"
; xuidsCount : UINT_PTR -> "sptr"
; preSelectedXuids : HSTRING* optional -> "sptr"
; preSelectedXuidsCount : UINT_PTR -> "sptr"
; minSelectionCount : UINT_PTR -> "sptr"
; maxSelectionCount : UINT_PTR -> "sptr"
; completionRoutine : PlayerPickerUICompletionRoutine -> "sptr"
; context : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-gaming-tcui-l1-1-2.dll"
#cfunc global ShowPlayerPickerUIForUser "ShowPlayerPickerUIForUser" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; res = ShowPlayerPickerUIForUser(user, promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
; user : IInspectable* -> "sptr"
; promptDisplayText : HSTRING -> "sptr"
; xuids : HSTRING* -> "sptr"
; xuidsCount : UINT_PTR -> "sptr"
; preSelectedXuids : HSTRING* optional -> "sptr"
; preSelectedXuidsCount : UINT_PTR -> "sptr"
; minSelectionCount : UINT_PTR -> "sptr"
; maxSelectionCount : UINT_PTR -> "sptr"
; completionRoutine : PlayerPickerUICompletionRoutine -> "sptr"
; context : void* optional -> "sptr"
; HRESULT ShowPlayerPickerUIForUser(IInspectable* user, HSTRING promptDisplayText, HSTRING* xuids, UINT_PTR xuidsCount, HSTRING* preSelectedXuids, UINT_PTR preSelectedXuidsCount, UINT_PTR minSelectionCount, UINT_PTR maxSelectionCount, PlayerPickerUICompletionRoutine completionRoutine, void* context)
#uselib "api-ms-win-gaming-tcui-l1-1-2.dll"
#cfunc global ShowPlayerPickerUIForUser "ShowPlayerPickerUIForUser" intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr
; res = ShowPlayerPickerUIForUser(user, promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
; user : IInspectable* -> "intptr"
; promptDisplayText : HSTRING -> "intptr"
; xuids : HSTRING* -> "intptr"
; xuidsCount : UINT_PTR -> "intptr"
; preSelectedXuids : HSTRING* optional -> "intptr"
; preSelectedXuidsCount : UINT_PTR -> "intptr"
; minSelectionCount : UINT_PTR -> "intptr"
; maxSelectionCount : UINT_PTR -> "intptr"
; completionRoutine : PlayerPickerUICompletionRoutine -> "intptr"
; context : void* optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_gaming_tcui_l1_1_2 = windows.NewLazySystemDLL("api-ms-win-gaming-tcui-l1-1-2.dll")
	procShowPlayerPickerUIForUser = api_ms_win_gaming_tcui_l1_1_2.NewProc("ShowPlayerPickerUIForUser")
)

// user (IInspectable*), promptDisplayText (HSTRING), xuids (HSTRING*), xuidsCount (UINT_PTR), preSelectedXuids (HSTRING* optional), preSelectedXuidsCount (UINT_PTR), minSelectionCount (UINT_PTR), maxSelectionCount (UINT_PTR), completionRoutine (PlayerPickerUICompletionRoutine), context (void* optional)
r1, _, err := procShowPlayerPickerUIForUser.Call(
	uintptr(user),
	uintptr(promptDisplayText),
	uintptr(xuids),
	uintptr(xuidsCount),
	uintptr(preSelectedXuids),
	uintptr(preSelectedXuidsCount),
	uintptr(minSelectionCount),
	uintptr(maxSelectionCount),
	uintptr(completionRoutine),
	uintptr(context),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function ShowPlayerPickerUIForUser(
  user: Pointer;   // IInspectable*
  promptDisplayText: THandle;   // HSTRING
  xuids: Pointer;   // HSTRING*
  xuidsCount: NativeUInt;   // UINT_PTR
  preSelectedXuids: Pointer;   // HSTRING* optional
  preSelectedXuidsCount: NativeUInt;   // UINT_PTR
  minSelectionCount: NativeUInt;   // UINT_PTR
  maxSelectionCount: NativeUInt;   // UINT_PTR
  completionRoutine: Pointer;   // PlayerPickerUICompletionRoutine
  context: Pointer   // void* optional
): Integer; stdcall;
  external 'api-ms-win-gaming-tcui-l1-1-2.dll' name 'ShowPlayerPickerUIForUser';
result := DllCall("api-ms-win-gaming-tcui-l1-1-2\ShowPlayerPickerUIForUser"
    , "Ptr", user   ; IInspectable*
    , "Ptr", promptDisplayText   ; HSTRING
    , "Ptr", xuids   ; HSTRING*
    , "UPtr", xuidsCount   ; UINT_PTR
    , "Ptr", preSelectedXuids   ; HSTRING* optional
    , "UPtr", preSelectedXuidsCount   ; UINT_PTR
    , "UPtr", minSelectionCount   ; UINT_PTR
    , "UPtr", maxSelectionCount   ; UINT_PTR
    , "Ptr", completionRoutine   ; PlayerPickerUICompletionRoutine
    , "Ptr", context   ; void* optional
    , "Int")   ; return: HRESULT
●ShowPlayerPickerUIForUser(user, promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context) = DLL("api-ms-win-gaming-tcui-l1-1-2.dll", "int ShowPlayerPickerUIForUser(void*, void*, void*, int, void*, int, int, int, void*, void*)")
# 呼び出し: ShowPlayerPickerUIForUser(user, promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
# user : IInspectable* -> "void*"
# promptDisplayText : HSTRING -> "void*"
# xuids : HSTRING* -> "void*"
# xuidsCount : UINT_PTR -> "int"
# preSelectedXuids : HSTRING* optional -> "void*"
# preSelectedXuidsCount : UINT_PTR -> "int"
# minSelectionCount : UINT_PTR -> "int"
# maxSelectionCount : UINT_PTR -> "int"
# completionRoutine : PlayerPickerUICompletionRoutine -> "void*"
# context : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。