By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,276 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,276 IT Pros & Developers. It's quick & easy.

Win forms Notify Icon

P: n/a
Hi,
I have a windows form application it uses AxShDocVw AxWebBrowser control.
The control navigates to web pages at a specified interval set in Timer
control. The form uses a notify icon. On axWebBrowser_DocumentComplete event
I call a function which calls GetHiCon()(Icons handle). This function works
fine for upto to about 2 hrs then the application throws Interop (Generic
GDI+ exception). Any idea why this happens. Please excuse me if your not able
to understand this I can can give you more details.

Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <14**********************************@microsoft.co m>, =?Utf-
8?B?UmF2aSBTaGFua2Fy?= <Ravi Sh*****@discussions.microsoft.com> says...
Hi,
I have a windows form application it uses AxShDocVw AxWebBrowser control.
The control navigates to web pages at a specified interval set in Timer
control. The form uses a notify icon. On axWebBrowser_DocumentComplete event
I call a function which calls GetHiCon()(Icons handle). This function works
fine for upto to about 2 hrs then the application throws Interop (Generic
GDI+ exception). Any idea why this happens. Please excuse me if your not able
to understand this I can can give you more details.


What are you doing with the handler? When you're done with it, are you
release the handler back to GDI by using the DestroyIcon API?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 17 '05 #2

P: n/a
Hi,
The following is the code snippet.

notifyIcon1.Icon=Icon.FromHandle(((Bitmap)imageLis t1.Images[0]).GetHicon());

notifyIcon1=> Icon used in the form.
Icon => Form.Icon
Imagelist contains 2 images.

This line is executed once evrey 20 mins. It works fine for first few
minutes(i.e 1 or 2 hrs).
Also, let me know how to free the handle so that GDI wont throw an
exception.Please let me know if you need more detials.
Thanks,
Ravi

"Patrick Steele [MVP]" wrote:
In article <14**********************************@microsoft.co m>, =?Utf-
8?B?UmF2aSBTaGFua2Fy?= <Ravi Sh*****@discussions.microsoft.com> says...
Hi,
I have a windows form application it uses AxShDocVw AxWebBrowser control.
The control navigates to web pages at a specified interval set in Timer
control. The form uses a notify icon. On axWebBrowser_DocumentComplete event
I call a function which calls GetHiCon()(Icons handle). This function works
fine for upto to about 2 hrs then the application throws Interop (Generic
GDI+ exception). Any idea why this happens. Please excuse me if your not able
to understand this I can can give you more details.


What are you doing with the handler? When you're done with it, are you
release the handler back to GDI by using the DestroyIcon API?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 17 '05 #3

P: n/a
In article <97**********************************@microsoft.co m>, =?Utf-
8?B?UmF2aSBTaGFua2Fy?= <Ravi Sh*****@discussions.microsoft.com> says...
Also, let me know how to free the handle so that GDI wont throw an
exception.Please let me know if you need more detials.


Look up "DestroyIcon" on http://www.pinvoke.net/

It will have the proper signature for the function.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.