User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 455,992 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,796 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 2817 | Replies: 10
Reply
Join Date: Jun 2006
Location: Blumenau, Brazil
Posts: 71
Reputation: Micheus is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
Micheus's Avatar
Micheus Micheus is offline Offline
Junior Poster in Training

Re: Changing system Time Format

  #11  
Dec 22nd, 2007
Originally Posted by fayyaz View Post
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.

  1. procedure SetTimeFormat(ftType24 :Boolean)
  2. var
  3. Changed :Boolean;
  4. LCID :LongInt;
  5. begin
  6. LCID := GetSystemDefaultLCID;
  7. if ftType24 then // if format type is 24 hours...
  8. Changed := SetLocaleInfo(LCID, LOCALE_STIMEFORMAT, 'HH:mm:ss')
  9. else // if format type is 12 hours AM/PM
  10. Changed := SetLocaleInfo(LCID, LOCALE_STIMEFORMAT, 'hh:mm:ss');
  11.  
  12. if Changed then // if no error then notify all app that settings changed
  13. SendMessage(HWND_TOPMOST, WM_SETTINGCHANGE, 0, 0);
  14. end;

This procedure work right to me.
No access to register and no computer restart are necessary.

Bye
"It always has, at least, two ways to make one same thing. Exactly that they are certain and wrong"(Micheus)

Brazil - Blumenau
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Pascal and Delphi Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 9:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC