wtime.java
/*
* Copyright (c) 2004-2005 Servertec. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* THIS NOTICE MUST NOT BE ALTERED NOR REMOVED.
*
* CopyrightVersion 1.0
*/
import java.text.MessageFormat;
import stec.jenie.Dll;
import stec.jenie.Function;
import stec.jenie.NativeParameter;
import stec.jenie.Structure;
import stec.jenie.USHORT;
import stec.jenie.NativeObject;
import stec.jenie.Pointer;
import stec.jenie.NativeException;
import stec.jenie.HANDLE;
import stec.jenie.AnsiString;
import stec.jenie.UINT;
/**
* This example displays the local time in a message box using the WIN32 API MessageBoxA function in User32.dll.
*/
public final class wtime extends time
{
public final static void main(String[] args) throws Exception
{
Dll dll = new Dll("User32");
try
{
dll.getFunction("MessageBoxA").call
(
new NativeParameter[]
{
new HANDLE(),
new Pointer(new AnsiString(getLocalTime())),
new Pointer(new AnsiString("System Time")),
new UINT(0)
}
);
}
finally
{
dll.release();
}
}
}