systray app - help

  • Thread starter Thread starter Arvi
  • Start date Start date
A

Arvi

Hello,

Im quite new to c# windows application.

i need to write a application which stays on the systray and listens to the
SQL Table. (when the value is inserted as 0 - done thru Dataset and check it
every2 seconds?) i need to open another application thru command prompt and
pass the parametes of the DB and alert the user.

how this can be done?

any links? sample app?

anyhelp in this regard is much appreciated.

Thanks.
 
Im not sure how close c# is to vb but you can make a
windows form with an opacity of 0 on it, and have a notify icon on it,
drop a timer on the form and let the timer execute some code every ( so many
seconds you need ).

At this point ur basically dealing with a form that the user cant see so
really u can do anything.

In the timer you can just open a prog once ur result is true.

?

Miro
 
Hi Miro,

No Form necessary. Here's an example without the Timer:

static void Main()
{
// create and initialize icon component
NotifyIcon icon = new NotifyIcon();
icon.Text = "My Tray Icon";
icon.Icon = System.Drawing.SystemIcons.Application;

// create context menu
icon.ContextMenuStrip = new ContextMenuStrip();
icon.ContextMenuStrip.Items.Add("&Exit");
icon.ContextMenuStrip.Items[0].Click +=
// Handle the click event for the Exit item.
// An anonymous method is used to handle the event in order to shorten this example
(EventHandler) delegate(object sender, EventArgs e) { Application.Exit(); };

// show icon
icon.Visible = true;

// start message loop (this line of code blocks until the application stops)
Application.Run();
}
 
Back
Top