systray

system_tray to receive notifications of device removal

天大地大妈咪最大 提交于 2019-12-13 22:28:59
问题 I'm writing an application which check for my usb device and if the device is avialable make a dial-up connection. I use Rasdial to establish the connection. Unfortunately if I remove the USB cable the connection is not getting disconnected or notified to the user. So here I'm in a situation to check for the device removal . I Planned to run my application in system tray and wait for the device removal. Am I right here? If am right how to make the application wait for device removal,

Rare error on Tray icon creation, after a user log out / log in

冷暖自知 提交于 2019-12-11 06:25:18
问题 I create a systray icon with: BOOL TrayMessage(HWND hWnd, DWORD dwMessage) { NOTIFYICONDATA nid; nid.cbSize = sizeof(nid); nid.hWnd = hWnd; nid.uID = 1; nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MYAPP)); lstrcpy(nid.szTip, L"MyApp"); nid.uCallbackMessage = WM_NOTIFYICON; return Shell_NotifyIcon(dwMessage, &nid); } when the app starts / the window is created: case WM_CREATE: if (!TrayMessage(hWnd, NIM_ADD)) MessageBox(hMainWnd, L"Tray error.

How to Shell_NotifyIcon WITHOUT adding an icon in the notification area

…衆ロ難τιáo~ 提交于 2019-12-07 03:14:52
问题 MSDN's documentation about Notifications and the Notification Area is pretty clear in the requirement for having an icon in the notification area in order to display a notification: To display a notification, you must have an icon in the notification area . In certain cases, such as Microsoft Communicator or battery level, that icon will already be present. In many other cases, however, you will add an icon to the notification area only as long as is needed to show the notification. Since I

freedesktop XEmbed systray client code in C, Xlib

不问归期 提交于 2019-12-06 11:00:28
问题 I've been trying to implement a systray icon using straight C and Xlib, going along with the freedesktop specification [0]. I can't seem to get my Window to embed into my desktop manager's systray[1], while other apps seem to be able to do it. I am not sure how to go forward debugging this, but I've provided minimal sample code below. I haven't been able to find any sample code using straight Xlib and C, and all the suggestions I've seen have been with regard to some framework like Gtk/Qt

How to Shell_NotifyIcon WITHOUT adding an icon in the notification area

╄→гoц情女王★ 提交于 2019-12-05 07:04:29
MSDN's documentation about Notifications and the Notification Area is pretty clear in the requirement for having an icon in the notification area in order to display a notification: To display a notification, you must have an icon in the notification area . In certain cases, such as Microsoft Communicator or battery level, that icon will already be present. In many other cases, however, you will add an icon to the notification area only as long as is needed to show the notification. Since I do not wish to add any icon to the notification area, I was thinking of perhaps "reusing" an existing

C#, how to call a form object from a tray based application

偶尔善良 提交于 2019-12-04 07:01:18
问题 I am trying to load a form class from a program running as a tray icon that originally used FileList frmFileList = new FileList(); Now instead of a filelist I want to use a custom form but I get the error: Error 1 'System.Windows.Forms.Control.ControlCollection' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'System.Windows.Forms.Control.ControlCollection' could be found (are you missing a using directive or an assembly reference?)

Delphi “Tray” icon (NotifyIcon) context-menu does not disappear when clicking outside it

雨燕双飞 提交于 2019-12-04 05:45:57
问题 I'm trying to show a popup menu when right clicking my Notification Icon, which works fine; But I want the menu to disappear when the user clicks outside of that menu. It's supposedly by design as per KB135788 - PRB: Menus for Notification Icons Do Not Work Correctly (archive) . But no decent app I know of behaves like this. I've tried calling SetForegroundWindow using the popup menu's handle to no avail. I'm sure it's possible to work around this, as I've done it years ago but don't remember

How can I show a systray tooltip longer than 63 chars?

爱⌒轻易说出口 提交于 2019-12-03 07:58:49
问题 How can I show a systray tooltip longer than 63 chars? NotifyIcon.Text has a 63 chars limit, but I've seen that VNC Server has a longer tooltip. How can I do what VNC Server does? 回答1: Actually, it is a bug in the property setter for the Text property. The P/Invoke declaration for NOTIFYICONDATA inside Windows Forms uses the 128 char limit. You can hack around it with Reflection: using System; using System.Windows.Forms; using System.Reflection; public class Fixes { public static void

Can I re-gain a systray icon of a running app that has gone missing?

送分小仙女□ 提交于 2019-12-02 21:25:58
Since I've finally got an answer for this question: Can you send a signal to windows explorer to make it refresh the systray icons , that asks about getting rid of dead systray icons, I would like to ask for the opposite. Is there a way to "nudge" an application to re-show it's systray icon if it has been lost? It happens to my Apache Monitor ever since I install Avira AV. Ok, granted, it could only be a side effect, but it's quite annoying to have the running app killed an then restart it, just because it's not displaying the systray icon correctly. Thanks in advance, Gus I've written a

C#, how to call a form object from a tray based application

给你一囗甜甜゛ 提交于 2019-12-02 13:58:58
I am trying to load a form class from a program running as a tray icon that originally used FileList frmFileList = new FileList(); Now instead of a filelist I want to use a custom form but I get the error: Error 1 'System.Windows.Forms.Control.ControlCollection' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'System.Windows.Forms.Control.ControlCollection' could be found (are you missing a using directive or an assembly reference?) Any ideas? It sounds like you forgot using System.Linq; at the top of your source file. But since you