I think you should be resetting the form's Top, Left, Height, and
Width instead of as you are with the Bottom and Right. This always worked
for me in Windows 95, 98, 2000 and XP. Make sure too that the alignment of
your TListView is set to alClient. Just setting your anchors is NOT the
same! If you can't align to alClient because of needing space between it
and it's parent's borders, use panels or spacers in between so that you can.
Also, I've experienced a lot of registry problems with Win2000. For
example, even with Microsoft's own products when uninstalled, registry
entries were not always cleaned up as they should be. So I stopped using
the Registry except for those things that were absolutely necessary. For
everything else I went back to inifiles and the only difference I noticed
was an increase in speed! <g>
from: Robert Meek at: [EMAIL PROTECTED]
dba "Tangentals Design" home of "PoBoy"
freeware Windows apps and utilities
located at: www.TangentalsDesign.com
Proud to be a moderator for the
"Delphi Programming Lists" at: elists.org
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Ross Levis
Sent: Saturday, October 15, 2005 8:54 PM
To: Delphi Discussion List
Subject: Win2k window problems
I have a problem which only occurs on Windows 2000 workstations. XP and
Win9x work fine.
I'm storing the window sizes and positions of several windows when
closing my app. I'm using similar code to the following when my program
loads:
with WindowPlacement do //(TWindowPlacement)
begin
Length := Sizeof(WindowPlacement);
rcNormalPosition.Top := Reg.ReadInteger('Top');
rcNormalPosition.Left := Reg.ReadInteger('Left');
rcNormalPosition.Bottom := Reg.ReadInteger('Bottom');
rcNormalPosition.Right := Reg.ReadInteger('Right');
showCmd := SW_HIDE;
SetWindowPlacement(MyForm.Handle, @WindowPlacement);
MyForm.WindowState := TWindowState(Reg.ReadInteger('State'));
end;
In one example, a form has a ListView which is anchored at Top, Left,
Bottom, and Right. On Win2k (and only Win2k), the listview does not
resize when the window is resized. It stays the same size so you end up
with blank space to the right and bottom when the form is made bigger or
maximized. It's as if the 4 Anchors are set to False. This only occurs
after the above code is run.
The reason for using SetWindowPlacement is so the restored size of the
windows are stored and loaded regardless of whether the form is
maximized or not. The user can then Restore to the original form size.
I don't have Win2k here so it's my users who have reported this problem
and I can't test any changes here to resolve it.
Any ideas?
Thanks,
Ross.
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi