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: