Archive for 3月 11th, 2013

  1. Hello, Win32 API(Tcl) World!

    Posted on 3月 11th, 2013 by cx20

    Win32 API(Tcl)

    Win32 API は、Windows の機能にアクセスする為の API(Application Programming Interface)である。
    以下は Tcl にて Ffidl を使用した Win32 API 呼出しの例となっている。

    ソースコード

    load Ffidl06.dll
    ffidl::callout dll_MessageBox {int pointer-utf8 pointer-utf8 int} int [ffidl::symbol user32.dll MessageBoxA]
    dll_MessageBox 0 "Hello, Win32 API World!" "Hello, World!" 0

    実行方法

    C:¥> tclsh Hello.tcl

    実行結果

    ---------------------------
    Hello, World!
    ---------------------------
    Hello, Win32 API World!
    ---------------------------
    OK   
    ---------------------------