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

RatingSetupUIW

関数
コンテンツアドバイザの設定UIを表示する(Unicode版)。
DLLMSRATING.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

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

HRESULT RatingSetupUIW(
    HWND hDlg,
    LPCWSTR pszUsername
);

パラメーター

名前方向説明
hDlgHWNDinコンテンツアドバイザ設定UIの親となるウィンドウのハンドルを指定する。
pszUsernameLPCWSTRin設定対象のユーザー名を指すワイド文字列を指定する。NULLで現在のユーザー。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT RatingSetupUIW(
    HWND hDlg,
    LPCWSTR pszUsername
);
[DllImport("MSRATING.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RatingSetupUIW(
    IntPtr hDlg,   // HWND
    [MarshalAs(UnmanagedType.LPWStr)] string pszUsername   // LPCWSTR
);
<DllImport("MSRATING.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RatingSetupUIW(
    hDlg As IntPtr,   ' HWND
    <MarshalAs(UnmanagedType.LPWStr)> pszUsername As String   ' LPCWSTR
) As Integer
End Function
' hDlg : HWND
' pszUsername : LPCWSTR
Declare PtrSafe Function RatingSetupUIW Lib "msrating" ( _
    ByVal hDlg As LongPtr, _
    ByVal pszUsername 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

RatingSetupUIW = ctypes.windll.msrating.RatingSetupUIW
RatingSetupUIW.restype = ctypes.c_int
RatingSetupUIW.argtypes = [
    wintypes.HANDLE,  # hDlg : HWND
    wintypes.LPCWSTR,  # pszUsername : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msrating = windows.NewLazySystemDLL("MSRATING.dll")
	procRatingSetupUIW = msrating.NewProc("RatingSetupUIW")
)

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