亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? windowstrayicon.java

?? 用Java實現Windows系統托盤圖標源碼1
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/***
 * Windows Tray Icon
 * -----------------
 *
 * Written by Jan Struyf
 *
 *  jan.struyf@cs.kuleuven.ac.be
 *  http://jeans.studentenweb.org/java/trayicon/trayicon.html
 *
 * Please mail me if you
 *	- 've found bugs
 *	- like this program
 *	- don't like a particular feature
 *	- would like something to be modified
 *
 * I always give it my best shot to make a program useful and solid, but
 * remeber that there is absolutely no warranty for using this program as
 * stated in the following terms:
 *
 * THERE IS NO WARRANTY FOR THIS PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
 * LAW. THE COPYRIGHT HOLDER AND/OR OTHER PARTIES WHO MAY HAVE MODIFIED THE
 * PROGRAM, PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
 * TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
 * PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
 * REPAIR OR CORRECTION.
 *
 * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL ANY COPYRIGHT HOLDER,
 * OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM,
 * BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
 * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
 * PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
 * INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
 * PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
 * PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 *
 * May the Force be with you... Just compile it & use it!
 */

package com.jeans.trayicon;

import java.awt.image.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;

/**
 * WindowsTrayIcon
 * A Java Implementation for showing icons in the Windows System Tray
 *
 * Written by Jan Struyf
 *	(jan.struyf@cs.kuleuven.ac.be)
 *	(http://ace.ulyssis.org/~jeans)
 *
 * Instantiate this class for each icon
 * This file comes with native code in TRAYICON.DLL
 * The DLL should go in C:/WINDOWS/SYSTEM or in your current directory
 */
public class WindowsTrayIcon {

    public final static String TRAY_VERSION = "1.7.9b";

    private static TrayIconKeeper m_Keeper;
    private static TrayDummyComponent m_Dummy;
    private static MouseListener m_MouseHook;
    private static Window m_CurrentWindow;

/****************************************************************************************************************
 *                                                                                                              *
 * Initialisation / Termination                                                                                 *
 *                                                                                                              *
 ****************************************************************************************************************/

/**
 * Init native library - call this method in the main() method of your app
 *
 * Param appName = the title for the hidden window
 *	Each app has it's own hidden window that receives the mouse/menu messages for it's Tray Icons
 *      The window title is used by sendWindowsMessage() and isRunning() to identify an app
 */
	public static void initTrayIcon(String appName) {
		initTrayIcon(appName, new WindowsTrayIcon());
	}
	
/**
 * Free all native resources - call this method before System.exit()
 */
	public static void cleanUp() {
		if (m_Keeper != null) {
			m_Keeper.doNotify();
			m_Keeper = null;
		}
		termTrayIcon();
	}
	
/****************************************************************************************************************
 *                                                                                                              *
 * Constructor                                                                                                  *
 *                                                                                                              *
 ****************************************************************************************************************/

/**
 * Construct a new Tray Icon
 * Using a Java Image - This can be loaded from a 16x16 GIF or JPG file
 *
 * Param image	16x16 icon - make sure it's loaded in memory - use MediaTracker
 * Param w	the icon width - eg. 16
 * Param h	the icon height - eg. 16
 *
 * Exception TrayIconException - if something goes wrong :O(
 *	- Too many icons allocated
 *	- Error initializing native code DLL
 *	- Error setting up Windows notify procedure
 *	- Error loading icon image
 * Exception InterruptedException - if the thread loading the image is interrupted
 */
	public WindowsTrayIcon(Image image, int w, int h) throws TrayIconException, InterruptedException {
		// Allocate new id for icon (native routine)
		m_ID = getFreeId();
		if (m_ID == TOOMANYICONS)
			throw new TrayIconException("Too many icons allocated");
		if (m_ID == DLLNOTFOUND)
			throw new TrayIconException("Error initializing native code DLL");
		if (m_ID == NOTIFYPROCERR)
			throw new TrayIconException("Error setting up Windows notify procedure");
		// Store image data and size
		setImage(image, w, h);
	}
	
/****************************************************************************************************************
 *                                                                                                              *
 * Methods                                                                                                      *
 *                                                                                                              *
 ****************************************************************************************************************/

/**
 * Change this icon's Image
 * Using a Java Image - This can be loaded from a 16x16 GIF or JPG file
 *
 * Param image	16x16 icon - make sure it's loaded in memory - use MediaTracker
 * Param w	the icon width
 * Param h	the icon height
 *
 * Exception TrayIconException - if something goes wrong :O(
 *	- Error loading icon image
 * Exception InterruptedException - if the thread loading the image is interrupted
 */
	public void setImage(Image image, int w, int h) throws TrayIconException, InterruptedException {
		try {
			// Collect pixel data in array
			int[] pixels = new int[w * h];
			PixelGrabber pg = new PixelGrabber(image, 0, 0, w, h, pixels, 0, w);
			pg.grabPixels();
			if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
				freeIcon();
				throw new TrayIconException("Error loading icon image");
			}
			// Send image data to the native library
			setIconData(m_ID, w, h, pixels);
		} catch (InterruptedException ex) {
			freeIcon();
			throw ex;
		} catch (NullPointerException ex) {
			freeIcon();
			throw ex;
		}
	}

