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

ShowProfileCardUI

関数
指定ユーザーのプロフィールカードUIを表示する。
DLLapi-ms-win-gaming-tcui-l1-1-0.dll呼出規約winapi

シグネチャ

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

HRESULT ShowProfileCardUI(
    HSTRING targetUserXuid,
    GameUICompletionRoutine completionRoutine,
    void* context   // optional
);

パラメーター

名前方向説明
targetUserXuidHSTRINGinプロフィールカードを表示する対象ユーザーのXUIDを表すHSTRING。
completionRoutineGameUICompletionRoutineinUI完了時に呼ばれるコールバック関数。NULL可。
contextvoid*inoptionalコールバックへ渡されるユーザー定義コンテキスト。NULL可。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT ShowProfileCardUI(
    HSTRING targetUserXuid,
    GameUICompletionRoutine completionRoutine,
    void* context   // optional
);
[DllImport("api-ms-win-gaming-tcui-l1-1-0.dll", ExactSpelling = true)]
static extern int ShowProfileCardUI(
    IntPtr targetUserXuid,   // HSTRING
    IntPtr completionRoutine,   // GameUICompletionRoutine
    IntPtr context   // void* optional
);
<DllImport("api-ms-win-gaming-tcui-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function ShowProfileCardUI(
    targetUserXuid As IntPtr,   ' HSTRING
    completionRoutine As IntPtr,   ' GameUICompletionRoutine
    context As IntPtr   ' void* optional
) As Integer
End Function
' targetUserXuid : HSTRING
' completionRoutine : GameUICompletionRoutine
' context : void* optional
Declare PtrSafe Function ShowProfileCardUI Lib "api-ms-win-gaming-tcui-l1-1-0" ( _
    ByVal targetUserXuid 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

ShowProfileCardUI = ctypes.windll.LoadLibrary("api-ms-win-gaming-tcui-l1-1-0.dll").ShowProfileCardUI
ShowProfileCardUI.restype = ctypes.c_int
ShowProfileCardUI.argtypes = [
    wintypes.HANDLE,  # targetUserXuid : HSTRING
    ctypes.c_void_p,  # completionRoutine : GameUICompletionRoutine
    ctypes.POINTER(None),  # context : void* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-gaming-tcui-l1-1-0.dll')
ShowProfileCardUI = Fiddle::Function.new(
  lib['ShowProfileCardUI'],
  [
    Fiddle::TYPE_VOIDP,  # targetUserXuid : HSTRING
    Fiddle::TYPE_VOIDP,  # completionRoutine : GameUICompletionRoutine
    Fiddle::TYPE_VOIDP,  # context : void* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-gaming-tcui-l1-1-0")]
extern "system" {
    fn ShowProfileCardUI(
        targetUserXuid: *mut core::ffi::c_void,  // HSTRING
        completionRoutine: *const core::ffi::c_void,  // GameUICompletionRoutine
        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 ShowProfileCardUI(IntPtr targetUserXuid, IntPtr completionRoutine, IntPtr context);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-gaming-tcui-l1-1-0_ShowProfileCardUI' -Namespace Win32 -PassThru
# $api::ShowProfileCardUI(targetUserXuid, completionRoutine, context)
#uselib "api-ms-win-gaming-tcui-l1-1-0.dll"
#func global ShowProfileCardUI "ShowProfileCardUI" sptr, sptr, sptr
; ShowProfileCardUI targetUserXuid, completionRoutine, context   ; 戻り値は stat
; targetUserXuid : HSTRING -> "sptr"
; completionRoutine : GameUICompletionRoutine -> "sptr"
; context : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-gaming-tcui-l1-1-0.dll"
#cfunc global ShowProfileCardUI "ShowProfileCardUI" sptr, sptr, sptr
; res = ShowProfileCardUI(targetUserXuid, completionRoutine, context)
; targetUserXuid : HSTRING -> "sptr"
; completionRoutine : GameUICompletionRoutine -> "sptr"
; context : void* optional -> "sptr"
; HRESULT ShowProfileCardUI(HSTRING targetUserXuid, GameUICompletionRoutine completionRoutine, void* context)
#uselib "api-ms-win-gaming-tcui-l1-1-0.dll"
#cfunc global ShowProfileCardUI "ShowProfileCardUI" intptr, intptr, intptr
; res = ShowProfileCardUI(targetUserXuid, completionRoutine, context)
; targetUserXuid : HSTRING -> "intptr"
; completionRoutine : GameUICompletionRoutine -> "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")
	procShowProfileCardUI = api_ms_win_gaming_tcui_l1_1_0.NewProc("ShowProfileCardUI")
)

// targetUserXuid (HSTRING), completionRoutine (GameUICompletionRoutine), context (void* optional)
r1, _, err := procShowProfileCardUI.Call(
	uintptr(targetUserXuid),
	uintptr(completionRoutine),
	uintptr(context),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function ShowProfileCardUI(
  targetUserXuid: THandle;   // HSTRING
  completionRoutine: Pointer;   // GameUICompletionRoutine
  context: Pointer   // void* optional
): Integer; stdcall;
  external 'api-ms-win-gaming-tcui-l1-1-0.dll' name 'ShowProfileCardUI';
result := DllCall("api-ms-win-gaming-tcui-l1-1-0\ShowProfileCardUI"
    , "Ptr", targetUserXuid   ; HSTRING
    , "Ptr", completionRoutine   ; GameUICompletionRoutine
    , "Ptr", context   ; void* optional
    , "Int")   ; return: HRESULT
●ShowProfileCardUI(targetUserXuid, completionRoutine, context) = DLL("api-ms-win-gaming-tcui-l1-1-0.dll", "int ShowProfileCardUI(void*, void*, void*)")
# 呼び出し: ShowProfileCardUI(targetUserXuid, completionRoutine, context)
# targetUserXuid : HSTRING -> "void*"
# completionRoutine : GameUICompletionRoutine -> "void*"
# context : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "api-ms-win-gaming-tcui-l1-1-0" fn ShowProfileCardUI(
    targetUserXuid: ?*anyopaque, // HSTRING
    completionRoutine: ?*anyopaque, // GameUICompletionRoutine
    context: ?*anyopaque // void* optional
) callconv(std.os.windows.WINAPI) i32;
proc ShowProfileCardUI(
    targetUserXuid: pointer,  # HSTRING
    completionRoutine: pointer,  # GameUICompletionRoutine
    context: pointer  # void* optional
): int32 {.importc: "ShowProfileCardUI", stdcall, dynlib: "api-ms-win-gaming-tcui-l1-1-0.dll".}
pragma(lib, "api-ms-win-gaming-tcui-l1-1-0");
extern(Windows)
int ShowProfileCardUI(
    void* targetUserXuid,   // HSTRING
    void* completionRoutine,   // GameUICompletionRoutine
    void* context   // void* optional
);
ccall((:ShowProfileCardUI, "api-ms-win-gaming-tcui-l1-1-0.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
      targetUserXuid, completionRoutine, context)
# targetUserXuid : HSTRING -> Ptr{Cvoid}
# completionRoutine : GameUICompletionRoutine -> Ptr{Cvoid}
# context : void* optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t ShowProfileCardUI(
    void* targetUserXuid,
    void* completionRoutine,
    void* context);
]]
local api-ms-win-gaming-tcui-l1-1-0 = ffi.load("api-ms-win-gaming-tcui-l1-1-0")
-- api-ms-win-gaming-tcui-l1-1-0.ShowProfileCardUI(targetUserXuid, completionRoutine, context)
-- targetUserXuid : HSTRING
-- completionRoutine : GameUICompletionRoutine
-- context : void* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('api-ms-win-gaming-tcui-l1-1-0.dll');
const ShowProfileCardUI = lib.func('__stdcall', 'ShowProfileCardUI', 'int32_t', ['void *', 'void *', 'void *']);
// ShowProfileCardUI(targetUserXuid, completionRoutine, context)
// targetUserXuid : HSTRING -> 'void *'
// completionRoutine : GameUICompletionRoutine -> 'void *'
// context : void* optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
// コールバック(関数ポインタ)は koffi.proto/koffi.register で型を定義して渡す(素の void* では JS 関数を渡せない)。
const lib = Deno.dlopen("api-ms-win-gaming-tcui-l1-1-0.dll", {
  ShowProfileCardUI: { parameters: ["pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.ShowProfileCardUI(targetUserXuid, completionRoutine, context)
// targetUserXuid : HSTRING -> "pointer"
// completionRoutine : GameUICompletionRoutine -> "pointer"
// context : void* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t ShowProfileCardUI(
    void* targetUserXuid,
    void* completionRoutine,
    void* context);
C, "api-ms-win-gaming-tcui-l1-1-0.dll");
// $ffi->ShowProfileCardUI(targetUserXuid, completionRoutine, context);
// targetUserXuid : HSTRING
// completionRoutine : GameUICompletionRoutine
// context : void* optional
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Api-ms-win-gaming-tcui-l1-1-0 extends StdCallLibrary {
    Api-ms-win-gaming-tcui-l1-1-0 INSTANCE = Native.load("api-ms-win-gaming-tcui-l1-1-0", Api-ms-win-gaming-tcui-l1-1-0.class);
    int ShowProfileCardUI(
        Pointer targetUserXuid,   // HSTRING
        Callback completionRoutine,   // GameUICompletionRoutine
        Pointer context   // void* optional
    );
}
@[Link("api-ms-win-gaming-tcui-l1-1-0")]
lib Libapi-ms-win-gaming-tcui-l1-1-0
  fun ShowProfileCardUI = ShowProfileCardUI(
    targetUserXuid : Void*,   # HSTRING
    completionRoutine : Void*,   # GameUICompletionRoutine
    context : Void*   # void* optional
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ShowProfileCardUINative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>);
typedef ShowProfileCardUIDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>);
final ShowProfileCardUI = DynamicLibrary.open('api-ms-win-gaming-tcui-l1-1-0.dll')
    .lookupFunction<ShowProfileCardUINative, ShowProfileCardUIDart>('ShowProfileCardUI');
// targetUserXuid : HSTRING -> Pointer<Void>
// completionRoutine : GameUICompletionRoutine -> Pointer<Void>
// context : void* optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ShowProfileCardUI(
  targetUserXuid: THandle;   // HSTRING
  completionRoutine: Pointer;   // GameUICompletionRoutine
  context: Pointer   // void* optional
): Integer; stdcall;
  external 'api-ms-win-gaming-tcui-l1-1-0.dll' name 'ShowProfileCardUI';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "ShowProfileCardUI"
  c_ShowProfileCardUI :: Ptr () -> Ptr () -> Ptr () -> IO Int32
-- targetUserXuid : HSTRING -> Ptr ()
-- completionRoutine : GameUICompletionRoutine -> Ptr ()
-- context : void* optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let showprofilecardui =
  foreign "ShowProfileCardUI"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> returning int32_t)
(* targetUserXuid : HSTRING -> (ptr void) *)
(* completionRoutine : GameUICompletionRoutine -> (ptr void) *)
(* context : void* optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library api-ms-win-gaming-tcui-l1-1-0 (t "api-ms-win-gaming-tcui-l1-1-0.dll"))
(cffi:use-foreign-library api-ms-win-gaming-tcui-l1-1-0)

(cffi:defcfun ("ShowProfileCardUI" show-profile-card-ui :convention :stdcall) :int32
  (target-user-xuid :pointer)   ; HSTRING
  (completion-routine :pointer)   ; GameUICompletionRoutine
  (context :pointer))   ; void* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ShowProfileCardUI = Win32::API::More->new('api-ms-win-gaming-tcui-l1-1-0',
    'int ShowProfileCardUI(HANDLE targetUserXuid, LPVOID completionRoutine, LPVOID context)');
# my $ret = $ShowProfileCardUI->Call($targetUserXuid, $completionRoutine, $context);
# targetUserXuid : HSTRING -> HANDLE
# completionRoutine : GameUICompletionRoutine -> LPVOID
# context : void* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# コールバック(関数ポインタ)は Perl sub を直接渡せません。Win32::API::Callback を使用してください。

関連項目

使用する型