system-tray

How to prevent leaving an Icon in System Tray on exit?

我的梦境 提交于 2019-12-03 16:12:21
问题 My program puts an icon in the system tray because the user may minimize to it. However, if the application crashes, or I stop the app from running in VS it leaves the icon in it until I hover over it with the mouse. Sometimes I'll look down there and there will be 10 or so icons. I can I make sure the icon goes away? 回答1: There is no way to do this. Windows does not poll your program to see if it's still alive. Therefore, your icon will stay in the system tray until you either tell it to

Right Click on Tray Icon in Windows 10 with AutoHotKey

馋奶兔 提交于 2019-12-03 15:49:01
In Windows 7, I had an AutoHotKey script that would automatically Right-Click on a tray icon. #Include %A_Scriptdir%\TrayIcon.ahk TrayIcon_Button("CCC.exe", "R") Which used the TrayIcon.ahk library from FanaticGuru's post . This worked just fine on Windows 7, but no longer works on Windows 10. Is there a way to right click on a TrayIcon in an AutoHotKey script on Windows 10? Here is the TrayIcon_Button function from the library. I refrained from posting the entire library since it is fairly long. ; ------------------------------------------------------------------------------------------------

Determining location of tray icon

ε祈祈猫儿з 提交于 2019-12-03 13:30:53
My application is designed to sit in the system tray and behave similarly to the Network/Volume/Power/Action Centre tray items in Windows 7 (and the equivalent items in Windows Vista). That is, it becomes visible when the tray icon is clicked, and becomes hidden when focus is lost. The application is written in WPF, but I am currently using NotifyIcon from WinForms for the tray icon. I would like to know if anyone has any suggestions as to how I might determine the position (i.e. screen coordinates) of my application's tray icon. The default Windows Vista/7 tray items have some way of doing

Maximize application in system tray?

你说的曾经没有我的故事 提交于 2019-12-03 13:17:00
I wrote a little WPF app that when 'closed' minimizes to the system tray (customer requirement). Double clicking pops it back up, or right click gives a context menu to exit. But if the app is minimized, and the users navigate to Start->All Programs->The Application it starts a new instance. What (in C#) do I need to do to get the app to maximize the running instance if the user does this rather than fire up a new instance? Thanks! Conrad Frix This answer from Jon Skeet discusses using a mutex to do it Mutex is the way to go. It's a lot less fragile than using process names etc. However, you

How to display text in system tray icon with win32 API?

允我心安 提交于 2019-12-03 12:53:24
问题 Trying to create a small monitor application that displays current internet usage as percentage in system tray in C using win32 API. Also wanting to use colour background or colour text based on how much is used relative to days left in month. EDIT: To clarify I am wanting the system tray icon to be dynamic. As the percentage changes I update the system tray icon. Looking for solution that uses just plain old win32 (ie. No MFC or WTL). 回答1: Okay here is my win32 solution: HICON

Hide or not to hide the system tray in a Windows Phone 7 application?

大城市里の小女人 提交于 2019-12-03 12:49:55
I am debating whether to hide or not to hide the system tray in a Windows Phone 7 application. I've not found any general suggestions on this issue -the official Windows Phone design guidelines don't address this issue at all - except for Jeff Wilcox's blog post who suggested that he personally likes to see the system tray in applications. I'd like some general advice on this issue from other Windows Phone developers. Some reasons for showing the system tray are Doesn't take up that much space Users may want to see it at times Reasons for hiding it are You can't control its background: unless

how to put an .net application in system tray when minimized?

♀尐吖头ヾ 提交于 2019-12-03 07:38:12
问题 can anyone please suggest a good code example of vb.net/c# code to put the application in system tray when minized. 回答1: Add a NotifyIcon control to your form, then use the following code: private void frm_main_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { this.ShowInTaskbar = false; this.Hide(); notifyIcon1.Visible = true; } } private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.Show(); this.WindowState =

How to prevent leaving an Icon in System Tray on exit?

拟墨画扇 提交于 2019-12-03 05:32:39
My program puts an icon in the system tray because the user may minimize to it. However, if the application crashes, or I stop the app from running in VS it leaves the icon in it until I hover over it with the mouse. Sometimes I'll look down there and there will be 10 or so icons. I can I make sure the icon goes away? There is no way to do this. Windows does not poll your program to see if it's still alive. Therefore, your icon will stay in the system tray until you either tell it to leave (normal exit), or the user does something that initiates a call to your program (such as mouseover). Only

Developing a simple Windows system tray desktop app to consume a .NET web service

心已入冬 提交于 2019-12-03 04:46:19
问题 I'm required to develop a simple Windows system tray desktop app to consume a .NET web service but I'm proficient in PHP, and I have little background in desktop applications. What platform would you advise me to use, preferably with a very low learning curve? The system tray app will show (in a context menu) a counter of notifications of new events as received from the .NET web service; and will also write all the event logs into a text file. I'm already thinking Adobe AIR or C# .NET but I

How to display text in system tray icon with win32 API?

一个人想着一个人 提交于 2019-12-03 03:23:45
Trying to create a small monitor application that displays current internet usage as percentage in system tray in C using win32 API. Also wanting to use colour background or colour text based on how much is used relative to days left in month. EDIT: To clarify I am wanting the system tray icon to be dynamic. As the percentage changes I update the system tray icon. Looking for solution that uses just plain old win32 (ie. No MFC or WTL). Okay here is my win32 solution: HICON CreateSmallIcon( HWND hWnd ) { static TCHAR *szText = TEXT ( "100" ); HDC hdc, hdcMem; HBITMAP hBitmap = NULL; HBITMAP