/**
 * Show/Hide this icon in the Windows System Tray
 *
 * Param status true = show, false = hide
 */
	public void setVisible(boolean status) {
		showIcon(m_ID, status);
	}

/**
 * Test if this icon is currently visible in the Windows System Tray
 *
 * Returns true if visible
 */
	public boolean isVisible() {
		return testVisible(m_ID) == 1;
	}

/**
 * Changes the text for the ToolTip of this icon
 * The ToolTip is displayed when the user mouses over the icon
 *
 * Param tip = the new text for the ToolTip
 */
	public void setToolTipText(String tip) {
		setToolTip(m_ID, tip);
	}
	
/**
 * Display a balloon message for the icon
 */
	public final static int BALLOON_NONE = 0;
	public final static int BALLOON_INFO = 1;
	public final static int BALLOON_WARNING = 2;
	public final static int BALLOON_ERROR = 3;
	public final static int BALLOON_NOSOUND = 0x10;

	public void showBalloon(String msg, String title, int timeout, int flags) throws TrayIconException {
		if (showBalloon(m_ID, msg, title, timeout, flags) == 0) {
			throw new TrayIconException("Error showing Balloon message");
		}
	}

/**
 * Add an ActionLister to this icon
 * Just like with java.awt.Button or javax.swing.JButton
 *
 * Param listener = your listener
 */
	public void addActionListener(ActionListener listener) {
		if (m_ActList == null) {
			m_ActList = new Vector();
			clickEnable(this, m_ID, true);
		}
		m_ActList.addElement(listener);
	}
	
	public void removeActionListener(ActionListener listener) {
		m_ActList.removeElement(listener);
	}
	
	public void addMouseListener(MouseListener listener) {
		if (m_MouseList == null) {
			m_MouseList = new Vector();
			clickEnable(this, m_ID, true);
		}
		m_MouseList.addElement(listener);
	}
	
	public void removeMouseListener(MouseListener listener) {
		m_MouseList.removeElement(listener);
	}

	public void addBalloonListener(TrayBalloonListener listener) {
		if (m_BalloonList == null) {
			m_BalloonList = new Vector();
			clickEnable(this, m_ID, true);
		}		
		m_BalloonList.addElement(listener);	
	}
	
	public void removeBalloonListener(TrayBalloonListener listener) {
		m_BalloonList.removeElement(listener);	
	}
	
/**
 * Set new popup menu
 * The popup menu is displayed when the user right clicks the icon
 * See class TrayIconPopup, TrayIconPopupSimpleItem, ..
 *
 * Param popup = the popup menu
 */
	public void setPopup(TrayIconPopup popup) {
		if (popup == null) {
			m_Popup = null;
			initPopup(m_ID, -1);
		} else {
			if (m_Popup == null) clickEnable(this, m_ID, true);
			int levels = popup.getNbLevels();
			initPopup(m_ID, levels);
			popup.setTrayIcon(this, m_ID, -1);
			m_Popup = popup;		    
		}
	}

/**
 * Free all native resources for this icon
 * On exit use cleanUp()
 */
	public void freeIcon() {
		clickEnable(this, m_ID, false);
		freeIcon(m_ID);
	}
		
	public static native void setAlwaysOnTop(Component wnd, boolean onTop);
	
