When application need to be independeng from OS localization and show
date and time in desired format (Short/Long Date/Time Format group in
TForm onCreate event), there is a bug when application is running with
windows (added in registry Run section).
While Windows is starting, application is correctly activated and date and
time is shown correctly (as is designed). In the moment when windows complete
starting procedure, application show date and time in the format defined in
Regional Settings.
This is a bug I which I handled inside timer event (activity duration is at
least 30 second until windows should to finish starting process), as follows:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if not (ShortDateFormat='dd.mm.yyyy') or
not (ShortTimeFormat='hh:nn:ss') or
not (LongDateFormat='dd.mm.yyyy') or
not (LongTimeFormat='hh:nn:ss') then
begin
ShortDateFormat:='dd.mm.yyyy';
ShortTimeFormat:='hh:nn:ss';
LongDateFormat:='dd.mm.yyyy';
LongTimeFormat:='hh:nn:ss';
DateSeparator := '.';
// etc..
end;
end;
However, I'm interested for other, much more suitable solution to handle
described bug.
Thanks in advance.
Sasa
--
www.szutils.net