Mega Search
23.2 Million


Sign Up

Make a donation  
Maximized MDI childs on Vista fails to realign controls visu  
News Group: borland.public.delphi.nativeapi.win32

I have this strange problem with Windows Vista and wonder if anyone else 
have seen it.

When MDI childs are maximized inside the MDI parent, controls (Comboboxes 
etc) on the child form fails to render correctly when resizing the MDI 
parent. But reading out the positions etc in the OnResize event shows 
correct new resized values, but visually the control hasent changed and the 
UI looks crap.
If I restore the MDI child to non-maximized state, controls realign 
correctly again.

In other words, when resizing the main form (the MDI parent), controls in 
MDI child forms fail to render correctly on Vista but same code works just 
fine on XP.
When resizing the child form directly when it's in a non-maximized state the 
controls also render correctly.

Trying to invalidate or repaint the controls doesnt help..

Really really strange.. Think it's a Vista bug.

Anyone seen this?

/Magnus 



Vote for best question.
Score: 0  # Vote:  0
Date Posted: 9-Jan-2008, at 7:34 PM EST
From: Magnus Flysjö
 
Re: Maximized MDI childs on Vista fails to realign controls  
News Group: borland.public.delphi.nativeapi.win32
Hi Magnus,

On this specific form, only SpTBX popup menus.  Elsewhere in the 
application, we use TBX and SpTBX controls (mostly toolbars, docks, and 
tabs.)

I saw your other post about using alClient on Vista64, and this repaint 
issue is happening on panels I've laid out using alignment.  (Most other 
controls don't use alignment in our app, it's all using hardcoded 
positions.)  Currently I'm running Vista64, but, unfortunately, this does 
also seem to be happening on XP-32.

Cheers,

David



"Magnus Flysjö"  wrote in message 
news:47860f14@newsgroups.borland.com...
> David, can you tell me which Toolbar2000/TBX components you are using on 
> your form?
> Do you also only get this problem on Windows Vista?
>
> /Magnus
> 


Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 11-Jan-2008, at 2:13 PM EST
From: David M
 
Re: Maximized MDI childs on Vista fails to realign controls  
News Group: borland.public.delphi.nativeapi.win32
Ok, here is what I found out..
The problem is the Toolbar2000 hook that is setup if you use the toolbar 
components.

The problem is only visible on 64-bit versions of Windows (XP, Vista and 
Win2003) due to the fact that 64-bit Windows for some stupid reason only 
allow 19 recursive calls with SendMessage before the stack gets overflowed. 
32-bit versions allow up to 40 recursive calls.

40 / 2 = 20, maybe the reason for only 19 recursive calls has something to 
do with reuse of old 32-bit code and the fact that 64-bit needs the double 
size somewhere in the code.

So far there is no fix for this problem, Jordan Russel however suggest that 
we skip the usage of Align=alClient for our componenets and realign controls 
manualy in the OnResize event instead, since this doesnt create recursive 
SendMessage calls.

Here is a link with more information
http://news.jrsoftware.org/news/toolbar2000/msg07779.html

/Magnus 



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 11-Jan-2008, at 12:57 AM EST
From: Magnus Flysjö
 
Re: Maximized MDI childs on Vista fails to realign controls  
News Group: borland.public.delphi.nativeapi.win32
David, can you tell me which Toolbar2000/TBX components you are using on 
your form?
Do you also only get this problem on Windows Vista?

/Magnus 



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 10-Jan-2008, at 1:26 PM EST
From: Magnus Flysjö
 
Re: Maximized MDI childs on Vista fails to realign controls  
News Group: borland.public.delphi.nativeapi.win32
I've just today noticed a similar problem when I resize parent controls, 
such as panels, on a modal dialog in Vista.  I need to explicitly Invalidate 
each control that's a child of the resized controls otherwise they don't 
paint at all, and I see little bits of them in their old, pre-resized-parent 
positions.

Why? ... No idea, it should work :)

However, though these specific controls are all standard VCL ones, I do also 
have TBX and TB2K controls in the application and on this form.  So if you 
find out if they're causing your problem I'd be quite interested to know 
how!

Cheers,

David


"Magnus Flysjö"  wrote in message 
news:47854bc3@newsgroups.borland.com...
>
>>
>> Which version of Delphi are you using?
>>
>
> Delphi 2007...
>
> I am currently trying to pin this down.
> The applications I have this problem with were all created in Delphi7 once 
> and depends heavily on Toolbar2000/TBX components.
>
> I just created a new project with standard VCL components in Delphi2007 
> and did not get the same problem.
>
> Now I have to understand which component it is that cause this and how to 
> fix it, anyone got any idea what it might be?
> Since it works on Windows XP and not on Vista, and only when an MDI child 
> window is in it's maximized state.
> When the MDI child is maximized, it is the parent form that gets the size 
> messages from Windows, otherwise it's the MDI child form. But why does 
> standard components like the TComboBox fail to render corretly while other 
> components like the TPanel and TLabels still work and realign correct. I 
> have also noticed that the theme drawing fails on TEdit components. The 
> borders get corrupted and looks like classic Windows 9x/2000 edit boxes 
> when resized, theme painting only comes back if the control gets activated 
> by a mouse click (calling Edit1.Invalidate doesnt help). This is also only 
> on Vista.
>
> 


Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 10-Jan-2008, at 1:47 PM EST
From: David M
 
Re: Maximized MDI childs on Vista fails to realign controls  
News Group: borland.public.delphi.nativeapi.win32
>
> Which version of Delphi are you using?
>

Delphi 2007...

I am currently trying to pin this down.
The applications I have this problem with were all created in Delphi7 once 
and depends heavily on Toolbar2000/TBX components.

I just created a new project with standard VCL components in Delphi2007 and 
did not get the same problem.

Now I have to understand which component it is that cause this and how to 
fix it, anyone got any idea what it might be?
Since it works on Windows XP and not on Vista, and only when an MDI child 
window is in it's maximized state.
When the MDI child is maximized, it is the parent form that gets the size 
messages from Windows, otherwise it's the MDI child form. But why does 
standard components like the TComboBox fail to render corretly while other 
components like the TPanel and TLabels still work and realign correct. I 
have also noticed that the theme drawing fails on TEdit components. The 
borders get corrupted and looks like classic Windows 9x/2000 edit boxes when 
resized, theme painting only comes back if the control gets activated by a 
mouse click (calling Edit1.Invalidate doesnt help). This is also only on 
Vista.



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Jan-2008, at 11:33 PM EST
From: Magnus Flysjö
 
Re: Maximized MDI childs on Vista fails to realign controls  
News Group: borland.public.delphi.nativeapi.win32
"Magnus Flysjö"  wrote in message 
news:4785139a@newsgroups.borland.com...

> I have this strange problem with Windows Vista and wonder if
> anyone else have seen it.

Which version of Delphi are you using?


Gambit



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Jan-2008, at 10:45 AM EST
From: Remy Lebeau \(TeamB\)