CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    177

    Change Windows Regional Date Format

    I has the following code :

    Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\International", "sShortDate", "dd/MM/yyyy")


    When I click the control panel regional date properties, the date format was changed. But the desktop date at the bottom right was not changed. How can I make it change as well?

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Change Windows Regional Date Format

    Registry gets read ONCE when you log in or boot. It tells you to re-start most of the time, if you have credentials
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Change Windows Regional Date Format

    It is not usually a good idea to do these sort of changes in the registry, there are many possible issues that might arise from it; but, sometimes there is a need.

    You have to remember, as David rightly pointed out, the Registry gets loaded by Windows once, any changes to that might not get loaded immediately. A System change such as what you have, will only take effect after a reboot of the PC.

    You might be able to send a broadcast message, to inform Windows that a registry value has changed. Have you heared of the following APIs :

    BroadcastSystemMessage
    PostMessage
    SendMessage


    You could use any of those, as long as you send the WM_SETINGCHANGE constant.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured