Win32 API 日本語リファレンス
ホームData.HtmlHelp › HtmlHelpA

HtmlHelpA

関数
HTMLヘルプを表示・制御する(ANSI版)。
DLLhhctrl.ocx文字セットANSI (-A)呼出規約winapi

シグネチャ

// hhctrl.ocx  (ANSI / -A)
#include <windows.h>

HWND HtmlHelpA(
    HWND hwndCaller,   // optional
    LPCSTR pszFile,
    DWORD uCommand,
    UINT_PTR dwData
);

パラメーター

名前方向
hwndCallerHWNDinoptional
pszFileLPCSTRin
uCommandDWORDin
dwDataUINT_PTRin

戻り値の型: HWND

各言語での呼び出し定義

// hhctrl.ocx  (ANSI / -A)
#include <windows.h>

HWND HtmlHelpA(
    HWND hwndCaller,   // optional
    LPCSTR pszFile,
    DWORD uCommand,
    UINT_PTR dwData
);
[DllImport("hhctrl.ocx", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern IntPtr HtmlHelpA(
    IntPtr hwndCaller,   // HWND optional
    [MarshalAs(UnmanagedType.LPStr)] string pszFile,   // LPCSTR
    uint uCommand,   // DWORD
    UIntPtr dwData   // UINT_PTR
);
<DllImport("hhctrl.ocx", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function HtmlHelpA(
    hwndCaller As IntPtr,   ' HWND optional
    <MarshalAs(UnmanagedType.LPStr)> pszFile As String,   ' LPCSTR
    uCommand As UInteger,   ' DWORD
    dwData As UIntPtr   ' UINT_PTR
) As IntPtr
End Function
' hwndCaller : HWND optional
' pszFile : LPCSTR
' uCommand : DWORD
' dwData : UINT_PTR
Declare PtrSafe Function HtmlHelpA Lib "hhctrl.ocx" ( _
    ByVal hwndCaller As LongPtr, _
    ByVal pszFile As String, _
    ByVal uCommand As Long, _
    ByVal dwData As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HtmlHelpA = ctypes.windll.LoadLibrary("hhctrl.ocx").HtmlHelpA
HtmlHelpA.restype = ctypes.c_void_p
HtmlHelpA.argtypes = [
    wintypes.HANDLE,  # hwndCaller : HWND optional
    wintypes.LPCSTR,  # pszFile : LPCSTR
    wintypes.DWORD,  # uCommand : DWORD
    ctypes.c_size_t,  # dwData : UINT_PTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('hhctrl.ocx')
HtmlHelpA = Fiddle::Function.new(
  lib['HtmlHelpA'],
  [
    Fiddle::TYPE_VOIDP,  # hwndCaller : HWND optional
    Fiddle::TYPE_VOIDP,  # pszFile : LPCSTR
    -Fiddle::TYPE_INT,  # uCommand : DWORD
    Fiddle::TYPE_UINTPTR_T,  # dwData : UINT_PTR
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "hhctrl.ocx")]
extern "system" {
    fn HtmlHelpA(
        hwndCaller: *mut core::ffi::c_void,  // HWND optional
        pszFile: *const u8,  // LPCSTR
        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.Ansi)]
public static extern IntPtr HtmlHelpA(IntPtr hwndCaller, [MarshalAs(UnmanagedType.LPStr)] string pszFile, uint uCommand, UIntPtr dwData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'hhctrl.ocx_HtmlHelpA' -Namespace Win32 -PassThru
# $api::HtmlHelpA(hwndCaller, pszFile, uCommand, dwData)
#uselib "hhctrl.ocx"
#func global HtmlHelpA "HtmlHelpA" sptr, sptr, sptr, sptr
; HtmlHelpA hwndCaller, pszFile, uCommand, dwData   ; 戻り値は stat
; hwndCaller : HWND optional -> "sptr"
; pszFile : LPCSTR -> "sptr"
; uCommand : DWORD -> "sptr"
; dwData : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "hhctrl.ocx"
#cfunc global HtmlHelpA "HtmlHelpA" sptr, str, int, sptr
; res = HtmlHelpA(hwndCaller, pszFile, uCommand, dwData)
; hwndCaller : HWND optional -> "sptr"
; pszFile : LPCSTR -> "str"
; uCommand : DWORD -> "int"
; dwData : UINT_PTR -> "sptr"
; HWND HtmlHelpA(HWND hwndCaller, LPCSTR pszFile, DWORD uCommand, UINT_PTR dwData)
#uselib "hhctrl.ocx"
#cfunc global HtmlHelpA "HtmlHelpA" intptr, str, int, intptr
; res = HtmlHelpA(hwndCaller, pszFile, uCommand, dwData)
; hwndCaller : HWND optional -> "intptr"
; pszFile : LPCSTR -> "str"
; uCommand : DWORD -> "int"
; dwData : UINT_PTR -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	hhctrl_ocx = windows.NewLazySystemDLL("hhctrl.ocx")
	procHtmlHelpA = hhctrl_ocx.NewProc("HtmlHelpA")
)

// hwndCaller (HWND optional), pszFile (LPCSTR), uCommand (DWORD), dwData (UINT_PTR)
r1, _, err := procHtmlHelpA.Call(
	uintptr(hwndCaller),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(pszFile))),
	uintptr(uCommand),
	uintptr(dwData),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HWND
function HtmlHelpA(
  hwndCaller: THandle;   // HWND optional
  pszFile: PAnsiChar;   // LPCSTR
  uCommand: DWORD;   // DWORD
  dwData: NativeUInt   // UINT_PTR
): THandle; stdcall;
  external 'hhctrl.ocx' name 'HtmlHelpA';
result := DllCall("hhctrl.ocx\HtmlHelpA"
    , "Ptr", hwndCaller   ; HWND optional
    , "AStr", pszFile   ; LPCSTR
    , "UInt", uCommand   ; DWORD
    , "UPtr", dwData   ; UINT_PTR
    , "Ptr")   ; return: HWND
●HtmlHelpA(hwndCaller, pszFile, uCommand, dwData) = DLL("hhctrl.ocx", "void* HtmlHelpA(void*, char*, dword, int)")
# 呼び出し: HtmlHelpA(hwndCaller, pszFile, uCommand, dwData)
# hwndCaller : HWND optional -> "void*"
# pszFile : LPCSTR -> "char*"
# uCommand : DWORD -> "dword"
# dwData : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。