Problem developing GUI in lister plugin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
kajoj1
Member
Member
Posts: 122
Joined: 2005-08-08, 10:24 UTC
Contact:

Problem developing GUI in lister plugin

Post by *kajoj1 »

I'm programming VisualDirSize plugin and I have bug that I cannot fix. :(

Here is my problem :
1. Run VisualDirSize
2. Open the config dialog for VisualDirSize
3. Put focus on any other window
4. Return to Total Commander - the dialog is gone and it's impossible to get to it

The solution is to kill TC or use Alt+Esc to cycle through open applications - sometimes
missing dialog is displayed.

I'm using standard method to generate modal window. This code compiled in Delphi 7 or 2005
generates that bug mentioned above. If someone could help me with it...

Code: Select all

procedure TMyForm.ToolButton17Click(Sender: TObject);
var
  Form2: TForm2;
begin
   Form2 := TForm2.Create(Application);
    try
      Form2.ShowModal 
    finally
      Form2.Release;
    end;
end;
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

I don't know Delphi very well, but this could be related to ModalPopupMode ( see http://blogs.borland.com/abauer )
#5767 Personal license
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

That is a known Delphi bug, TOAD has it too :-(
Maybe from the TOAD forum can get help:
http://groups.yahoo.com/group/toad/
I switched to Linux, bye and thanks for all the fish!
kajoj1
Member
Member
Posts: 122
Joined: 2005-08-08, 10:24 UTC
Contact:

Post by *kajoj1 »

It seems to be fixed. I used Application.Handle property.

procedure TMyForm.ToolButton17Click(Sender: TObject);
var
Form2: TForm2;
begin
Application.Handle := ParentWin; // Taken from function ListLoad(ParentWin:thandle;FileToLoad:pchar;ShowFlags:integer):thandle;
Form2 := TForm2.Create(Application);
try
Form2.ShowModal
finally
Form2.Release;
Application.Handle := 0; //I noticed that it have to be 0 if not I get system error, code:1400, Invalid window handle
end;
end;

But frankly speaking I don't know if it always works... It must be tested...
rolandd
Senior Member
Senior Member
Posts: 313
Joined: 2003-06-26, 09:02 UTC
Location: Indonesia
Contact:

Post by *rolandd »

2kajoj1

Will be glad to test ;)
Registered user #92105
Post Reply