Win32 API 日本語リファレンス
ホームUI.Shell › ShellAboutA

ShellAboutA

関数
標準のバージョン情報ダイアログ(ANSI)を表示する。
DLLSHELL32.dll文字セットANSI (-A)呼出規約winapi対応OSWindows XP 以降

シグネチャ

// SHELL32.dll  (ANSI / -A)
#include <windows.h>

INT ShellAboutA(
    HWND hWnd,   // optional
    LPCSTR szApp,
    LPCSTR szOtherStuff,   // optional
    HICON hIcon   // optional
);

パラメーター

名前方向
hWndHWNDinoptional
szAppLPCSTRin
szOtherStuffLPCSTRinoptional
hIconHICONinoptional

戻り値の型: INT

各言語での呼び出し定義

// SHELL32.dll  (ANSI / -A)
#include <windows.h>

INT ShellAboutA(
    HWND hWnd,   // optional
    LPCSTR szApp,
    LPCSTR szOtherStuff,   // optional
    HICON hIcon   // optional
);
[DllImport("SHELL32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int ShellAboutA(
    IntPtr hWnd,   // HWND optional
    [MarshalAs(UnmanagedType.LPStr)] string szApp,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string szOtherStuff,   // LPCSTR optional
    IntPtr hIcon   // HICON optional
);
<DllImport("SHELL32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function ShellAboutA(
    hWnd As IntPtr,   ' HWND optional
    <MarshalAs(UnmanagedType.LPStr)> szApp As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> szOtherStuff As String,   ' LPCSTR optional
    hIcon As IntPtr   ' HICON optional
) As Integer
End Function
' hWnd : HWND optional
' szApp : LPCSTR
' szOtherStuff : LPCSTR optional
' hIcon : HICON optional
Declare PtrSafe Function ShellAboutA Lib "shell32" ( _
    ByVal hWnd As LongPtr, _
    ByVal szApp As String, _
    ByVal szOtherStuff As String, _
    ByVal hIcon As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ShellAboutA = ctypes.windll.shell32.ShellAboutA
ShellAboutA.restype = ctypes.c_int
ShellAboutA.argtypes = [
    wintypes.HANDLE,  # hWnd : HWND optional
    wintypes.LPCSTR,  # szApp : LPCSTR
    wintypes.LPCSTR,  # szOtherStuff : LPCSTR optional
    wintypes.HANDLE,  # hIcon : HICON optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHELL32.dll')
ShellAboutA = Fiddle::Function.new(
  lib['ShellAboutA'],
  [
    Fiddle::TYPE_VOIDP,  # hWnd : HWND optional
    Fiddle::TYPE_VOIDP,  # szApp : LPCSTR
    Fiddle::TYPE_VOIDP,  # szOtherStuff : LPCSTR optional
    Fiddle::TYPE_VOIDP,  # hIcon : HICON optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "shell32")]
extern "system" {
    fn ShellAboutA(
        hWnd: *mut core::ffi::c_void,  // HWND optional
        szApp: *const u8,  // LPCSTR
        szOtherStuff: *const u8,  // LPCSTR optional
        hIcon: *mut core::ffi::c_void  // HICON optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SHELL32.dll", CharSet = CharSet.Ansi)]
public static extern int ShellAboutA(IntPtr hWnd, [MarshalAs(UnmanagedType.LPStr)] string szApp, [MarshalAs(UnmanagedType.LPStr)] string szOtherStuff, IntPtr hIcon);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_ShellAboutA' -Namespace Win32 -PassThru
# $api::ShellAboutA(hWnd, szApp, szOtherStuff, hIcon)
#uselib "SHELL32.dll"
#func global ShellAboutA "ShellAboutA" sptr, sptr, sptr, sptr
; ShellAboutA hWnd, szApp, szOtherStuff, hIcon   ; 戻り値は stat
; hWnd : HWND optional -> "sptr"
; szApp : LPCSTR -> "sptr"
; szOtherStuff : LPCSTR optional -> "sptr"
; hIcon : HICON optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SHELL32.dll"
#cfunc global ShellAboutA "ShellAboutA" sptr, str, str, sptr
; res = ShellAboutA(hWnd, szApp, szOtherStuff, hIcon)
; hWnd : HWND optional -> "sptr"
; szApp : LPCSTR -> "str"
; szOtherStuff : LPCSTR optional -> "str"
; hIcon : HICON optional -> "sptr"
; INT ShellAboutA(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
#uselib "SHELL32.dll"
#cfunc global ShellAboutA "ShellAboutA" intptr, str, str, intptr
; res = ShellAboutA(hWnd, szApp, szOtherStuff, hIcon)
; hWnd : HWND optional -> "intptr"
; szApp : LPCSTR -> "str"
; szOtherStuff : LPCSTR optional -> "str"
; hIcon : HICON optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shell32 = windows.NewLazySystemDLL("SHELL32.dll")
	procShellAboutA = shell32.NewProc("ShellAboutA")
)

// hWnd (HWND optional), szApp (LPCSTR), szOtherStuff (LPCSTR optional), hIcon (HICON optional)
r1, _, err := procShellAboutA.Call(
	uintptr(hWnd),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(szApp))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(szOtherStuff))),
	uintptr(hIcon),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function ShellAboutA(
  hWnd: THandle;   // HWND optional
  szApp: PAnsiChar;   // LPCSTR
  szOtherStuff: PAnsiChar;   // LPCSTR optional
  hIcon: THandle   // HICON optional
): Integer; stdcall;
  external 'SHELL32.dll' name 'ShellAboutA';
result := DllCall("SHELL32\ShellAboutA"
    , "Ptr", hWnd   ; HWND optional
    , "AStr", szApp   ; LPCSTR
    , "AStr", szOtherStuff   ; LPCSTR optional
    , "Ptr", hIcon   ; HICON optional
    , "Int")   ; return: INT
●ShellAboutA(hWnd, szApp, szOtherStuff, hIcon) = DLL("SHELL32.dll", "int ShellAboutA(void*, char*, char*, void*)")
# 呼び出し: ShellAboutA(hWnd, szApp, szOtherStuff, hIcon)
# hWnd : HWND optional -> "void*"
# szApp : LPCSTR -> "char*"
# szOtherStuff : LPCSTR optional -> "char*"
# hIcon : HICON optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。