Win32 API 日本語リファレンス
ホームSecurity.Credentials › KeyCredentialManagerShowUIOperation

KeyCredentialManagerShowUIOperation

関数
鍵資格情報マネージャーの操作UIを表示する。
DLLKeyCredMgr.dll呼出規約winapi

シグネチャ

// KeyCredMgr.dll
#include <windows.h>

HRESULT KeyCredentialManagerShowUIOperation(
    HWND hWndOwner,
    KeyCredentialManagerOperationType keyCredentialManagerOperationType
);

パラメーター

名前方向
hWndOwnerHWNDin
keyCredentialManagerOperationTypeKeyCredentialManagerOperationTypein

戻り値の型: HRESULT

各言語での呼び出し定義

// KeyCredMgr.dll
#include <windows.h>

HRESULT KeyCredentialManagerShowUIOperation(
    HWND hWndOwner,
    KeyCredentialManagerOperationType keyCredentialManagerOperationType
);
[DllImport("KeyCredMgr.dll", ExactSpelling = true)]
static extern int KeyCredentialManagerShowUIOperation(
    IntPtr hWndOwner,   // HWND
    int keyCredentialManagerOperationType   // KeyCredentialManagerOperationType
);
<DllImport("KeyCredMgr.dll", ExactSpelling:=True)>
Public Shared Function KeyCredentialManagerShowUIOperation(
    hWndOwner As IntPtr,   ' HWND
    keyCredentialManagerOperationType As Integer   ' KeyCredentialManagerOperationType
) As Integer
End Function
' hWndOwner : HWND
' keyCredentialManagerOperationType : KeyCredentialManagerOperationType
Declare PtrSafe Function KeyCredentialManagerShowUIOperation Lib "keycredmgr" ( _
    ByVal hWndOwner As LongPtr, _
    ByVal keyCredentialManagerOperationType As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

KeyCredentialManagerShowUIOperation = ctypes.windll.keycredmgr.KeyCredentialManagerShowUIOperation
KeyCredentialManagerShowUIOperation.restype = ctypes.c_int
KeyCredentialManagerShowUIOperation.argtypes = [
    wintypes.HANDLE,  # hWndOwner : HWND
    ctypes.c_int,  # keyCredentialManagerOperationType : KeyCredentialManagerOperationType
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KeyCredMgr.dll')
KeyCredentialManagerShowUIOperation = Fiddle::Function.new(
  lib['KeyCredentialManagerShowUIOperation'],
  [
    Fiddle::TYPE_VOIDP,  # hWndOwner : HWND
    Fiddle::TYPE_INT,  # keyCredentialManagerOperationType : KeyCredentialManagerOperationType
  ],
  Fiddle::TYPE_INT)
#[link(name = "keycredmgr")]
extern "system" {
    fn KeyCredentialManagerShowUIOperation(
        hWndOwner: *mut core::ffi::c_void,  // HWND
        keyCredentialManagerOperationType: i32  // KeyCredentialManagerOperationType
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("KeyCredMgr.dll")]
public static extern int KeyCredentialManagerShowUIOperation(IntPtr hWndOwner, int keyCredentialManagerOperationType);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KeyCredMgr_KeyCredentialManagerShowUIOperation' -Namespace Win32 -PassThru
# $api::KeyCredentialManagerShowUIOperation(hWndOwner, keyCredentialManagerOperationType)
#uselib "KeyCredMgr.dll"
#func global KeyCredentialManagerShowUIOperation "KeyCredentialManagerShowUIOperation" sptr, sptr
; KeyCredentialManagerShowUIOperation hWndOwner, keyCredentialManagerOperationType   ; 戻り値は stat
; hWndOwner : HWND -> "sptr"
; keyCredentialManagerOperationType : KeyCredentialManagerOperationType -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "KeyCredMgr.dll"
#cfunc global KeyCredentialManagerShowUIOperation "KeyCredentialManagerShowUIOperation" sptr, int
; res = KeyCredentialManagerShowUIOperation(hWndOwner, keyCredentialManagerOperationType)
; hWndOwner : HWND -> "sptr"
; keyCredentialManagerOperationType : KeyCredentialManagerOperationType -> "int"
; HRESULT KeyCredentialManagerShowUIOperation(HWND hWndOwner, KeyCredentialManagerOperationType keyCredentialManagerOperationType)
#uselib "KeyCredMgr.dll"
#cfunc global KeyCredentialManagerShowUIOperation "KeyCredentialManagerShowUIOperation" intptr, int
; res = KeyCredentialManagerShowUIOperation(hWndOwner, keyCredentialManagerOperationType)
; hWndOwner : HWND -> "intptr"
; keyCredentialManagerOperationType : KeyCredentialManagerOperationType -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	keycredmgr = windows.NewLazySystemDLL("KeyCredMgr.dll")
	procKeyCredentialManagerShowUIOperation = keycredmgr.NewProc("KeyCredentialManagerShowUIOperation")
)

// hWndOwner (HWND), keyCredentialManagerOperationType (KeyCredentialManagerOperationType)
r1, _, err := procKeyCredentialManagerShowUIOperation.Call(
	uintptr(hWndOwner),
	uintptr(keyCredentialManagerOperationType),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function KeyCredentialManagerShowUIOperation(
  hWndOwner: THandle;   // HWND
  keyCredentialManagerOperationType: Integer   // KeyCredentialManagerOperationType
): Integer; stdcall;
  external 'KeyCredMgr.dll' name 'KeyCredentialManagerShowUIOperation';
result := DllCall("KeyCredMgr\KeyCredentialManagerShowUIOperation"
    , "Ptr", hWndOwner   ; HWND
    , "Int", keyCredentialManagerOperationType   ; KeyCredentialManagerOperationType
    , "Int")   ; return: HRESULT
●KeyCredentialManagerShowUIOperation(hWndOwner, keyCredentialManagerOperationType) = DLL("KeyCredMgr.dll", "int KeyCredentialManagerShowUIOperation(void*, int)")
# 呼び出し: KeyCredentialManagerShowUIOperation(hWndOwner, keyCredentialManagerOperationType)
# hWndOwner : HWND -> "void*"
# keyCredentialManagerOperationType : KeyCredentialManagerOperationType -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。