|
|
|
date: Sun, 6 Apr 2008 10:57:00 -0700,
group: microsoft.public.win32.programmer.gdi
back
LoadCursor with ani resources
Hi,
I have some problems with the Win32 LoadCursor() function when loading an
animated cursor resource.
If I load an ani cursor several times in a row (eg. 100 times) with
LoadCursor(hInstance,"AniResource"), where the AniResource is linked into the
exe file as a anicursor resource, the function gives erratic windows
behaviour. Sometimes window background is not redrawn, at other times some
random background is frozen in the windows. It's not only the application
which loads the anicursor that is affected, but somtimes windows in other
apps are affected too. I've seen the problem on Vista x64, Win 2003 and Win
XP x86.
The Win32 documentation states that I don't need to free a cursor resource
after loading, so after the initial LoadCursor, Win32 is supposed to return
the same handle over and over again. If I use a static cursor rersource
(.cur), there are no problems at all.
Any ideas?
date: Sun, 6 Apr 2008 10:57:00 -0700
author: donald
Re: LoadCursor with ani resources
>I have some problems with the Win32 LoadCursor() function when loading an
>animated cursor resource.
>
>If I load an ani cursor several times in a row (eg. 100 times) with
>LoadCursor(hInstance,"AniResource"), where the AniResource is linked into the
>exe file as a anicursor resource, the function gives erratic windows
>behaviour. Sometimes window background is not redrawn, at other times some
>random background is frozen in the windows. It's not only the application
>which loads the anicursor that is affected, but somtimes windows in other
>apps are affected too. I've seen the problem on Vista x64, Win 2003 and Win
>XP x86.
>
>The Win32 documentation states that I don't need to free a cursor resource
>after loading, so after the initial LoadCursor, Win32 is supposed to return
>the same handle over and over again. If I use a static cursor rersource
>(.cur), there are no problems at all.
The symptoms you describe sound like leaked resources, so what happens
if you use DestroyCursor - does it succeed or not, an does it resolve
your issue?
Have you tried using LoadImage rather than LoadCursor?
Dave
date: Sun, 06 Apr 2008 21:10:21 +0100
author: David Lowndes lid
|
|