⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 handlerroutine.java

📁 Java调用Windows API,支持Office
💻 JAVA
字号:
//******************************************************************
// Released under the DevelopMentor OpenSource Software License.
// Please consult the LICENSE file in the project root directory,
// or at http://www.develop.com for details before using this
// software.
//******************************************************************

package org.jawin.donated.win32;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import org.jawin.WinFuncPtr;
import org.jawin.io.LittleEndianInputStream;
import org.jawin.io.LittleEndianOutputStream;
import org.jawin.io.NakedByteStream;

public abstract class HandlerRoutine extends WinFuncPtr {
    public static final int CTRL_C_EVENT        =0;
    public static final int CTRL_BREAK_EVENT    =1;
    public static final int CTRL_CLOSE_EVENT    =2;
    public static final int CTRL_LOGOFF_EVENT   =5;
    public static final int CTRL_SHUTDOWN_EVENT =6;

    /*
     * FUNCTION
     */
    abstract public boolean call(long dwCtrlType)
            throws IOException;

    /*
     * MARSHALLING
     */

    public static final String marshal = "XFHANDLER(01I:I)";
    protected byte[] call(byte[] inargs, Object[] inobjs)
            throws IOException
    {
        LittleEndianInputStream leis = new LittleEndianInputStream(
                    new ByteArrayInputStream(inargs));
        int dwCtrlType = leis.readInt();
        boolean ret = call(dwCtrlType);
        NakedByteStream nbs = new NakedByteStream();
        LittleEndianOutputStream leos = new LittleEndianOutputStream(nbs);
        leos.writeInt(ret ? 1 : 0);
        return nbs.getInternalBuffer();
    }
}




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -