Win32 API 日本語リファレンス
ホームWeb.InternetExplorer › RatingAccessDeniedDialogW

RatingAccessDeniedDialogW

関数
アクセス拒否ダイアログを表示する(Unicode版)。
DLLMSRATING.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// MSRATING.dll  (Unicode / -W)
#include <windows.h>

HRESULT RatingAccessDeniedDialogW(
    HWND hDlg,
    LPCWSTR pszUsername,   // optional
    LPCWSTR pszContentDescription,
    void* pRatingDetails
);

パラメーター

名前方向説明
hDlgHWNDinアクセス拒否ダイアログの親となるウィンドウのハンドルを指定する。
pszUsernameLPCWSTRinoptional対象ユーザー名を指すワイド文字列を指定する。NULL可。
pszContentDescriptionLPCWSTRin拒否されたコンテンツの説明文を指すワイド文字列を指定する。
pRatingDetailsvoid*outRatingCheckUserAccessが返した評価詳細情報へのポインタを指定する。

戻り値の型: HRESULT

各言語での呼び出し定義

// MSRATING.dll  (Unicode / -W)
#include <windows.h>

HRESULT RatingAccessDeniedDialogW(
    HWND hDlg,
    LPCWSTR pszUsername,   // optional
    LPCWSTR pszContentDescription,
    void* pRatingDetails
);
[DllImport("MSRATING.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RatingAccessDeniedDialogW(
    IntPtr hDlg,   // HWND
    [MarshalAs(UnmanagedType.LPWStr)] string pszUsername,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string pszContentDescription,   // LPCWSTR
    IntPtr pRatingDetails   // void* out
);
<DllImport("MSRATING.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RatingAccessDeniedDialogW(
    hDlg As IntPtr,   ' HWND
    <MarshalAs(UnmanagedType.LPWStr)> pszUsername As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> pszContentDescription As String,   ' LPCWSTR
    pRatingDetails As IntPtr   ' void* out
) As Integer
End Function
' hDlg : HWND
' pszUsername : LPCWSTR optional
' pszContentDescription : LPCWSTR
' pRatingDetails : void* out
Declare PtrSafe Function RatingAccessDeniedDialogW Lib "msrating" ( _
    ByVal hDlg As LongPtr, _
    ByVal pszUsername As LongPtr, _
    ByVal pszContentDescription As LongPtr, _
    ByVal pRatingDetails As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RatingAccessDeniedDialogW = ctypes.windll.msrating.RatingAccessDeniedDialogW
RatingAccessDeniedDialogW.restype = ctypes.c_int
RatingAccessDeniedDialogW.argtypes = [
    wintypes.HANDLE,  # hDlg : HWND
    wintypes.LPCWSTR,  # pszUsername : LPCWSTR optional
    wintypes.LPCWSTR,  # pszContentDescription : LPCWSTR
    ctypes.POINTER(None),  # pRatingDetails : void* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSRATING.dll')
RatingAccessDeniedDialogW = Fiddle::Function.new(
  lib['RatingAccessDeniedDialogW'],
  [
    Fiddle::TYPE_VOIDP,  # hDlg : HWND
    Fiddle::TYPE_VOIDP,  # pszUsername : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # pszContentDescription : LPCWSTR
    Fiddle::TYPE_VOIDP,  # pRatingDetails : void* out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "msrating")]
extern "system" {
    fn RatingAccessDeniedDialogW(
        hDlg: *mut core::ffi::c_void,  // HWND
        pszUsername: *const u16,  // LPCWSTR optional
        pszContentDescription: *const u16,  // LPCWSTR
        pRatingDetails: *mut ()  // void* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSRATING.dll", CharSet = CharSet.Unicode)]
public static extern int RatingAccessDeniedDialogW(IntPtr hDlg, [MarshalAs(UnmanagedType.LPWStr)] string pszUsername, [MarshalAs(UnmanagedType.LPWStr)] string pszContentDescription, IntPtr pRatingDetails);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSRATING_RatingAccessDeniedDialogW' -Namespace Win32 -PassThru
# $api::RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
#uselib "MSRATING.dll"
#func global RatingAccessDeniedDialogW "RatingAccessDeniedDialogW" wptr, wptr, wptr, wptr
; RatingAccessDeniedDialogW hDlg, pszUsername, pszContentDescription, pRatingDetails   ; 戻り値は stat
; hDlg : HWND -> "wptr"
; pszUsername : LPCWSTR optional -> "wptr"
; pszContentDescription : LPCWSTR -> "wptr"
; pRatingDetails : void* out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSRATING.dll"
#cfunc global RatingAccessDeniedDialogW "RatingAccessDeniedDialogW" sptr, wstr, wstr, sptr
; res = RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
; hDlg : HWND -> "sptr"
; pszUsername : LPCWSTR optional -> "wstr"
; pszContentDescription : LPCWSTR -> "wstr"
; pRatingDetails : void* out -> "sptr"
; HRESULT RatingAccessDeniedDialogW(HWND hDlg, LPCWSTR pszUsername, LPCWSTR pszContentDescription, void* pRatingDetails)
#uselib "MSRATING.dll"
#cfunc global RatingAccessDeniedDialogW "RatingAccessDeniedDialogW" intptr, wstr, wstr, intptr
; res = RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
; hDlg : HWND -> "intptr"
; pszUsername : LPCWSTR optional -> "wstr"
; pszContentDescription : LPCWSTR -> "wstr"
; pRatingDetails : void* out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msrating = windows.NewLazySystemDLL("MSRATING.dll")
	procRatingAccessDeniedDialogW = msrating.NewProc("RatingAccessDeniedDialogW")
)

// hDlg (HWND), pszUsername (LPCWSTR optional), pszContentDescription (LPCWSTR), pRatingDetails (void* out)
r1, _, err := procRatingAccessDeniedDialogW.Call(
	uintptr(hDlg),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszUsername))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszContentDescription))),
	uintptr(pRatingDetails),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function RatingAccessDeniedDialogW(
  hDlg: THandle;   // HWND
  pszUsername: PWideChar;   // LPCWSTR optional
  pszContentDescription: PWideChar;   // LPCWSTR
  pRatingDetails: Pointer   // void* out
): Integer; stdcall;
  external 'MSRATING.dll' name 'RatingAccessDeniedDialogW';
result := DllCall("MSRATING\RatingAccessDeniedDialogW"
    , "Ptr", hDlg   ; HWND
    , "WStr", pszUsername   ; LPCWSTR optional
    , "WStr", pszContentDescription   ; LPCWSTR
    , "Ptr", pRatingDetails   ; void* out
    , "Int")   ; return: HRESULT
●RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails) = DLL("MSRATING.dll", "int RatingAccessDeniedDialogW(void*, char*, char*, void*)")
# 呼び出し: RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
# hDlg : HWND -> "void*"
# pszUsername : LPCWSTR optional -> "char*"
# pszContentDescription : LPCWSTR -> "char*"
# pRatingDetails : void* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。