View Issue Details

IDProjectCategoryView StatusLast Update
0005981JEDI VCL00 JVCL Componentspublic2012-09-11 17:07
ReportermooreAssigned To 
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0005981: AboutJVCL property form blocks IDE
DescriptionJust create a new project, put any JCVL control, and click to see its AboutJVCL property, the IDE is not accesible and there is need to kill bds.exe process and restart.

Delphi version is XE2 update4..
TagsNo tags attached.

Activities

Arioch

2012-09-07 11:49

developer   ~0020161

confirm

2012-09-07 11:59

 

jvcl_about_dis.png (64,459 bytes)
jvcl_about_dis.png (64,459 bytes)

Arioch

2012-09-07 12:08

developer   ~0020162

there were plugins for WinCmd to enable/disable windows...
http://wincmd.ru/plugring/tiptop.html
http://wincmd.ru/plugring/procfs.html

I used ProcFS to scan BDS.exe
The window focused on screenshot was disabled.
After i re-enabled it, the IDE was normal.
Until i launched the About box again

Microsoft Spy++ also shows WS_DISABLEd style, but does not allow to undo it

Arioch

2012-09-07 12:18

developer   ~0020163

The control flows like that:

Design Editor calls JvclAboutComponent.Execute();
JvCommonDialog.Execute() tries few smart tricks to get one

  if ParentWnd = 0 then
    ParentWnd := GetForegroundWindow;
  if ParentWnd = 0 then
    ParentWnd := GetDesktopWindow;
  Result := Execute(ParentWnd);

Dunno if it succeed the quest or not.

This calls function TJvJVCLAboutComponent.Execute(ParentWnd: HWND)

And that calls class function TJvJVCLAboutForm.Execute(ParentWnd; false):

Which creates and shows the window.
   with Self.Create(Application) do
    ParentWindow := ParentWnd;
    Result := ShowModal = mrOk;

2012-09-07 12:26

 

jvcl5981exe.rar (1,873,812 bytes)

2012-09-07 12:26

 

JVCL-0005981-src.ZIP (1,091 bytes)

Arioch

2012-09-07 12:45

developer   ~0020164

Last edited: 2012-09-07 14:14

That looks a bug in stock VCL - now the question is how to workaround it.
I propose form's OnShow event.

http://qc.embarcadero.com/wc/qcmain.aspx?d=108580

Arioch

2012-09-07 14:07

developer   ~0020166

Last edited: 2012-09-07 14:09

Fix 0000001: Open TJvJVCLAboutForm and set BorderStyle = bsDialog;
Either in DFM or in class function TJvJVCLAboutForm.Execute.
That probably was intended mode, lost somewhen.


Fix #2: in procedure TJvJVCLAboutForm.FormShow(Sender: TObject);
add variable:

procedure TJvJVCLAboutForm.FormShow(Sender: TObject);
{$IFDEF MSWINDOWS}
var
  VersionInfo: TOSVersionInfoEx;
{$IFDEF DelphiXE2_up}
   H: HWND; // see below, re-enable windows
{$EndIf}
{$ENDIF MSWINDOWS}
begin
...

and a loop at the end of procedure:

...

  {$IFDEF DelphiXE2_up}
// http://issuetracker.delphi-jedi.org/view.php?id=5981
// http://qc.embarcadero.com/wc/qcmain.aspx?d=108580
   h := Self.Handle;
   repeat
     EnableWindow(h, true);
     h := GetParent(h);
   until (h = 0);
  {$ENDIF}
end;

Also would be nice to add "Position := poOwnerFormCenter" into class function TJvJVCLAboutForm.Execute

Arioch

2012-09-07 14:28

developer   ~0020167

PS: Andy, would you revive VCLFix project ? :-)

AHUser

2012-09-07 19:07

developer   ~0020169

Didn't EMBT applied all VCLFixPack fixes into the RTL/VCL? I thought they did except for some not so safe fixes.

Arioch

2012-09-07 19:22

developer   ~0020170

They probably did not considered this particular usecase

I feel they can close that QC108580 "as designed" intending everyone to switch to FMX and drop VCL.
At best case, they'd fix it in XE3, but probably we'd skip that version.

Arioch

2012-09-07 19:23

developer   ~0020171

moore - would you test the fix and confrim it's working ?

AHUser

2012-09-08 00:45

developer   ~0020172

For me this is not a bug. If the form's Parent property is set, the form becomes embedded because it gets the WS_CHILD flag. Your solution with fsDialog only works because the WS_CHILD flag is in conflict with WS_POPUP that is set by fsDialog.

What the developer should have done instead is to set the form's PopupParent. Parent und PopupParent are treated differently. The first adds WS_CHILD whereas the later doesn't.

Arioch

2012-09-08 01:01

developer   ~0020173

Last edited: 2012-09-08 01:02

Looks like you're mixing issues. Actually i cannot understand which bug you refer to.

JVCL has a bug - it does freeze IDE. The fact that it was not discovered earlier i attibute to the property being almost never used.
How to fix it - if your proposal is D7 compatible - you have SVN access and all.

VCL i believe also has a bug. Ubiquitous call should not cause total DoS. Twice so when ti is no documented.
BTW, TCommonDialog.Execute does neither use Parent nor PopupParent, it uses ParentHWND. Is there D7-compatible PopupParentHWND ?
Frankly, i don't remember such properties in D5, but never used D7 so who knows...

AHUser

2012-09-08 12:22

developer   ~0020174

I referred to the VCL bug (VCLFixPack).

PopupParent was introduced in Delphi 2006.

I have now removed the "ParentWindow := ParentWnd" and use the CreateParams.WndParent for that, so that the About dialog will be always above the ParentWnd. That means no WS_CHILD flag for the dialog what it should have been all the time.

moore

2012-09-11 16:21

reporter   ~0020175

Problem solved in daily svn JVCL3-2012-09-11.7z

Thnx for a wonderful work and an excellent suite, I just can't live without JVCL :)

Issue History

Date Modified Username Field Change
2012-09-05 13:12 moore New Issue
2012-09-07 11:49 Arioch Note Added: 0020161
2012-09-07 11:59 Arioch File Added: jvcl_about_dis.png
2012-09-07 12:08 Arioch Note Added: 0020162
2012-09-07 12:18 Arioch Note Added: 0020163
2012-09-07 12:26 Arioch File Added: jvcl5981exe.rar
2012-09-07 12:26 Arioch File Added: JVCL-0005981-src.ZIP
2012-09-07 12:45 Arioch Note Added: 0020164
2012-09-07 14:07 Arioch Note Added: 0020166
2012-09-07 14:09 Arioch Note Edited: 0020166
2012-09-07 14:14 Arioch Note Edited: 0020164
2012-09-07 14:26 Arioch Status new => confirmed
2012-09-07 14:28 Arioch Note Added: 0020167
2012-09-07 19:07 AHUser Note Added: 0020169
2012-09-07 19:22 Arioch Note Added: 0020170
2012-09-07 19:23 Arioch Note Added: 0020171
2012-09-08 00:45 AHUser Note Added: 0020172
2012-09-08 01:01 Arioch Note Added: 0020173
2012-09-08 01:02 Arioch Note Edited: 0020173
2012-09-08 12:22 AHUser Note Added: 0020174
2012-09-11 16:21 moore Note Added: 0020175
2012-09-11 17:07 Arioch Status confirmed => closed
2012-09-11 17:07 Arioch Resolution open => fixed