Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug › SymSetParentWindow

SymSetParentWindow

関数
シンボルハンドラの親ウィンドウを設定する。
DLLdbghelp.dll呼出規約winapiSetLastErrorあり

シグネチャ

// dbghelp.dll
#include <windows.h>

BOOL SymSetParentWindow(
    HWND hwnd
);

パラメーター

名前方向
hwndHWNDin

戻り値の型: BOOL

各言語での呼び出し定義

// dbghelp.dll
#include <windows.h>

BOOL SymSetParentWindow(
    HWND hwnd
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dbghelp.dll", SetLastError = true, ExactSpelling = true)]
static extern bool SymSetParentWindow(
    IntPtr hwnd   // HWND
);
<DllImport("dbghelp.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SymSetParentWindow(
    hwnd As IntPtr   ' HWND
) As Boolean
End Function
' hwnd : HWND
Declare PtrSafe Function SymSetParentWindow Lib "dbghelp" ( _
    ByVal hwnd As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SymSetParentWindow = ctypes.windll.dbghelp.SymSetParentWindow
SymSetParentWindow.restype = wintypes.BOOL
SymSetParentWindow.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('dbghelp.dll')
SymSetParentWindow = Fiddle::Function.new(
  lib['SymSetParentWindow'],
  [
    Fiddle::TYPE_VOIDP,  # hwnd : HWND
  ],
  Fiddle::TYPE_INT)
#[link(name = "dbghelp")]
extern "system" {
    fn SymSetParentWindow(
        hwnd: *mut core::ffi::c_void  // HWND
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dbghelp.dll", SetLastError = true)]
public static extern bool SymSetParentWindow(IntPtr hwnd);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dbghelp_SymSetParentWindow' -Namespace Win32 -PassThru
# $api::SymSetParentWindow(hwnd)
#uselib "dbghelp.dll"
#func global SymSetParentWindow "SymSetParentWindow" sptr
; SymSetParentWindow hwnd   ; 戻り値は stat
; hwnd : HWND -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "dbghelp.dll"
#cfunc global SymSetParentWindow "SymSetParentWindow" sptr
; res = SymSetParentWindow(hwnd)
; hwnd : HWND -> "sptr"
; BOOL SymSetParentWindow(HWND hwnd)
#uselib "dbghelp.dll"
#cfunc global SymSetParentWindow "SymSetParentWindow" intptr
; res = SymSetParentWindow(hwnd)
; hwnd : HWND -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dbghelp = windows.NewLazySystemDLL("dbghelp.dll")
	procSymSetParentWindow = dbghelp.NewProc("SymSetParentWindow")
)

// hwnd (HWND)
r1, _, err := procSymSetParentWindow.Call(
	uintptr(hwnd),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function SymSetParentWindow(
  hwnd: THandle   // HWND
): BOOL; stdcall;
  external 'dbghelp.dll' name 'SymSetParentWindow';
result := DllCall("dbghelp\SymSetParentWindow"
    , "Ptr", hwnd   ; HWND
    , "Int")   ; return: BOOL
●SymSetParentWindow(hwnd) = DLL("dbghelp.dll", "bool SymSetParentWindow(void*)")
# 呼び出し: SymSetParentWindow(hwnd)
# hwnd : HWND -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。