c# - Why does SetOverlayIcon throw an 'Invalid cursor handle' COMException occasionally? -


itemprop = "text">

In my C # Winforms application, I am using to set the ITaskbarList3 :: SetOverlayIcon status overlays On the taskbar button of the interface app (under Windows 7). All this has been shown and seems to be working properly for me, being removed correctly, with the mouse.

From a form load event, call one of my actions

  SetOverlayIcon (creates parentForm.Handle, IntPtr.Zero, String.Empty)   
  system.time (prefix) where the parent is thrown for the load event (which is a parent format form) which throws occasionally (on other people's machines). .interop services. COMException (0x8007057A): Invalid cursor handle on myNamespace.TaskbarNotify.ITaskbarList3.SetOverlayIcon (IntPtr hwnd, IntPtr HICON, String pszDescription)  

A thousand or so users out of a user base (different Key: (Exception from the 0x8007057A HRESULT) Windows version is said to be around 100 times more than two months.

I know that IntPtr.Zero is a valid cursor handle, but that zero is valid for passing hIcon to the value of Windows me Is there any suggestions as telling?

I am using .NET 2 if it makes a difference.

Here I am using ITaskbarList3 for my application:

  [ComImport, InterfaceType (ComInterfaceType.InterfaceIsIUnknown), Guid ("EA1AFB91-9E28-4B86 -90E9-9E9F8A5EEFAF ")] Public Interface ITaskbarList3 {Zero HrInit (); Zero AddTab (IntPtr hwnd); Zero DeleteTab (IntPtr hwnd); Zero active beta (IntPtr hwnd); Zero SetActivateAlt (IntPtr hwnd); Zero MarkflashcreenWindows (Intact HWd, Bull F Fullscreen); Zero Set Progress Value (Input HWND, Ulnge All Completed, Ulhone Oltatel); Zero setprographicstate (intact hybrid, TBPFALG TBPflags); Blank register tab (interrupt handout tab, interrupt HVDMDI); Zero unrestricted (IntPtr hwndTab); Zero SetTabOrder (IntPtr hwndTab, int hwndInsertBefore); Zero SetTabActive (IntPtr hwndTab, int hwndMDI, TBATFLG tbatFlags); Zero ThumbberAdBotons (Intupetted HWD, UIT Kabutanus, Thumbbutan [] Pibton); Invalid thumbart update buttons (entpTR hvind, uit kebatonas, thumbbutan [] pBTon); Zero ThumbBarSetImageList (IntPtr hwnd, IntPtr himl); Zero Set Overlay Echo (INTPTR HWND, Interpetrix Iiacon, [Marshall AS (Unmanaged Type. LPWRR)] String PSZscript; Zero set tabnaltlipipip (interrupt beat, [Marshall AS (unmanaged type. LPWRR)] string pszTip; Zero SetThumbnailClip (IntPtr hwnd, NativeMethods.RECT ​​prcClip); }  

You should use, which handles all this for you.


Comments