I need api II

how to get a system time into application - directly - that application, used by windows
pistacerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

simonetCommented:
There are 2 options:

function timeGetTime : DWORD;

Retrieves the system time, in milliseconds. The system time is the time elapsed since Windows was started. It uses the system's multimedia clock.


function GetTickCount : DWORD ;

The GetTickCount function retrieves the number of milliseconds that have elapsed since Windows was started.

Now, if all you want, is the current date/time, simple use the function "now", from ObjectPascal.

Yours,

Alex
0
pistacerAuthor Commented:
sorry, I mean by this, i need any api, that puts the system's multimedia clock into my form, something of this style ...
0
MadshiCommented:
Do you mean the little clock in the taskbar? Why not doing it yourself?

For which purpose do you need this stuff?

Regards, Madshi.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

simonetCommented:
I agree with Madshi here.

What's the point in having that clock in your application?
0
philipleighsCommented:
Maybe you want to have a time picker control (TMaskEdit?) in your app, with an analogue clock displaying the selected time next to the mask edit?
Seems reasonable to me.
Try searching the DSP for a clock component.

If you just want to put the time in a label or something (Maybe D1/Win 3.x?) then drop a TTimer on your form, set interval to 1000. In OnTimer event put Label1.Caption := TimeToStr(Time);

Cheers,
Phil.
0
intheCommented:
maybe this help:

WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0'), SW_SHOWNORMAL);


displays Set Date & Time properties tab


or

WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1'), SW_SHOWNORMAL);

displays the Time Zone properties tab...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pistacerAuthor Commented:
ok, maybe you are all right. inthe, your tip is good, how to send you points without end this diskusion by accepting your answer? (I am some low of points, it'll be later :-))

What about this: are windows sending to all windows any millisecond any message, that could i interpret as a time message?
0
pistacerAuthor Commented:
I should add here too, that my boss is hating Ttimer ... :-(
0
philipleighsCommented:
Hates TTimer? Why? That's the most rediculas thing I've heard!

A timer has a low impact on the system. WM_TIMER messages are the lowest priority messages (ie. WM_TIMER messages are always positioned at the end of the message queue. If another message comes along, it overtakes the WM_TIMER message. So effectively you only get WM_TIMER messages when the message queue is empty).

>>What about this: are windows sending to all windows any millisecond any message, that could i interpret as a time message?<<
Yes, the answer is a WM_TIMER message!

If your boss hates timers because he thinks it will impact the performance of your program, then he doesn't understand timers.
 
0
intheCommented:
why does he hate timers?
there is no problem using timers thats what they're there for ...

maybe if you use about 50 you might get some side effects but no ones gonna need 50..

is my other comment what you needed for the question?


0
pistacerAuthor Commented:
no, no, no it is going wrong.

to explain, my problem is this:
i am about hide windows shell and simulate it by my own form (madshi, that is for appbar14.zip). Now is the point, how to get the applications from systemtray onto it. I thought, I'll represent it by icons and call them later, in the style, wich has inthe mentioned. But by the watches would be the icon permanently changed, and that means to create my own hours ...

i mean, after all is better this strategy:

go trough systemtray and identify the applications. than place it on my form in the same style, they are placed in the system tray.

(do not ask, why i am doing so crazy thing, it is my job ... :-))
0
pistacerAuthor Commented:
Adjusted points to 60
0
MadshiCommented:
Is there no other way to do your job? E.g. hooking the taskbar? Why do you need to REPLACE it??
What is the final aim? What shall your taskbar do different to the standard taskbar?
0
pistacerAuthor Commented:
madshi, what do you mean under hook taskbar? tell me more about your idea, please!
0
MadshiCommented:
Well, the taskbar consists of several windows. When you write a little dll, you can subclass all those windows (by using SetWindowLong(wnd, GWL_WNDPROC, ...)). The effect would be that all messages go to your window hook procedure instead of to the original window procedure.
You still haven't told us what your taskbar shall do different, what the real aim is. So I can't tell you if hooking is the right way...
0
pistacerAuthor Commented:
well, it'll not be exact copy of taskbar.

By us in firma, is any db, where is wroten, wich application you can run, wich is runned automatically, wich may run only in one instance and so on.

when you as a user comes at morning to work, goes this taskbar no.2 in action, hides before you all original windows - all icons, whole taskbar ... it will leave an empty desktop ...  and stores on its own form buttons for each application, for wich you have userrights to run plus selected contents of system tray. when you press them, they will be started or set active if they are yet running.

so i need to steal in any form the aplications of systemtray in taskbar and put them on my taskbar2.

(As terrible, as it could be ... :-))
0
MadshiCommented:
My suggestion:

Don't write your own taskbar. That's much much too difficult (copying the trayIcons is almost impossible).
Better use the original taskbar and restrict Windows so that the user can only do that things he MAY do.
Go and find "poledit.exe". It should be somewhere on your Windows CDs, I guess. With this program you can tell Windows, which programs may be started and which not.
Then you should look at your harddisk in "c:\windows\startmenu". There you should delete all those links that are not allowed for the current user.
If you use poledit correctly only the trayIcons should be visible, that are allowed to the user.
You will need to restart the explorer for every different user, I guess.
0
pistacerAuthor Commented:
inpossible, that was the first thing, i have suggested to the boss ... :-(

0
pistacerAuthor Commented:
ok, i send the points to inthe. the answer with winexec aint that, what i would, but it is at nearest to that.
0
MoondancerCommented:
Finalized today by Moondancer - EE Moderator.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.