View Issue Details

IDProjectCategoryView StatusLast Update
0004912JEDI VCL00 JVCL Componentspublic2009-09-24 16:47
ReportergebyAssigned Toobones 
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.39 
Summary0004912: bad handling of WM_WINDOWPOSCHANGED on runtime designer surface
DescriptionI am using Delphi 7 pro. Problem have some mysterious symptoms:

- When I try to move component on the surface at Vista and Win7, component is not repainted properly in some cases. Especially when I try to move TPageControl with some TTabSheets.

- Designer sometimes crashed when I changing properties (like TabStops in PageControl), or sometimes when I click some control at surface. When I load a design from file and some components have Visible:=false, then click the designer crash too. It crashing with exception EOSError: "A call to an OS function failed"
Additional InformationI found a problem with handling of WM_WINDOWPOSCHANGED in TJvDesignSurface.IsDesignMessage.

For some unknown reason handling of this message causing sending of this message again. But it cause endless message loop in some cases!

I try to do a dirty hack - I remove the line:
SendMessage(Control.Handle, AMsg.Msg, AMsg.wParam, AMsg.lParam);

And wow! All seems to be OK now! Component repaint is OK, no crashes too...
TagsNo tags attached.



2009-09-09 19:37

administrator   ~0016068


We would really like to have the zipped sources of a sample application showing this.

2009-09-10 13:10 (623,584 bytes)


2009-09-10 13:19

reporter   ~0016085

I attached the sample aplication.

Steps for reproduce:

1) Run the application and load test2.gfm. Try to click the Label with caption "Enter your keyword...". Crash...

2) Or run the application. Swicth to "Additional" tab on the component pallete and place TPageControl into designer. Right-click on the PageControl and create two new pages by popup menu. Then go to ObjectInspector and find property "TabStop" and change his value.

3) you maybe find many other ways, application is unstable, until I remove SednMessage, as I said before.

Crashes are different on various systems. On WinXP, Vista or Win7 - each one crashing differently. However I test way 1 and 2 on the WinXP and Vista now, and this sample application crashing on both systems here.



2009-09-22 16:40

administrator   ~0016141

I'm sorry, but I'm not seeing this at all.
Could it be that you are using themes?


2009-09-22 18:40

reporter   ~0016148

Did you try compiled sample inside my ZIP? I see the problem on my home WinXP (classis view), work WinXP (classic too...), on my Notebook with Vista (Vista aero), and users reporting problem on Windows 7 too.


2009-09-23 08:40

administrator   ~0016155

Yes, I did use the sample inside your zip and I did not see the problem at all.

2009-09-23 11:00 (229,748 bytes)


2009-09-23 11:04

reporter   ~0016161

It is mysterious, because I really not found computer without crash. :-O

I attach small AVI video, where you can see this my crash. Once I clicked the label, application crash inside kernel. This is my on my WinXP computer.


2009-09-23 20:23

reporter   ~0016175

SVN Revision : 12520.

Delphi 7 Personal (Build 8.1).

Windows 2000 SP4.


I can confirm this bug.

If you compile and run JvDesigner-example at folder "examples\JvDesigner" inside IDE and add button to JvDesignPanel area and then try to move it around, it will give EStackOverflow exception dialog.

Execution of program stops inside JvDesignSurface.pas (revision 12515) at line 895. If I try to continue execution, I will get another execption but this time it is "access violation at 0x77e413ba: write of address 0x00030c64" and I need to reset program.

Running JvDesigner-example outside of IDE does not give any error messages. Program just suddenly disappears.

If I comment out "SendMessage(Control.Handle, AMsg.Msg, AMsg.wParam, AMsg.lParam);" at line 892 inside JvDesignSurface.pas and recompile JvDesigner-example and run it, there is no exceptions any more.


2009-09-24 10:12

administrator   ~0016181

Then this must be related to Delphi7 because I don't see it with any version including and above BDS2006.


2009-09-24 10:25

reporter   ~0016182

Of course. Code is:

  SendMessage(Control.Handle, AMsg.Msg, AMsg.wParam, AMsg.lParam);

And problem is with SendMessage, as I reported on the begin. So, Delphi versions with UpdateBounds method have not a problem.


2009-09-24 12:20

administrator   ~0016185

oh, my bad, I did not notice that IFDEF...
I'll investigate


2009-09-24 12:26

administrator   ~0016186

Thing is, there is a need to emulate UpdateBounds because of issue 4693 as indicated in the source code.
So I'm wondering what would be the equivalent to UpdateBounds and because I don't have Delphi 7 at hand I cannot test right now. Could you try to replace the SendMessage call with this call:


If that works, then please let me know.


2009-09-24 15:58

reporter   ~0016188

You mean AMsg instead of just Msg, I think.


I made a quick test and no crashes here now.

Thank you!


2009-09-24 16:47

administrator   ~0016189

Yes, it was AMsg. Thanks for the confirmation, the fix is now in SVN

Issue History

Date Modified Username Field Change
2009-09-01 09:15 geby New Issue
2009-09-09 19:37 obones Note Added: 0016068
2009-09-09 19:37 obones Status new => feedback
2009-09-10 13:10 geby File Added:
2009-09-10 13:19 geby Note Added: 0016085
2009-09-22 16:40 obones Note Added: 0016141
2009-09-22 18:40 geby Note Added: 0016148
2009-09-23 08:40 obones Note Added: 0016155
2009-09-23 11:00 geby File Added:
2009-09-23 11:04 geby Note Added: 0016161
2009-09-23 20:23 Cyrus Note Added: 0016175
2009-09-24 10:12 obones Note Added: 0016181
2009-09-24 10:25 geby Note Added: 0016182
2009-09-24 12:20 obones Note Added: 0016185
2009-09-24 12:26 obones Note Added: 0016186
2009-09-24 15:58 geby Note Added: 0016188
2009-09-24 16:47 obones Note Added: 0016189
2009-09-24 16:47 obones Status feedback => resolved
2009-09-24 16:47 obones Fixed in Version => Daily / SVN
2009-09-24 16:47 obones Resolution open => fixed
2009-09-24 16:47 obones Assigned To => obones