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

ShowTitleAchievementsUIForUser

関数
指定ユーザー向けにタイトル実績UIを表示する。
DLLapi-ms-win-gaming-tcui-l1-1-2.dll呼出規約winapi

シグネチャ

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

HRESULT ShowTitleAchievementsUIForUser(
    IInspectable* user,
    DWORD titleId,
    GameUICompletionRoutine completionRoutine,
    void* context   // optional
);

パラメーター

名前方向説明
userIInspectable*in操作主体のユーザーを表すIInspectableインターフェイスポインタ。
titleIdDWORDin実績を表示する対象タイトルのID。
completionRoutineGameUICompletionRoutineinUI完了時に呼ばれるコールバック関数。NULL可。
contextvoid*inoptionalコールバックへ渡されるユーザー定義コンテキスト。NULL可。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT ShowTitleAchievementsUIForUser(
    IInspectable* user,
    DWORD titleId,
    GameUICompletionRoutine completionRoutine,
    void* context   // optional
);
[DllImport("api-ms-win-gaming-tcui-l1-1-2.dll", ExactSpelling = true)]
static extern int ShowTitleAchievementsUIForUser(
    IntPtr user,   // IInspectable*
    uint titleId,   // DWORD
    IntPtr completionRoutine,   // GameUICompletionRoutine
    IntPtr context   // void* optional
);
<DllImport("api-ms-win-gaming-tcui-l1-1-2.dll", ExactSpelling:=True)>
Public Shared Function ShowTitleAchievementsUIForUser(
    user As IntPtr,   ' IInspectable*
    titleId As UInteger,   ' DWORD
    completionRoutine As IntPtr,   ' GameUICompletionRoutine
    context As IntPtr   ' void* optional
) As Integer
End Function
' user : IInspectable*
' titleId : DWORD
' completionRoutine : GameUICompletionRoutine
' context : void* optional
Declare PtrSafe Function ShowTitleAchievementsUIForUser Lib "api-ms-win-gaming-tcui-l1-1-2" ( _
    ByVal user As LongPtr, _
    ByVal titleId As Long, _
    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

ShowTitleAchievementsUIForUser = ctypes.windll.LoadLibrary("api-ms-win-gaming-tcui-l1-1-2.dll").ShowTitleAchievementsUIForUser
ShowTitleAchievementsUIForUser.restype = ctypes.c_int
ShowTitleAchievementsUIForUser.argtypes = [
    ctypes.c_void_p,  # user : IInspectable*
    wintypes.DWORD,  # titleId : DWORD
    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-2.dll')
ShowTitleAchievementsUIForUser = Fiddle::Function.new(
  lib['ShowTitleAchievementsUIForUser'],
  [
    Fiddle::TYPE_VOIDP,  # user : IInspectable*
    -Fiddle::TYPE_INT,  # titleId : DWORD
    Fiddle::TYPE_VOIDP,  # completionRoutine : GameUICompletionRoutine
    Fiddle::TYPE_VOIDP,  # context : void* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-gaming-tcui-l1-1-2")]
extern "system" {
    fn ShowTitleAchievementsUIForUser(
        user: *mut core::ffi::c_void,  // IInspectable*
        titleId: u32,  // DWORD
        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-2.dll")]
public static extern int ShowTitleAchievementsUIForUser(IntPtr user, uint titleId, IntPtr completionRoutine, IntPtr context);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-gaming-tcui-l1-1-2_ShowTitleAchievementsUIForUser' -Namespace Win32 -PassThru
# $api::ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
#uselib "api-ms-win-gaming-tcui-l1-1-2.dll"
#func global ShowTitleAchievementsUIForUser "ShowTitleAchievementsUIForUser" sptr, sptr, sptr, sptr
; ShowTitleAchievementsUIForUser user, titleId, completionRoutine, context   ; 戻り値は stat
; user : IInspectable* -> "sptr"
; titleId : DWORD -> "sptr"
; completionRoutine : GameUICompletionRoutine -> "sptr"
; context : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-gaming-tcui-l1-1-2.dll"
#cfunc global ShowTitleAchievementsUIForUser "ShowTitleAchievementsUIForUser" sptr, int, sptr, sptr
; res = ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
; user : IInspectable* -> "sptr"
; titleId : DWORD -> "int"
; completionRoutine : GameUICompletionRoutine -> "sptr"
; context : void* optional -> "sptr"
; HRESULT ShowTitleAchievementsUIForUser(IInspectable* user, DWORD titleId, GameUICompletionRoutine completionRoutine, void* context)
#uselib "api-ms-win-gaming-tcui-l1-1-2.dll"
#cfunc global ShowTitleAchievementsUIForUser "ShowTitleAchievementsUIForUser" intptr, int, intptr, intptr
; res = ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
; user : IInspectable* -> "intptr"
; titleId : DWORD -> "int"
; completionRoutine : GameUICompletionRoutine -> "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")
	procShowTitleAchievementsUIForUser = api_ms_win_gaming_tcui_l1_1_2.NewProc("ShowTitleAchievementsUIForUser")
)

// user (IInspectable*), titleId (DWORD), completionRoutine (GameUICompletionRoutine), context (void* optional)
r1, _, err := procShowTitleAchievementsUIForUser.Call(
	uintptr(user),
	uintptr(titleId),
	uintptr(completionRoutine),
	uintptr(context),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function ShowTitleAchievementsUIForUser(
  user: Pointer;   // IInspectable*
  titleId: DWORD;   // DWORD
  completionRoutine: Pointer;   // GameUICompletionRoutine
  context: Pointer   // void* optional
): Integer; stdcall;
  external 'api-ms-win-gaming-tcui-l1-1-2.dll' name 'ShowTitleAchievementsUIForUser';
result := DllCall("api-ms-win-gaming-tcui-l1-1-2\ShowTitleAchievementsUIForUser"
    , "Ptr", user   ; IInspectable*
    , "UInt", titleId   ; DWORD
    , "Ptr", completionRoutine   ; GameUICompletionRoutine
    , "Ptr", context   ; void* optional
    , "Int")   ; return: HRESULT
●ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context) = DLL("api-ms-win-gaming-tcui-l1-1-2.dll", "int ShowTitleAchievementsUIForUser(void*, dword, void*, void*)")
# 呼び出し: ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
# user : IInspectable* -> "void*"
# titleId : DWORD -> "dword"
# 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-2" fn ShowTitleAchievementsUIForUser(
    user: ?*anyopaque, // IInspectable*
    titleId: u32, // DWORD
    completionRoutine: ?*anyopaque, // GameUICompletionRoutine
    context: ?*anyopaque // void* optional
) callconv(std.os.windows.WINAPI) i32;
proc ShowTitleAchievementsUIForUser(
    user: pointer,  # IInspectable*
    titleId: uint32,  # DWORD
    completionRoutine: pointer,  # GameUICompletionRoutine
    context: pointer  # void* optional
): int32 {.importc: "ShowTitleAchievementsUIForUser", stdcall, dynlib: "api-ms-win-gaming-tcui-l1-1-2.dll".}
pragma(lib, "api-ms-win-gaming-tcui-l1-1-2");
extern(Windows)
int ShowTitleAchievementsUIForUser(
    void* user,   // IInspectable*
    uint titleId,   // DWORD
    void* completionRoutine,   // GameUICompletionRoutine
    void* context   // void* optional
);
ccall((:ShowTitleAchievementsUIForUser, "api-ms-win-gaming-tcui-l1-1-2.dll"), stdcall, Int32,
      (Ptr{Cvoid}, UInt32, Ptr{Cvoid}, Ptr{Cvoid}),
      user, titleId, completionRoutine, context)
# user : IInspectable* -> Ptr{Cvoid}
# titleId : DWORD -> UInt32
# completionRoutine : GameUICompletionRoutine -> Ptr{Cvoid}
# context : void* optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t ShowTitleAchievementsUIForUser(
    void* user,
    uint32_t titleId,
    void* completionRoutine,
    void* context);
]]
local api-ms-win-gaming-tcui-l1-1-2 = ffi.load("api-ms-win-gaming-tcui-l1-1-2")
-- api-ms-win-gaming-tcui-l1-1-2.ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
-- user : IInspectable*
-- titleId : DWORD
-- 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-2.dll');
const ShowTitleAchievementsUIForUser = lib.func('__stdcall', 'ShowTitleAchievementsUIForUser', 'int32_t', ['void *', 'uint32_t', 'void *', 'void *']);
// ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
// user : IInspectable* -> 'void *'
// titleId : DWORD -> 'uint32_t'
// 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-2.dll", {
  ShowTitleAchievementsUIForUser: { parameters: ["pointer", "u32", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context)
// user : IInspectable* -> "pointer"
// titleId : DWORD -> "u32"
// completionRoutine : GameUICompletionRoutine -> "pointer"
// context : void* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t ShowTitleAchievementsUIForUser(
    void* user,
    uint32_t titleId,
    void* completionRoutine,
    void* context);
