6

I have a application developed in Delphi 6, it works very good on Windows XP. Most of the controls are custom drawn to show gradients. Recently, I have deployed the application on Windows 7, after which all the windows are shown very slow. I have compared the same with the XP system.

Do i need to handle anything extra for running on Windows 7? With lot of pain, i have compiled the same application in Delphi XE, but still the application behavior is same. The windows were all opening very slow.

I have enabled the run time themes, disabled the custom drawing, but it did not have any impact.

Please help.

yati sagade
  • 1,355
  • 9
  • 24
Rahul W
  • 833
  • 11
  • 26
  • is it that your are encountering the UAC permission for any action you do on win 7? can you give more details in terms of actions that your app is performing – PresleyDias Dec 27 '11 at 09:18
  • Which components are used by your application? Database access, web-services, network, DirectX? Your question is too much generalized I guess – Andrew Dec 27 '11 at 09:19
  • Give us code that demonstrates the problem – David Heffernan Dec 27 '11 at 09:25
  • I haven't encountered the UAC permission as I am logged in as the Administrator. Moreover, my application does not access the registry. The only configuration that it accesses is the ini file and some data files using File stream objects. The application has different forms which are auto created when the application loads up. In the FormShow I am calling a generic routine to set the colors to all the controls contained in the form. – Rahul W Dec 27 '11 at 09:38
  • The components that were used are basically derived from TPanel. In the paint event, we were just painting the surface using the FillGradientRect API call. There are no coloring problems, but the only backdrop is the application responsiveness when opening the forms. The other components were delphi native like the TEdit, TBitBtn, etc..There is no database access, but network access is the main...but still, it's just used to login to the system, after which the user can open the forms... – Rahul W Dec 27 '11 at 09:42
  • @DavidHeffernan I am not able to format the code here, but the basic idea is in the FormShow, I am looping through all the controls and setting the colors, but this will be done only once per session. The next time when the form shows, it will not apply the colors. – Rahul W Dec 27 '11 at 09:48
  • work out how to format the code then. Read the instructions. – David Heffernan Dec 27 '11 at 10:28
  • @RahulW Try to disable the network authentication for a while and check the performance. – Andrew Dec 27 '11 at 12:08
  • @Andrew will try and let u know...thanks.. – Rahul W Dec 27 '11 at 13:04
  • While testing the application, i have observed one strange thing. While the application is running, i have reduced the screen resolution. The performance of the user interface has increased, after which i have again restored the screen resolution, it was working fine as expected. I don't understand what it has to do with changing the screen resolution. If i close the application and start again, then the problem comes, all the windows will be very slow in terms of opening, again reduce the screen resolution and increase, it works fine... – Rahul W Dec 27 '11 at 13:34
  • @RahulW Maybe your applciation rendering some big gradients using GDI? – Andrew Dec 27 '11 at 13:49
  • @RahulW I see you wrote about FillGradientRect above. Try to disable all the gradients temporarily and test the application. – Andrew Dec 27 '11 at 14:07
  • @Andrew I have commented the code to draw the gradient, but no luck, the panels were showing normal. I have repeated the above mentioned steps by changing the resolution and it is fast... May be temporary workaround is to change the resolution from code when i start up the application and restore the resolution again before showing any of the forms, just like some games does... – Rahul W Dec 27 '11 at 14:46
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/6160/discussion-between-andrew-and-rahul-w) – Andrew Dec 27 '11 at 15:05

2 Answers2

3

You should try to use a profiler with XP and with Seven and so you will see where the code is slowing.

Community
  • 1
  • 1
philnext
  • 3,242
  • 5
  • 39
  • 62
1

There have been significant changes in GDI with the introduction of Vista: http://msdn.microsoft.com/en-us/library/windows/desktop/ff729480(v=vs.85).aspx.