ホーム › Web.InternetExplorer › RatingAccessDeniedDialogW
RatingAccessDeniedDialogW
関数アクセス拒否ダイアログを表示する(Unicode版)。
シグネチャ
// MSRATING.dll (Unicode / -W)
#include <windows.h>
HRESULT RatingAccessDeniedDialogW(
HWND hDlg,
LPCWSTR pszUsername, // optional
LPCWSTR pszContentDescription,
void* pRatingDetails
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hDlg | HWND | in | アクセス拒否ダイアログの親となるウィンドウのハンドルを指定する。 |
| pszUsername | LPCWSTR | inoptional | 対象ユーザー名を指すワイド文字列を指定する。NULL可。 |
| pszContentDescription | LPCWSTR | in | 拒否されたコンテンツの説明文を指すワイド文字列を指定する。 |
| pRatingDetails | void* | out | RatingCheckUserAccessが返した評価詳細情報へのポインタを指定する。 |
戻り値の型: 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 // HRESULTfunction 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 版の利用を推奨。const std = @import("std");
extern "msrating" fn RatingAccessDeniedDialogW(
hDlg: ?*anyopaque, // HWND
pszUsername: [*c]const u16, // LPCWSTR optional
pszContentDescription: [*c]const u16, // LPCWSTR
pRatingDetails: ?*anyopaque // void* out
) callconv(std.os.windows.WINAPI) i32;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。proc RatingAccessDeniedDialogW(
hDlg: pointer, # HWND
pszUsername: WideCString, # LPCWSTR optional
pszContentDescription: WideCString, # LPCWSTR
pRatingDetails: pointer # void* out
): int32 {.importc: "RatingAccessDeniedDialogW", stdcall, dynlib: "MSRATING.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。pragma(lib, "msrating");
extern(Windows)
int RatingAccessDeniedDialogW(
void* hDlg, // HWND
const(wchar)* pszUsername, // LPCWSTR optional
const(wchar)* pszContentDescription, // LPCWSTR
void* pRatingDetails // void* out
);ccall((:RatingAccessDeniedDialogW, "MSRATING.dll"), stdcall, Int32,
(Ptr{Cvoid}, Cwstring, Cwstring, Ptr{Cvoid}),
hDlg, pszUsername, pszContentDescription, pRatingDetails)
# hDlg : HWND -> Ptr{Cvoid}
# pszUsername : LPCWSTR optional -> Cwstring
# pszContentDescription : LPCWSTR -> Cwstring
# pRatingDetails : void* out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。local ffi = require("ffi")
ffi.cdef[[
int32_t RatingAccessDeniedDialogW(
void* hDlg,
const uint16_t* pszUsername,
const uint16_t* pszContentDescription,
void* pRatingDetails);
]]
local msrating = ffi.load("msrating")
-- msrating.RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
-- hDlg : HWND
-- pszUsername : LPCWSTR optional
-- pszContentDescription : LPCWSTR
-- pRatingDetails : void* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。const koffi = require('koffi');
const lib = koffi.load('MSRATING.dll');
const RatingAccessDeniedDialogW = lib.func('__stdcall', 'RatingAccessDeniedDialogW', 'int32_t', ['void *', 'str16', 'str16', 'void *']);
// RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
// hDlg : HWND -> 'void *'
// pszUsername : LPCWSTR optional -> 'str16'
// pszContentDescription : LPCWSTR -> 'str16'
// pRatingDetails : void* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("MSRATING.dll", {
RatingAccessDeniedDialogW: { parameters: ["pointer", "buffer", "buffer", "pointer"], result: "i32" },
});
// lib.symbols.RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails)
// hDlg : HWND -> "pointer"
// pszUsername : LPCWSTR optional -> "buffer"
// pszContentDescription : LPCWSTR -> "buffer"
// pRatingDetails : void* out -> "pointer"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t RatingAccessDeniedDialogW(
void* hDlg,
const uint16_t* pszUsername,
const uint16_t* pszContentDescription,
void* pRatingDetails);
C, "MSRATING.dll");
// $ffi->RatingAccessDeniedDialogW(hDlg, pszUsername, pszContentDescription, pRatingDetails);
// hDlg : HWND
// pszUsername : LPCWSTR optional
// pszContentDescription : LPCWSTR
// pRatingDetails : void* out
// 構造体/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 Msrating extends StdCallLibrary {
Msrating INSTANCE = Native.load("msrating", Msrating.class, W32APIOptions.UNICODE_OPTIONS);
int RatingAccessDeniedDialogW(
Pointer hDlg, // HWND
WString pszUsername, // LPCWSTR optional
WString pszContentDescription, // LPCWSTR
Pointer pRatingDetails // void* out
);
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。@[Link("msrating")]
lib LibMSRATING
fun RatingAccessDeniedDialogW = RatingAccessDeniedDialogW(
hDlg : Void*, # HWND
pszUsername : UInt16*, # LPCWSTR optional
pszContentDescription : UInt16*, # LPCWSTR
pRatingDetails : Void* # void* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RatingAccessDeniedDialogWNative = Int32 Function(Pointer<Void>, Pointer<Utf16>, Pointer<Utf16>, Pointer<Void>);
typedef RatingAccessDeniedDialogWDart = int Function(Pointer<Void>, Pointer<Utf16>, Pointer<Utf16>, Pointer<Void>);
final RatingAccessDeniedDialogW = DynamicLibrary.open('MSRATING.dll')
.lookupFunction<RatingAccessDeniedDialogWNative, RatingAccessDeniedDialogWDart>('RatingAccessDeniedDialogW');
// hDlg : HWND -> Pointer<Void>
// pszUsername : LPCWSTR optional -> Pointer<Utf16>
// pszContentDescription : LPCWSTR -> Pointer<Utf16>
// pRatingDetails : void* out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RatingAccessDeniedDialogW(
hDlg: THandle; // HWND
pszUsername: PWideChar; // LPCWSTR optional
pszContentDescription: PWideChar; // LPCWSTR
pRatingDetails: Pointer // void* out
): Integer; stdcall;
external 'MSRATING.dll' name 'RatingAccessDeniedDialogW';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RatingAccessDeniedDialogW"
c_RatingAccessDeniedDialogW :: Ptr () -> CWString -> CWString -> Ptr () -> IO Int32
-- hDlg : HWND -> Ptr ()
-- pszUsername : LPCWSTR optional -> CWString
-- pszContentDescription : LPCWSTR -> CWString
-- pRatingDetails : void* out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let ratingaccessdenieddialogw =
foreign "RatingAccessDeniedDialogW"
((ptr void) @-> (ptr uint16_t) @-> (ptr uint16_t) @-> (ptr void) @-> returning int32_t)
(* hDlg : HWND -> (ptr void) *)
(* pszUsername : LPCWSTR optional -> (ptr uint16_t) *)
(* pszContentDescription : LPCWSTR -> (ptr uint16_t) *)
(* pRatingDetails : void* out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library msrating (t "MSRATING.dll"))
(cffi:use-foreign-library msrating)
(cffi:defcfun ("RatingAccessDeniedDialogW" rating-access-denied-dialog-w :convention :stdcall) :int32
(h-dlg :pointer) ; HWND
(psz-username (:string :encoding :utf-16le)) ; LPCWSTR optional
(psz-content-description (:string :encoding :utf-16le)) ; LPCWSTR
(p-rating-details :pointer)) ; void* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RatingAccessDeniedDialogW = Win32::API::More->new('MSRATING',
'int RatingAccessDeniedDialogW(HANDLE hDlg, LPCWSTR pszUsername, LPCWSTR pszContentDescription, LPVOID pRatingDetails)');
# my $ret = $RatingAccessDeniedDialogW->Call($hDlg, $pszUsername, $pszContentDescription, $pRatingDetails);
# hDlg : HWND -> HANDLE
# pszUsername : LPCWSTR optional -> LPCWSTR
# pszContentDescription : LPCWSTR -> LPCWSTR
# pRatingDetails : void* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。関連項目
類似 API
- f RatingAccessDeniedDialog2W — 簡易版のアクセス拒否ダイアログを表示する(Unicode版)。