C, "api-ms-win-gaming-tcui-l1-1-2.dll");
// $ffi->ShowTitleAchievementsUIForUser(user, titleId, completionRoutine, context);
// user : IInspectable*
// titleId : DWORD
// 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-2 extends StdCallLibrary {
    Api-ms-win-gaming-tcui-l1-1-2 INSTANCE = Native.load("api-ms-win-gaming-tcui-l1-1-2", Api-ms-win-gaming-tcui-l1-1-2.class);
    int ShowTitleAchievementsUIForUser(
        Pointer user,   // IInspectable*
        int titleId,   // DWORD
        Callback completionRoutine,   // GameUICompletionRoutine
        Pointer context   // void* optional
    );
}
@[Link("api-ms-win-gaming-tcui-l1-1-2")]
lib Libapi-ms-win-gaming-tcui-l1-1-2
  fun ShowTitleAchievementsUIForUser = ShowTitleAchievementsUIForUser(
    user : Void*,   # IInspectable*
    titleId : UInt32,   # DWORD
    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 ShowTitleAchievementsUIForUserNative = Int32 Function(Pointer<Void>, Uint32, Pointer<Void>, Pointer<Void>);
typedef ShowTitleAchievementsUIForUserDart = int Function(Pointer<Void>, int, Pointer<Void>, Pointer<Void>);
final ShowTitleAchievementsUIForUser = DynamicLibrary.open('api-ms-win-gaming-tcui-l1-1-2.dll')
    .lookupFunction<ShowTitleAchievementsUIForUserNative, ShowTitleAchievementsUIForUserDart>('ShowTitleAchievementsUIForUser');
// user : IInspectable* -> Pointer<Void>
// titleId : DWORD -> Uint32
// completionRoutine : GameUICompletionRoutine -> Pointer<Void>
// context : void* optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ShowTitleAchievementsUIForUser(
  user: Pointer;   // IInspectable*
  titleId: DWORD;   // DWORD
  completionRoutine: Pointer;   // GameUICompletionRoutine
  context: Pointer   // void* optional
): Integer; stdcall;
  external 'api-ms-win-gaming-tcui-l1-1-2.dll' name 'ShowTitleAchievementsUIForUser';
import Foreign
import Foreign.C.Types
import Foreign.C.String

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

let showtitleachievementsuiforuser =
  foreign "ShowTitleAchievementsUIForUser"
    ((ptr void) @-> uint32_t @-> (ptr void) @-> (ptr void) @-> returning int32_t)
(* user : IInspectable* -> (ptr void) *)
(* titleId : DWORD -> uint32_t *)
(* 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-2 (t "api-ms-win-gaming-tcui-l1-1-2.dll"))
(cffi:use-foreign-library api-ms-win-gaming-tcui-l1-1-2)

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

関連項目

使用する型