ホーム › Data.HtmlHelp › HtmlHelpW
HtmlHelpW
関数HTMLヘルプを表示・制御する(Unicode版)。
シグネチャ
// hhctrl.ocx (Unicode / -W)
#include <windows.h>
HWND HtmlHelpW(
HWND hwndCaller, // optional
LPCWSTR pszFile,
DWORD uCommand,
UINT_PTR dwData
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwndCaller | HWND | inoptional |
| pszFile | LPCWSTR | in |
| uCommand | DWORD | in |
| dwData | UINT_PTR | in |
戻り値の型: HWND
各言語での呼び出し定義
// hhctrl.ocx (Unicode / -W)
#include <windows.h>
HWND HtmlHelpW(
HWND hwndCaller, // optional
LPCWSTR pszFile,
DWORD uCommand,
UINT_PTR dwData
);[DllImport("hhctrl.ocx", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern IntPtr HtmlHelpW(
IntPtr hwndCaller, // HWND optional
[MarshalAs(UnmanagedType.LPWStr)] string pszFile, // LPCWSTR
uint uCommand, // DWORD
UIntPtr dwData // UINT_PTR
);<DllImport("hhctrl.ocx", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function HtmlHelpW(
hwndCaller As IntPtr, ' HWND optional
<MarshalAs(UnmanagedType.LPWStr)> pszFile As String, ' LPCWSTR
uCommand As UInteger, ' DWORD
dwData As UIntPtr ' UINT_PTR
) As IntPtr
End Function' hwndCaller : HWND optional
' pszFile : LPCWSTR
' uCommand : DWORD
' dwData : UINT_PTR
Declare PtrSafe Function HtmlHelpW Lib "hhctrl.ocx" ( _
ByVal hwndCaller As LongPtr, _
ByVal pszFile As LongPtr, _
ByVal uCommand As Long, _
ByVal dwData As LongPtr) As LongPtr
' 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
HtmlHelpW = ctypes.windll.LoadLibrary("hhctrl.ocx").HtmlHelpW
HtmlHelpW.restype = ctypes.c_void_p
HtmlHelpW.argtypes = [
wintypes.HANDLE, # hwndCaller : HWND optional
wintypes.LPCWSTR, # pszFile : LPCWSTR
wintypes.DWORD, # uCommand : DWORD
ctypes.c_size_t, # dwData : UINT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('hhctrl.ocx')
HtmlHelpW = Fiddle::Function.new(
lib['HtmlHelpW'],
[
Fiddle::TYPE_VOIDP, # hwndCaller : HWND optional
Fiddle::TYPE_VOIDP, # pszFile : LPCWSTR
-Fiddle::TYPE_INT, # uCommand : DWORD
Fiddle::TYPE_UINTPTR_T, # dwData : UINT_PTR
],
Fiddle::TYPE_VOIDP)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "hhctrl.ocx")]
extern "system" {
fn HtmlHelpW(
hwndCaller: *mut core::ffi::c_void, // HWND optional
pszFile: *const u16, // LPCWSTR
uCommand: u32, // DWORD
dwData: usize // UINT_PTR
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("hhctrl.ocx", CharSet = CharSet.Unicode)]
public static extern IntPtr HtmlHelpW(IntPtr hwndCaller, [MarshalAs(UnmanagedType.LPWStr)] string pszFile, uint uCommand, UIntPtr dwData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'hhctrl.ocx_HtmlHelpW' -Namespace Win32 -PassThru
# $api::HtmlHelpW(hwndCaller, pszFile, uCommand, dwData)#uselib "hhctrl.ocx"
#func global HtmlHelpW "HtmlHelpW" wptr, wptr, wptr, wptr
; HtmlHelpW hwndCaller, pszFile, uCommand, dwData ; 戻り値は stat
; hwndCaller : HWND optional -> "wptr"
; pszFile : LPCWSTR -> "wptr"
; uCommand : DWORD -> "wptr"
; dwData : UINT_PTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "hhctrl.ocx"
#cfunc global HtmlHelpW "HtmlHelpW" sptr, wstr, int, sptr
; res = HtmlHelpW(hwndCaller, pszFile, uCommand, dwData)
; hwndCaller : HWND optional -> "sptr"
; pszFile : LPCWSTR -> "wstr"
; uCommand : DWORD -> "int"
; dwData : UINT_PTR -> "sptr"; HWND HtmlHelpW(HWND hwndCaller, LPCWSTR pszFile, DWORD uCommand, UINT_PTR dwData)
#uselib "hhctrl.ocx"
#cfunc global HtmlHelpW "HtmlHelpW" intptr, wstr, int, intptr
; res = HtmlHelpW(hwndCaller, pszFile, uCommand, dwData)
; hwndCaller : HWND optional -> "intptr"
; pszFile : LPCWSTR -> "wstr"
; uCommand : DWORD -> "int"
; dwData : UINT_PTR -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
hhctrl_ocx = windows.NewLazySystemDLL("hhctrl.ocx")
procHtmlHelpW = hhctrl_ocx.NewProc("HtmlHelpW")
)
// hwndCaller (HWND optional), pszFile (LPCWSTR), uCommand (DWORD), dwData (UINT_PTR)
r1, _, err := procHtmlHelpW.Call(
uintptr(hwndCaller),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszFile))),
uintptr(uCommand),
uintptr(dwData),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HWNDfunction HtmlHelpW(
hwndCaller: THandle; // HWND optional
pszFile: PWideChar; // LPCWSTR
uCommand: DWORD; // DWORD
dwData: NativeUInt // UINT_PTR
): THandle; stdcall;
external 'hhctrl.ocx' name 'HtmlHelpW';result := DllCall("hhctrl.ocx\HtmlHelpW"
, "Ptr", hwndCaller ; HWND optional
, "WStr", pszFile ; LPCWSTR
, "UInt", uCommand ; DWORD
, "UPtr", dwData ; UINT_PTR
, "Ptr") ; return: HWND●HtmlHelpW(hwndCaller, pszFile, uCommand, dwData) = DLL("hhctrl.ocx", "void* HtmlHelpW(void*, char*, dword, int)")
# 呼び出し: HtmlHelpW(hwndCaller, pszFile, uCommand, dwData)
# hwndCaller : HWND optional -> "void*"
# pszFile : LPCWSTR -> "char*"
# uCommand : DWORD -> "dword"
# dwData : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。