Weired GDI+ and/or Layered Window Behaviour - Please Help!

From: Atif (anonymous_at_discussions.microsoft.com)
Date: 03/10/04


Date: Tue, 9 Mar 2004 21:26:07 -0800

Hi,
   I am using GDI+ on Layered Window, I create a compatible DC from which I create the GDI+ Graphics object and I use that Graphics object for drawing on the DC and in the end I call updatelayeredwindow(). Everything works fine till now, the window is drawn fine and I am not worried about slow drawing on the window since i won't be animating anything. The real problem is that when I DON'T have to redraw AND I JUST HAVE TO move the layered window on the screen, I call updatelayered window() providing only the the new x-y position then sometimes it works really fine & fast and at other times it beats the hell of out my system (very slow, almost full CPU usage), for just moving the window. I am not sure which part is causing the problem, the layered window or GDI+.
Futher, During past 3 weeks of trying to understand the cause of this error and hence remove it, I have noticed a strange thing - All times I have been successfully able to generate this slow window move behaviour by doing the following.
i) Starting the Windows Media Player 9 Series and play a song w/ visualizations (bars).
ii) Start 2-3 instances of MSDN Library 2003
iii) Open few browser windows & browse them to any location
iv) Now when I start the program, It sucks!

However, If I don't do any of these and just start my program it works fine (fast) 90% of the time but no gurantee that it would always! I know about GDI & GDI+ interoperatiblity issues so before issuing the move command ( I issue a about 200 along x-axis in a for loop with 5 milli-second Sleep() call in each iteration) I always call Graphics->GetHDC & after moving I call Graphics->ReleaseHDC(hdc).

Some Info:
I have tried using MoveWindow API
I am not handling any of the WM_PAINT or WM_ERSEBKGRND messages
I am using Transparency in LayeredWindow - a little
I am using GDI+ on W2K system with GDI+ installed. I have Gdiplus.dll copied to my program's directory and I have also rebased the Gdiplus.dll
I have tried above mentioned behaviour regeneration test - BRT ;) - on Windows XP system and same thing happens.

Please guys F1 (Help)!

Thanks & Best Regards,
Atif Goheer



Relevant Pages

  • [SLE] [OT] Re: FYI: OpenSUSE vs Vista
    ... Windows Vista has implemented 0% .NET in the core. ... SIDs to a NTFS filesystem, which _can_ happen on a non-DC file server. ... It's trying to chuck the Graphical Display Interface (GDI) ...
    (SuSE)
  • Re: which way is faster?
    ... I never heard of speed comparisons between dos and windows. ... GDI does not support hardware. ... I provided a demonstration here earlier, where a GDI app, can prempt both the mouse and keyboard messages, and keep going. ...
    (alt.lang.asm)
  • Weired GDI+ and/or Layered Window Behaviour - Please Help!
    ... Futher, During past 3 weeks of trying to understand the cause of this error and hence remove it, I have noticed a strange thing - All times I have been successfully able to generate this slow window move behaviour by doing the following. ... Starting the Windows Media Player 9 Series and play a song w/ visualizations. ... I am using GDI+ on W2K system with GDI+ installed. ... I have tried above mentioned behaviour regeneration test - BRT;) - on Windows XP system and same thing happens. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Using Graphics.World when drawing
    ... Conversions to and from pixels are unneccesary. ... See the GDI+ FAQ and Windows Forms Tips and Tricks for some ideas. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Office 2003 "needs to close"
    ... But I should reply to the point on GDI. ... I now also have trouble printing pictures from Windows Photo & Fax viewer. ... Download Platform SDK Redistributable: GDI+ ... Under General Tab clear your History, ...
    (microsoft.public.windowsxp.general)