public final static int UNICODE_CONV_BALLOON = 2;
public final static int UNICODE_CONV_SUPPORT = 1;

	public static native void enableUnicodeConversion(int component, boolean enable);
	
	public static native boolean hasUnicodeConversion(int component);
	
	public static native boolean supportsBalloonMessages();

/**
 * Return error code from native library - use for debugging
 */
	public static native int getLastError();

// No error occured since the last call to getLastError()
// There are a lot errors declared but they are only there for debug reasons
	public static final int NOERR = 0;

// The ActionListeners of the icon need to be notified when the user clicks it
// In the Windows API this is accomplished using a Notify Procedure
 	public static final int NOTIFYPROCERR = -1;

// The DLL has a fixed data structure that can contain up to 100 icons
// Hope that's enough for you
	public static final int TOOMANYICONS = -2;

// This happens when C++ is out of memory
	public static final int NOTENOUGHMEM = -3;

// Each icon has one unique id number
	public static final int WRONGICONID = -4;

// The native code can't locate the DLL
// Try moving it to C:/WINDOWS/SYSTEM or something like that
	public static final int DLLNOTFOUND = -5;

// Invocation code can't find your Java VM during callback
	public static final int NOVMS = -6;

// Invocation API can't attach native thread to your Java VM
	public static final int ERRTHREAD = -7;

// Error in lookup of the notifyListeners() method in this class
// The DLL has to do this when the user clicks one of your icons
	public static final int METHODID = -8;

// Not really an error..
// This happens when the user clicks an icon that has no ActionListener yet
	public static final int NOLISTENER = -9;

// One of the Invocation JNI Functions returned an error
	public static final int JNIERR = -10;

