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

ShowPlayerPickerUI

関数
プレイヤーを選択するためのUIを表示する。
DLLapi-ms-win-gaming-tcui-l1-1-0.dll呼出規約winapi

シグネチャ

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

HRESULT ShowPlayerPickerUI(
    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
);

パラメーター

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

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT ShowPlayerPickerUI(
    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-0.dll", ExactSpelling = true)]
static extern int ShowPlayerPickerUI(
    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-0.dll", ExactSpelling:=True)>
Public Shared Function ShowPlayerPickerUI(
    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
' 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 ShowPlayerPickerUI Lib "api-ms-win-gaming-tcui-l1-1-0" ( _
    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

ShowPlayerPickerUI = ctypes.windll.LoadLibrary("api-ms-win-gaming-tcui-l1-1-0.dll").ShowPlayerPickerUI
ShowPlayerPickerUI.restype = ctypes.c_int
ShowPlayerPickerUI.argtypes = [
    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-0.dll')
ShowPlayerPickerUI = Fiddle::Function.new(
  lib['ShowPlayerPickerUI'],
  [
    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-0")]
extern "system" {
    fn ShowPlayerPickerUI(
        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-0.dll")]
public static extern int ShowPlayerPickerUI(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-0_ShowPlayerPickerUI' -Namespace Win32 -PassThru
# $api::ShowPlayerPickerUI(promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
#uselib "api-ms-win-gaming-tcui-l1-1-0.dll"
#func global ShowPlayerPickerUI "ShowPlayerPickerUI" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ShowPlayerPickerUI promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context   ; 戻り値は stat
; 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-0.dll"
#cfunc global ShowPlayerPickerUI "ShowPlayerPickerUI" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; res = ShowPlayerPickerUI(promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
; 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 ShowPlayerPickerUI(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-0.dll"
#cfunc global ShowPlayerPickerUI "ShowPlayerPickerUI" intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr
; res = ShowPlayerPickerUI(promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
; 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_0 = windows.NewLazySystemDLL("api-ms-win-gaming-tcui-l1-1-0.dll")
	procShowPlayerPickerUI = api_ms_win_gaming_tcui_l1_1_0.NewProc("ShowPlayerPickerUI")
)

// 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 := procShowPlayerPickerUI.Call(
	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 ShowPlayerPickerUI(
  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-0.dll' name 'ShowPlayerPickerUI';
result := DllCall("api-ms-win-gaming-tcui-l1-1-0\ShowPlayerPickerUI"
    , "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
●ShowPlayerPickerUI(promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context) = DLL("api-ms-win-gaming-tcui-l1-1-0.dll", "int ShowPlayerPickerUI(void*, void*, int, void*, int, int, int, void*, void*)")
# 呼び出し: ShowPlayerPickerUI(promptDisplayText, xuids, xuidsCount, preSelectedXuids, preSelectedXuidsCount, minSelectionCount, maxSelectionCount, completionRoutine, context)
# 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)。