notifyicon

C# Actively detect Lock keys

眉间皱痕 提交于 2019-12-02 08:25:26
问题 I have a wireless keyboard and mouse that doesn't have any lock indicators, nor any software bundled to provide a visual aid, so I'm making my own. I got it so that if I click on a notifyIcon it'll list which lock(s) are turned on, but I'd like to make it smarter by alerting me once the locks are engaged. I found a few items online, but honestly I just want the lock keys, I don't care about any other keyboard presses. I'm using C# .NET 4, though I can use .NET 4.5 if there's something with

C# Actively detect Lock keys

你离开我真会死。 提交于 2019-12-02 06:28:03
I have a wireless keyboard and mouse that doesn't have any lock indicators, nor any software bundled to provide a visual aid, so I'm making my own. I got it so that if I click on a notifyIcon it'll list which lock(s) are turned on, but I'd like to make it smarter by alerting me once the locks are engaged. I found a few items online, but honestly I just want the lock keys, I don't care about any other keyboard presses. I'm using C# .NET 4, though I can use .NET 4.5 if there's something with that version. Thanks. You will want to register some sort of keyboard hook to listen for the key presses

ShowBalloonTip Not Working

让人想犯罪 __ 提交于 2019-12-01 16:43:06
On Windows 10, the ShowBalloonTip method of NotifyIcon NEVER shows the balloon tip. This would appear to have something to do with Windows itself. If I go to Settings > System > Notifications & actions > and find my running app ( vshost32.exe in debug mode) and click on it, then turn on Show notifications in the action center , I can clearly see the balloon tip messages being added to the notifications, but never a balloon tip. I assume this is a problem with Windows 10. My NotifyIcon is VISIBLE my_icon.ShowBalloonTip("Title", "Message", BalloonIcon.Info); Found the problem - was simple: Quiet

ShowBalloonTip Not Working

妖精的绣舞 提交于 2019-12-01 16:00:48
问题 On Windows 10, the ShowBalloonTip method of NotifyIcon NEVER shows the balloon tip. This would appear to have something to do with Windows itself. If I go to Settings > System > Notifications & actions > and find my running app ( vshost32.exe in debug mode) and click on it, then turn on Show notifications in the action center , I can clearly see the balloon tip messages being added to the notifications, but never a balloon tip. I assume this is a problem with Windows 10. My NotifyIcon is

Toggle form visibility on NotifyIcon click and hide it on click elsewhere

血红的双手。 提交于 2019-12-01 10:03:44
问题 I have an application which is in system tray. I want to make it visible when the user clicks on the notifyIcon , if it's not visible already. If it is already visible it should be hidden. Also when the user clicks anywhere else except on the form the form should hide (if it's visible). My code looks like this: protected override void OnDeactivated(EventArgs e) { showForm(false); } public void showForm(bool show) { if(show) { Show(); Activate(); WindowState = FormWindowState.Normal; } else {

Notify Icon stays in System Tray on Application Close

夙愿已清 提交于 2019-12-01 05:24:57
I have an application which runs only from the System Tray, it's only purpose is to provide the user with information via Ballon Tips. It's running well, apart from one minor annoyance. When the application is closed using the Task Manager (as opposed to using the context menu) the icon sticks around in the system tray, until you hover over it, then when another instance is opened you get a second icon sitting beside the first. My Form Closed event looks like this, it does nothing: private void frmMain_FormClosed(object sender, FormClosedEventArgs e) { ntfyIcon.Visible = false; ntfyIcon.Icon =

Notify Icon stays in System Tray on Application Close

那年仲夏 提交于 2019-12-01 03:26:07
问题 I have an application which runs only from the System Tray, it's only purpose is to provide the user with information via Ballon Tips. It's running well, apart from one minor annoyance. When the application is closed using the Task Manager (as opposed to using the context menu) the icon sticks around in the system tray, until you hover over it, then when another instance is opened you get a second icon sitting beside the first. My Form Closed event looks like this, it does nothing: private

NotifyIcon not showing

不问归期 提交于 2019-11-30 16:18:58
I am writing a simple application that I would like to control with a notifyIcon rather than a form, I have follwed examples I found through Google, but my notifyIcon will not show up. What am I doing wrong? static class MainEntryClass { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); C2F TestApp = new C2F(); Application.Run(); TestApp.Dispose(); } } class C2F { public C2F() { InitializeComponent(); loadSettings(); } private void InitializeComponent() { this.components

Minimize to tray make form unvisible

谁都会走 提交于 2019-11-29 15:04:04
I am using NotifyIcon to make my form minimize to tray to work at background. However below code doesn't show app icon at all. Form goes totally invisible. I have to kill that from task manager. private void Button1_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized; if (FormWindowState.Minimized == this.WindowState) { Hide(); this.ShowInTaskbar = false; notifyIcon1.Visible = true; } } What could be the reason? I want to see my app-icon to re-open the form. You need to assign an Icon to NotifyIcon to show it in system tray. Also you need to set Visible to true .

Issue with NotifyIcon not disappearing on Winforms App

别来无恙 提交于 2019-11-29 03:53:41
I've got a .Net 3.5 C# Winforms app. It's got no GUI as such, just a NotifyIcon with a ContextMenu. I've tried to set the NotifyIcon to visible=false and dispose of it in the Application_Exit event, as follows: if (notifyIcon != null) { notifyIcon.Visible = false; notifyIcon.Dispose(); } The app gets to the code inside the brackets, but throws a null ref exception when it tries to set Visible = false. I've read in a few places to put it in the form closing event, but that code never gets hit (maybe as I don't have a form showing as such?). Where can I put this code so it actually works? If I