Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us