Win forms Notify Icon

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
=?Utf- said:
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?
 
Hi,
The following is the code snippet.

notifyIcon1.Icon=Icon.FromHandle(((Bitmap)imageList1.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
 
Back
Top