How to add a growl notification to a program

Source: Internet
Author: User

Growl for Windows-Mac style information tip tool. Currently, supported software includes Outlook, Visual Studio, and a tool that uses command lines to send messages locally or remotely.

. Growl is a very useful notification framework that helps you easily create a variety of very cool Event Notification effects. This tutorial teaches you how to add a growl notification to your application. It is easy to add a growl notification to the program. Download growl for windows in http://www.growlforwindows.com/gfw/about.aspx, and there is a. Net Library under the program directory after installation:

  • Growl. corelibrary. dll
  • Growl. connector. dll

Reference these two sets in the program and register the growlconnector instance in the program. You must provide information about your application during registration.

Application application = new application ("your_app_name ");

Application. Icon = @ "C: \ image.png ";

Growlconnector growl = new growlconnector ();

Growl. icationicationcallback + = new growlconnector. callbackeventhandler (growl_notifcallcallback );

// Set this so messages are sent in plain text (easier for debugging)
Growl. encryptionalgorithm = cryptography. Fig. plaintext;

Application = new growl. connector. Application (this. textbox1.text );

Growl. Register (application, new notificationtype [] {notificationtype });

 

Then, use the following code to send a notification:

Callbackcontext = new callbackcontext ("some fake information", "fake data ");

Notification = new notification (this. application. Name, this. icationicationtype. Name, datetime. Now. ticks. tostring (), this. textbox2.text, this. textbox3.text );
Growl. Sort y (notification, callbackcontext );

You can read the SDK documentation to get more functional explanations, but the basic idea is as follows.

The above code is from http://code.google.com/p/growl-for-windows/. you can download it for test.

 

The following figure shows the running result of the example:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.