// Error showing balloon
	public static final int ERRORBALLOON = -18;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色噜噜狠狠一区二区三区果冻| 日韩av网站在线观看| 国产一区日韩二区欧美三区| 日韩欧美三级在线| 极品少妇xxxx精品少妇| 国产网站一区二区三区| 91免费在线播放| 亚洲国产乱码最新视频 | 六月丁香婷婷色狠狠久久| 日韩欧美一区二区免费| 国产自产高清不卡| 亚洲三级在线观看| 91精品麻豆日日躁夜夜躁| 久久电影网站中文字幕| 国产精品免费丝袜| 欧美色老头old∨ideo| 日韩中文字幕不卡| 欧美激情一二三区| 欧洲视频一区二区| 国产一区二区三区久久久| 亚洲欧洲美洲综合色网| 欧洲精品中文字幕| 韩国理伦片一区二区三区在线播放 | 色哟哟精品一区| 日本中文字幕一区| 国产丝袜在线精品| 欧美日韩大陆在线| 国产成人精品午夜视频免费| 亚洲午夜羞羞片| 国产三级一区二区三区| 欧美日韩国产成人在线免费| 在线精品视频小说1| 美女脱光内衣内裤视频久久网站| 欧美精彩视频一区二区三区| 欧美日韩中文精品| 成人小视频在线观看| 青青青爽久久午夜综合久久午夜| 国产精品色哟哟| 欧美大黄免费观看| 欧美亚洲国产一区二区三区va | 99riav一区二区三区| 青青草国产成人av片免费| 中文字幕亚洲视频| 久久蜜桃一区二区| 91精品国产综合久久久久久| 99国产精品久久| 国产精品99久久久| 蜜臀99久久精品久久久久久软件| 亚洲少妇中出一区| 国产精品天美传媒| 久久综合九色综合97婷婷女人 | 欧美高清www午色夜在线视频| 成人午夜激情在线| 国产综合色视频| 日韩激情一区二区| 亚洲午夜久久久久久久久电影院| 中文天堂在线一区| 国产欧美精品一区二区三区四区| 欧美一区二区三区视频在线| 欧美视频在线观看一区| 在线免费观看视频一区| av综合在线播放| 成人少妇影院yyyy| 国产成人综合视频| 国产精品乡下勾搭老头1| 色呦呦网站一区| 99re成人精品视频| jlzzjlzz亚洲日本少妇| 粉嫩aⅴ一区二区三区四区| 韩日精品视频一区| 精品亚洲porn| 黑人巨大精品欧美一区| 蜜臀av一级做a爰片久久| 五月婷婷综合网| 丝袜美腿亚洲色图| 午夜不卡av在线| 日韩极品在线观看| 日韩av一区二| 激情av综合网| 国产美女在线观看一区| 国产一区二区三区四区五区美女 | 亚洲午夜在线视频| 一区二区三区四区av| 一区二区在线观看不卡| 亚洲精品欧美激情| 天天综合日日夜夜精品| 日本欧美在线看| 精品一区二区影视| 国产风韵犹存在线视精品| 成人午夜视频网站| 99精品欧美一区二区蜜桃免费| 93久久精品日日躁夜夜躁欧美| 成人激情免费视频| 91久久精品一区二区二区| 欧美视频完全免费看| 日韩三级视频在线看| 久久精品一区二区| 亚洲欧美日韩久久精品| 亚洲国产一区二区在线播放| 毛片av一区二区三区| 国产成人免费av在线| 91视频在线看| 欧美麻豆精品久久久久久| 精品成人佐山爱一区二区| 国产精品系列在线| 亚洲国产aⅴ成人精品无吗| 免费一级欧美片在线观看| 国产精品一区免费在线观看| 99久久综合99久久综合网站| 欧美色电影在线| 久久一区二区三区国产精品| √…a在线天堂一区| 日韩av一区二区在线影视| 东方欧美亚洲色图在线| 欧美色视频在线观看| xf在线a精品一区二区视频网站| 国产精品久久毛片a| 婷婷综合在线观看| 懂色一区二区三区免费观看| 欧美三级电影在线观看| 久久久欧美精品sm网站| 亚洲综合成人在线| 国产乱对白刺激视频不卡| 色香蕉久久蜜桃| 337p日本欧洲亚洲大胆色噜噜| 亚洲日本va在线观看| 久久精品国产亚洲a| 色哟哟一区二区| 久久久久国产精品厨房| 婷婷亚洲久悠悠色悠在线播放| 国产精品一级黄| 欧美一级一区二区| 亚洲精选视频在线| 国产精品一区一区三区| 91精品国产综合久久婷婷香蕉 | 国产亚洲女人久久久久毛片| 一区二区高清在线| 成人国产精品免费| 欧美精品一区二区三区一线天视频 | 一区二区在线看| 成人激情校园春色| 精品日韩99亚洲| 午夜精品久久久久久久久久| 91一区在线观看| 国产视频不卡一区| 久久99九九99精品| 欧美日产在线观看| 亚洲h动漫在线| 欧洲精品在线观看| 樱花影视一区二区| 99国产精品久久| 日韩一区日韩二区| 懂色一区二区三区免费观看| 国产亚洲欧美激情| 国产老妇另类xxxxx| 久久先锋影音av鲁色资源| 麻豆一区二区在线| 欧美一区二区三区日韩视频| 午夜久久久久久| 欧美日韩另类国产亚洲欧美一级| 亚洲精品国产一区二区精华液| www.视频一区| 亚洲欧洲美洲综合色网| 99re热这里只有精品视频| 中文字幕一区av| 91视视频在线观看入口直接观看www| 国产精品久久99| 91亚洲男人天堂| 洋洋av久久久久久久一区| 色av成人天堂桃色av| 一区二区免费在线| 777xxx欧美| 蜜桃av一区二区| 欧美精品一区二区三区很污很色的 | 国产在线乱码一区二区三区| 久久影院电视剧免费观看| 国产一区二区三区观看| 久久精品水蜜桃av综合天堂| 国产成人精品免费| 国产精品盗摄一区二区三区| 99国产欧美久久久精品| 一区二区不卡在线播放| 欧美日韩不卡在线| 美脚の诱脚舐め脚责91| 久久久精品国产免费观看同学| 国产91在线观看| 亚洲免费在线观看| 欧美日韩成人一区| 国产精品中文欧美| 国产精品久久二区二区| 欧美美女网站色| 国产老女人精品毛片久久| 成人欧美一区二区三区1314| 欧美午夜免费电影| 麻豆国产91在线播放| 中文字幕一区二区三中文字幕| 欧美性极品少妇| 国内精品在线播放| 亚洲免费大片在线观看| 91精品国产91热久久久做人人|