Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. NotifyIcon problem

NotifyIcon problem

Scheduled Pinned Locked Moved C#
databasehelpquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tiziacaia
    wrote on last edited by
    #1

    Hallo, I make a windows service that check new entry in a database table, if there are new entries the service show a notify icon in the system tray. all works fine but when the system tray show my icon, some applications crashes and stop to work (e.g: cics) Any suggest for me? Thanks a lot. (I hope you understand me, me english is not so good.)

    R 1 Reply Last reply
    0
    • T tiziacaia

      Hallo, I make a windows service that check new entry in a database table, if there are new entries the service show a notify icon in the system tray. all works fine but when the system tray show my icon, some applications crashes and stop to work (e.g: cics) Any suggest for me? Thanks a lot. (I hope you understand me, me english is not so good.)

      R Offline
      R Offline
      russellsoft
      wrote on last edited by
      #2

      I can't sqy why while you don't show me your code... :)

      T 1 Reply Last reply
      0
      • R russellsoft

        I can't sqy why while you don't show me your code... :)

        T Offline
        T Offline
        tiziacaia
        wrote on last edited by
        #3

        I'm sorry! This is the code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.Text; using System.Drawing; using System.Data.SqlClient; using System.Windows.Forms; namespace Warning { public partial class Warning: ServiceBase { private System.Timers.Timer m_tTimer; private SqlConnection sqlConn; private SqlCommand sqlCmd; private SqlDataReader sqlReader; private string strSql; public Waning() { InitializeComponent(); } protected override void OnStart(string[] args) { m_tTimer.Enabled = true; m_oNotifyIcon.Visible = false; } protected override void OnStop() { m_tTimer.Enabled = false; } protected override void OnContinue() { } private int GetNewRequestes() { int newRequestes=0; //System.Diagnostics.Debugger.Break(); sqlConn = new SqlConnection("DATABASE=DBNAME;SERVER=DBSERVER;user id=user;password=xxx;"); strSql = "SELECT COUNT(*) FROM DBTable WHERE StatusID=5"; try { sqlConn.Open(); sqlCmd = new SqlCommand(strSql, sqlConn); sqlReader = sqlCmd.ExecuteReader(); sqlReader.Read(); newRequestes = sqlReader.GetInt32(0); sqlReader.Close(); } catch (Exception err) { string msg = err.Message; } finally { sqlConn.Close(); } return newRequestes; } private void m_tTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { int newRequestes = 0; //System.Diagnostics.Debugger.Break(); newRequestes = GetNewRequestes(); if (newRequestes>0) { m_oNotifyIcon.Visible = true; m_oNotifyIcon.ShowBalloonTip(60, "There are "+newRequestes.ToString()+" new requestes!", " ", ToolTipIcon.Warning); } else { m_oNotifyIcon.Visible = false; } } } } Any idea? Thanka a lot!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups