Thankyou for Your Answer.
about your question I mast Say No I want to changing format of OS time by sume Delphi instructions
One way would be to change the Windows Registry settings directly. The entries you are looking for are the sLongDate, sShortDate and sTimeFormat strings under HKEY_CURRENT_USER\Control Panel\International. You can use the Delphi TRegistry object to manipulate these entries.
Thankyou very much "ExplainThat "
whold you please send me a simple Example code for using registry Object?
End of my working day here so a detailed example will have to wait for tomorrow. If you really want to have a go at it right away just take a look at the TRegistry object methods in Delphi help. Your code would go something like this
with TRegistry.Create(Self) do
//modify key contents here
finally Free end;
Quoting from memory so there might be errors. TRegistry is not hard to play with so you might find that the examples in Delphi Help sufficient. Do post a message saying if you have managed on your own so I don't end up spending time telling what you already know.
I write Same code And I can Change Registry
But I mast restart computer after runing code for making effect on time Format
is any way that dont need to restart system
I'm have answered this question for You last July. Doesn't You remember? (post)
It was a procedure called SetTimeFormat with a litle compiler error (it's true): the parameter was bad named.
But, you don't reply or report me this mistake, and I don't have perceived: I had put tfType24 but must be ftType24.
procedure SetTimeFormat(ftType24 :Boolean)
LCID := GetSystemDefaultLCID;
if ftType24 then // if format type is 24 hours...
Changed := SetLocaleInfo(LCID, LOCALE_STIMEFORMAT, 'HH:mm:ss')
else // if format type is 12 hours AM/PM
Changed := SetLocaleInfo(LCID, LOCALE_STIMEFORMAT, 'hh:mm:ss');
if Changed then // if no error then notify all app that settings changed
SendMessage(HWND_TOPMOST, WM_SETTINGCHANGE, 0, 0);
This procedure work right to me.
No access to register and no computer restart are necessary.