Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

C / C++ Forum


You are currently viewing our C / C++ Forum as a guest. Please register to participate.
Login



Closed Thread
Notifyicon to open a link after clicking on the icon [C]
Old 01-24-2011, 08:16 AM Notifyicon to open a link after clicking on the icon [C]
Skilled Talker

Posts: 97
Trades: 0
hi everyone.. i made my windows service in C# and everything is running well except only one task..

i made a notifyicon1 in the taskbar so that the user can click on this notifycon1 and opens a links that it is retrieved from

database.

for example i am trying to open the link of google when the user clicks on the notifyicon1.



My problem is that the action of double click for the notify icon is not working neither for mouse move or double click action

my code is:
Code:
                             this.notifyIcon1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.john_move);
                          this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
Note: i made 2 function one for the event double click and the other for mouse move coz i made first double click function

but it did not works for me.


Code:
       private void notifyIcon1_DoubleClick(object Sender, EventArgs e)
        {
            try
            {
                File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "notifyIcon1_DoubleClick " + 

DateTime.Now.ToString());

                //System.Diagnostics.Process.Start("http://www.google.com");

            }
            catch (Exception ex)
            {
                File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "catch 1 "+DateTime.Now.ToString() + 

ex.ToString());
            }   
        }

        private void john_move(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            try
            {
                File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "John move " + DateTime.Now.ToString());

                System.Diagnostics.Process.Start("http://www.google.com");

            }
            catch (Exception ex)
            {
                File.WriteAllText(@"c:\\windows_service_files\\STErrors.txt", "catch 2 " + DateTime.Now.ToString() + 

ex.ToString());
            }   
        }
Please reply as soon as possible..

thanks and best regards for everyone
john_zakaria is offline
View Public Profile
 
 
Register now for full access!
Old 01-24-2011, 12:21 PM Re: Notifyicon to open a link after clicking on the icon
King Spam Talker

Posts: 1,091
Name: Paul W
Trades: 0
Look at the paths of the files you're using - they're all on your local PC!
__________________
Great music:
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
PaulW is offline
View Public Profile
 
Closed Thread     « Reply to Notifyicon to open a link after clicking on the icon [C]
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23037 seconds with 11 queries