ホーム › Web.InternetExplorer › RatingAccessDeniedDialog2W
RatingAccessDeniedDialog2W
関数簡易版のアクセス拒否ダイアログを表示する(Unicode版)。
シグネチャ
// MSRATING.dll (Unicode / -W)
#include <windows.h>
HRESULT RatingAccessDeniedDialog2W(
HWND hDlg,
LPCWSTR pszUsername, // optional
void* pRatingDetails
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hDlg | HWND | in | アクセス拒否ダイアログの親となるウィンドウのハンドルを指定する。 |
| pszUsername | LPCWSTR | inoptional | 対象ユーザー名を指すワイド文字列を指定する。NULL可。 |
| pRatingDetails | void* | out | RatingCheckUserAccessが返した評価詳細情報へのポインタを指定する。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// MSRATING.dll (Unicode / -W)
#include <windows.h>
HRESULT RatingAccessDeniedDialog2W(
HWND hDlg,
LPCWSTR pszUsername, // optional
void* pRatingDetails
);[DllImport("MSRATING.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RatingAccessDeniedDialog2W(
IntPtr hDlg, // HWND
[MarshalAs(UnmanagedType.LPWStr)] string pszUsername, // LPCWSTR optional
IntPtr pRatingDetails // void* out
);<DllImport("MSRATING.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RatingAccessDeniedDialog2W(
hDlg As IntPtr, ' HWND
<MarshalAs(UnmanagedType.LPWStr)> pszUsername As String, ' LPCWSTR optional
pRatingDetails As IntPtr ' void* out
) As Integer
End Function' hDlg : HWND
' pszUsername : LPCWSTR optional
' pRatingDetails : void* out
Declare PtrSafe Function RatingAccessDeniedDialog2W Lib "msrating" ( _
ByVal hDlg As LongPtr, _
ByVal pszUsername 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
RatingAccessDeniedDialog2W = ctypes.windll.msrating.RatingAccessDeniedDialog2W
RatingAccessDeniedDialog2W.restype = ctypes.c_int
RatingAccessDeniedDialog2W.argtypes = [
wintypes.HANDLE, # hDlg : HWND
wintypes.LPCWSTR, # pszUsername : LPCWSTR optional
ctypes.POINTER(None), # pRatingDetails : void* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSRATING.dll')
RatingAccessDeniedDialog2W = Fiddle::Function.new(
lib['RatingAccessDeniedDialog2W'],
[
Fiddle::TYPE_VOIDP, # hDlg : HWND
Fiddle::TYPE_VOIDP, # pszUsername : LPCWSTR optional
Fiddle::TYPE_VOIDP, # pRatingDetails : void* out
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "msrating")]
extern "system" {
fn RatingAccessDeniedDialog2W(
hDlg: *mut core::ffi::c_void, // HWND
pszUsername: *const u16, // LPCWSTR optional
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 RatingAccessDeniedDialog2W(IntPtr hDlg, [MarshalAs(UnmanagedType.LPWStr)] string pszUsername, IntPtr pRatingDetails);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSRATING_RatingAccessDeniedDialog2W' -Namespace Win32 -PassThru
# $api::RatingAccessDeniedDialog2W(hDlg, pszUsername, pRatingDetails)#uselib "MSRATING.dll"
#func global RatingAccessDeniedDialog2W "RatingAccessDeniedDialog2W" wptr, wptr, wptr
; RatingAccessDeniedDialog2W hDlg, pszUsername, pRatingDetails ; 戻り値は stat
; hDlg : HWND -> "wptr"
; pszUsername : LPCWSTR optional -> "wptr"
; pRatingDetails : void* out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSRATING.dll"
#cfunc global RatingAccessDeniedDialog2W "RatingAccessDeniedDialog2W" sptr, wstr, sptr
; res = RatingAccessDeniedDialog2W(hDlg, pszUsername, pRatingDetails)
; hDlg : HWND -> "sptr"
; pszUsername : LPCWSTR optional -> "wstr"
; pRatingDetails : void* out -> "sptr"; HRESULT RatingAccessDeniedDialog2W(HWND hDlg, LPCWSTR pszUsername, void* pRatingDetails)
#uselib "MSRATING.dll"
#cfunc global RatingAccessDeniedDialog2W "RatingAccessDeniedDialog2W" intptr, wstr, intptr
; res = RatingAccessDeniedDialog2W(hDlg, pszUsername, pRatingDetails)
; hDlg : HWND -> "intptr"
; pszUsername : LPCWSTR optional -> "wstr"
; pRatingDetails : void* out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msrating = windows.NewLazySystemDLL("MSRATING.dll")
procRatingAccessDeniedDialog2W = msrating.NewProc("RatingAccessDeniedDialog2W")
)
// hDlg (HWND), pszUsername (LPCWSTR optional), pRatingDetails (void* out)
r1, _, err := procRatingAccessDeniedDialog2W.Call(
uintptr(hDlg),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszUsername))),
uintptr(pRatingDetails),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction RatingAccessDeniedDialog2W(
hDlg: THandle; // HWND
pszUsername: PWideChar; // LPCWSTR optional
pRatingDetails: Pointer // void* out
): Integer; stdcall;
external 'MSRATING.dll' name 'RatingAccessDeniedDialog2W';result := DllCall("MSRATING\RatingAccessDeniedDialog2W"
, "Ptr", hDlg ; HWND
, "WStr", pszUsername ; LPCWSTR optional
, "Ptr", pRatingDetails ; void* out
, "Int") ; return: HRESULT●RatingAccessDeniedDialog2W(hDlg, pszUsername, pRatingDetails) = DLL("MSRATING.dll", "int RatingAccessDeniedDialog2W(void*, char*, void*)")
# 呼び出し: RatingAccessDeniedDialog2W(hDlg, pszUsername, pRatingDetails)
# hDlg : HWND -> "void*"
# pszUsername : LPCWSTR optional -> "char*"
# pRatingDetails : void* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。