•
•
•
•
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,993 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,798 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
![]() |
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
•
•
Join Date: Sep 2007
Posts: 69
Reputation:
Rep Power: 2
Solved Threads: 7
•
•
•
•
Dear Duas
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.
•
•
Join Date: Sep 2007
Posts: 69
Reputation:
Rep Power: 2
Solved Threads: 7
•
•
•
•
Thankyou very much "ExplainThat "
whold you please send me a simple Example code for using registry Object?
Thankyou
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 try OpenKey(...); //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.
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
I've never done it, but I think you just need to tell the tray to repaint itself.
You should be able to do it with something like the following:
Let us know if that doesn't work.
You should be able to do it with something like the following:
Delphi Syntax (Toggle Plain Text)
var shelltraywnd, traynotifywnd, clockwnd: HWND; begin shelltraywnd := FindWindowEx( 0, 0, 'shell_traywnd', nil ); traynotifywnd := FindWindowEx( shelltraywnd, 0, 'traynotifywnd', nil ); clockwnd := FindWindowEx( traynotifywnd, 0, 'trayclockwclass', nil ); SendMessage( clockwnd, WM_PAINT, 0, 0 ) end;
•
•
Join Date: Sep 2007
Posts: 69
Reputation:
Rep Power: 2
Solved Threads: 7
•
•
•
•
I've never done it, but I think you just need to tell the tray to repaint itself.
You should be able to do it with something like the following:
Let us know if that doesn't work.Delphi Syntax (Toggle Plain Text)
var shelltraywnd, traynotifywnd, clockwnd: HWND; begin shelltraywnd := FindWindowEx( 0, 0, 'shell_traywnd', nil ); traynotifywnd := FindWindowEx( shelltraywnd, 0, 'traynotifywnd', nil ); clockwnd := FindWindowEx( traynotifywnd, 0, 'trayclockwclass', nil ); SendMessage( clockwnd, WM_PAINT, 0, 0 ) end;
I am almost certain that works. In case it does not, here is a trick I remember using
- Change the registry strings
- Use the Windows GetLocalTime function to fetch the current time in a SystemTime structure.
- Sleep(1)
- Call Windows SetLocalTime using the SystemTime data obtained above.
I remember doing this but not with WindowsXP. Seem to recall that I did a Sleep(1) to ensure that Windows recognized that the time was in fact different.
This is nothing short of a cheap hack. Try the tray repaint technique first.
Last edited by ExplainThat : Dec 21st, 2007 at 3:24 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Pascal and Delphi Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- memory management in wndows 2000 (Windows NT / 2000 / XP / 2003)
- Open In New Window Php (PHP)
- Changing Time format (Pascal and Delphi)
- Sony ICD-R100 recorder in windows XP (Windows NT / 2000 / XP / 2003)
- Formatting HD (Windows NT / 2000 / XP / 2003)
- Can't format hard drive! (Troubleshooting Dead Machines)
- Changing permission for www/html directory (Window and Desktop Managers)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Adding Listbox Items
- Next Thread: bar image reset problem



Linear Mode