Article View: borland.public.cppbuilder.nativeapi
Article #1494Re: Vista & DrawAnimatedRects
From: Kris
Date: Tue, 14 Aug 2007 11:09
Date: Tue, 14 Aug 2007 11:09
57 lines
3847 bytes
3847 bytes
JD wrote: > The cbSize member should be initialized depending on the > Shell32.dll version (which I did not know!) so I don't > think that it's a compiler issue. Besides, using V2_SIZE > reduces functionality so I don't think that that's right > even if it does work. I've done some more checking and it appears Builder is simply returning the wrong value for the structure size. I've printed out all possible sizes for this structure: NOTIFYICONDATA_V1_SIZE=88 NOTIFYICONDATA_V2_SIZE=488 NOTIFYICONDATA_V3_SIZE=504 sizeof(NOTIFYICONDATA)=508 ; as reported by Builder 2007 Either a cbSize of 488 or 504 works great on XP (i.e. the balloons appear and send out NIN_BALLOONUSERCLICK messages). However, the sizeof(NOTIFYICONDATA) builder 2007 reports is wrong and results in balloons not working anymore on XP (they still do on Vista, however). But you're right, the cbSize should be set depending on the Shell version (but using sizeof() when Shell >=5.0 like MSDN recommends results in problems on Builder 2007 due to the incorrect size). > Without Vista, I'm of little help here. The best that I can do > is suggest that you test the tray icon component that comes > with the new compiler (it was completely rewritten for BDS). Actually, the Tray component in Builder 2007 appears to be the same one as in BDS 2006. This means still no support for NIN_BALLOONUSERCLICK messages. Additionally, the traycomponent has no hide/show methods for minimizing/restoring to/from the system tray. So, there's no animation code present anyway. Also, the included trayicon demo sample does not do any animations (it doesn't even use the VCL TrayComponent for that matter). But in builder 2007 Hide() and Show() work great for letting the application disappear (i.e. hide taskbar button and hide form). This is due to the absence of a hidden main window when you use the new Builder 2007 option called "SetApplicationMainFormOnTaskBar(Application, true)". So, the only thing left for me to do was to draw a nice animation when minimizing to the system tray. Which went fine until I encountered Vista. >> I forgot to add that I found an alternative by clicking 'I'm >> feeling luck' <g> >> http://www.codeproject.com/gdi/drawanimated.asp I downloaded these demo projects and ran the included EXEs on a Vista system. While they run great on XP, they don't run that great on Vista: - Demo 1 : wireframe option is unchecked ; no animation appears - Demo 1 : wireframe option checked ; slow animation + sometimes a rectangle is left behind - Demo 2 : animation is there but much much slower than on XP. Clearly there are some issues with drawing such animations on Vista. Thanks for the feedback anyway, Kris
Technical Details
Message-ID:
<46c18d8a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46bc4487$1@newsgroups.borland.com> <46bcee7b$1@newsgroups.borland.com> <46bdfba4$1@newsgroups.borland.com> <46c0958e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fb86ab6d2f5d603a X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 14 Aug 2007 13:09:02 +0200 From: Kris <x@x.com> User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Vista & DrawAnimatedRects References: <46bc4487$1@newsgroups.borland.com> <46bcee7b$1@newsgroups.borland.com> <46bdfba4$1@newsgroups.borland.com> <46c0958e$1@newsgroups.borland.com> In-Reply-To: <46c0958e$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.242.6.168 Message-ID: <46c18d8a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1187089802 81.242.6.168 (14 Aug 2007 04:10:02 -0700) Lines: 61 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail