Hello, Win32 API(Nemerle) World!

Posted on 6月 25th, 2012 by cx20

Win32 API(Nemerle)

Win32 API は、Windows の機能にアクセスする為の API(Application Programming Interface)である。
以下は Nemerle による Win32 API の呼出し例である。

ソースコード

using System;
using System.Runtime.InteropServices;
 
class Hello {
    [DllImport("user32.dll")]
    public extern static MessageBox(hwnd : int, text : string, caption : string, type : int) : int;
 
    public static Main() : void {
        _ = MessageBox( 0, "Hello, Win32 API(Nemerle) World!", "Hello, World!", 0);
    }
}

コンパイル方法

C:¥> ncc -o hello hello.n

実行結果

---------------------------
Hello, World!
---------------------------
Hello, Win32 API(Nemerle) World!
---------------------------
OK   
---------------------------

Tags:

Categories: .NET, Nemerle, Win32 API

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

WP-SpamFree by Pole Position Marketing