system-tray

Force Windows to show a system tray icon

房东的猫 提交于 2020-01-24 03:49:08
问题 This is a pretty stupid question, but here goes: Is there a way (in .net) to force Windows to show your system tray icon instead of hiding it? I don't want to do this all the time, but at least for the first time my application is run I would like it to be visible in the system tray. 回答1: Are you taking about Windows 7? If so, then no. 回答2: As Raymond Chen would say, "Imagine if this were possible." Now tell me how many apps would choose not to force their tray icon to be always visible!

Writing text to the system tray instead of an icon

旧时模样 提交于 2020-01-22 10:45:28
问题 I am trying to display 2-3 updatable characters in the system tray rather than display an .ico file - similar to what CoreTemp does when they display the temperature in the system try: I am using a NotifyIcon in my WinForms application along with the following code: Font fontToUse = new Font("Microsoft Sans Serif", 8, FontStyle.Regular, GraphicsUnit.Pixel); Brush brushToUse = new SolidBrush(Color.White); Bitmap bitmapText = new Bitmap(16, 16); Graphics g = Drawing.Graphics.FromImage

Adding JPopupMenu to the TrayIcon

吃可爱长大的小学妹 提交于 2020-01-21 02:54:05
问题 I want to add JPopupMenu to the task bar as a TrayIcon ( i.e systemTray.add(trayIcon) ) but I haven't found a way to do so.From the docs the constructor of TrayIcon looks like : public TrayIcon(Image image, String tooltip, PopupMenu popup) Is there any way I can do this ? 回答1: This is a known problem. There is a bug report, which contains the outline of a workaround. I've adapted that below: // Build your popup menu final JPopupMenu trayPopup = new JPopupMenu(); // I'm using actions, there

Can I differentiate between single and double clicks on the system tray icon?

十年热恋 提交于 2020-01-06 02:52:07
问题 I create my system tray icon using Shell_NotifyIcon and then trap its WM_LBUTTONDBLCLK notifications for when a user double-clicks the icon (I use it show a dialog window.) I also trap WM_RBUTTONDOWN notifications to show the context menu. Now I'm thinking that it would be nice to show a context menu after a single left click. But how do I do that? If I trap WM_LBUTTONDOWN and show my context menu it works fine. But then when someone double-clicks the icon, it first shows my context menu and

threading for tray icon application

拈花ヽ惹草 提交于 2020-01-02 09:13:22
问题 I want to have a tray icon to inform me whether or not my COM port is plugged-in. It should change every 5 seconds according to the state of the COM port. I also want the ability to kill the program using the contextual menu of the tray icon. I figured out how to have the refreshing or the menu, but I don't know how to have both. import sys import glob import serial import time from PyQt4 import QtGui, QtCore import sys import threading from multiprocessing import Process, Queue #script

Create a background process with system tray icon

非 Y 不嫁゛ 提交于 2019-12-30 10:38:33
问题 I'm trying to make a Windows app that checks some things in the background, and inform the user via a systray icon. The app is made with Not managed C++ and there is no option to switch to .net or Java. If the user wants to stop the app, he will use the tray icon. The app can't be a Service because of the systray side and because it must run without installing anything on the user computer ( it's a single .exe ) Using the typical Win32 program structure ( RegisterClass, WndProc and so on ) i

Best Icon size for displaying in the tray

痞子三分冷 提交于 2019-12-29 05:21:06
问题 I am working on a Delphi program which will display an icon on the "tray". I am doing it "the hard way" (using the Shell_NotifyIcon api, etc and not a component, for reasons outside the point here). It's working fine but sometimes it seems like the icon is a little "blurry" in some systems. Now, I have experimented using 16x16 bmp, 32x32, etc. It seems like the system scales it down to the needed size, but the results are different depending on the OS version (or perhaps something else as

How to Set SystemTray Color

試著忘記壹切 提交于 2019-12-25 04:38:22
问题 I was attempting to change the color of the SystemTray , but for some reason I cannot get it to work correctly. I am not sure what I am doing wrong. shell:SystemTray.IsVisible="True" shell:SystemTray.BackgroundColor="Cyan" Is this not correct? 回答1: shell:SystemTray.IsVisible="True" shell:SystemTray.BackgroundColor="Cyan" Is the proper solution. I am using PhoneThemeManager from NuGet which automatically overrides device defaults to force either light or dark theme. Setting the SystemTray

Click System Tray Icon Python Win32

本小妞迷上赌 提交于 2019-12-25 04:02:27
问题 Environment: I'm using Python 2.7 (32-bit) on Windows 7 64-bit. I'm using win32 Api to make a windows automation tool (I know there are some that exist but I'm making my own). Problem: I'm stuck at the windows System Tray (Notification Area) , I get access to the toolbar and I'm able to use TB_GETBUTTON to get the toolbar button info, but I'm having trouble with two things: 1) How do I left/right click an icon in the notification tray? Is there a way to do it by sending a message to the

Java System Tray PopupMenu MenuItem with icons and variable fonts

和自甴很熟 提交于 2019-12-25 03:16:21
问题 As in the title, is there a way to do it? The introductory article is either misleading or not completed. 回答1: Fonts is not a problem so I'm not sure why that is part of the title. Icons is different. Check out the section from the Swing tutorial How to Use the System Tray. The tutorial explains the limitations and provides a link to a Bug Id which has some suggestions. I don't know if the suggestion work since I haven't tried them. 来源: https://stackoverflow.com/questions/5357713/java-system