Hello, Win32 API(BeanShell) World!

Posted on 1月 12th, 2013 by cx20

Win32 API(BeanShell)

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

ソースコード

import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.internal.win32.TCHAR;
 
TCHAR lpText = new TCHAR(0, "Hello, Win32 API World!", true);
TCHAR lpCaption = new TCHAR(0, "Hello, World", true);
OS.MessageBox(0, lpText, lpCaption, OS.MB_OK );

実行方法

C:¥> SET CLASSPATH=bsh-2.0b4.jar;org.eclipse.swt.win32.win32.x86_3.6.1.v3655c.jar;%CLASSPATH%
C:¥> java bsh.Interpreter Hello.bsh

実行結果

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

Tags:

Categories: BeanShell, Java, SWT, Win32 API

コメントを残す

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

WP-SpamFree by Pole Position Marketing