Was wondering has anyone use or know how to use the gettickcount api
Trying to display it in a msg box.
Posted on 2003-03-24 10:23:36 by Tweak
Invoke GetTickCount

That's it, the system up-time in milliseconds (limited by the system timer res.) is placed in EAX. You can convert it to a string using dw2a.

Posted on 2003-03-24 10:27:02 by donkey
From the Win32 Programmer's Reference:
Return Values

If the function succeeds, the return value is the number of milliseconds that have elapsed since Windows was started.
If you want to use the function as a timer for a given interval,
1) you call the function at the start of the interval to read the "time" such as if you were looking at your watch, and keep that returned value in memory;
2) you call the function once more at the end of the interval and subtract the start time from the returned value to get the elapsed time of the interval.

You can then do whatever you need with that value which is in milli-seconds.

I find that timer quite sufficient for animations.

Posted on 2003-03-24 10:36:35 by Raymond
thx Donkey but what is dw2a. this is how I it work for me

invoke GetTickCount
invoke wsprintf, addr buftime,addr szformat,eax
invoke MessageBox,0,addr buftime,addr mytitle,MB_OK
invoke ExitProcess,0
end start

does dw2a convert it to a more readable format
Posted on 2003-03-24 11:01:25 by Tweak
dw2a is a library function in the MASM32 library. It works like this :

invoke dw2a,eax,ADDR buftime

It will convert a DWORD value to an ascii string and place it in the buffer you specify. It is a little faster than wsprintf in my opinion and needs no format strings. There are many useful functions in the masm32 library, you will find them documented in the \Masm32\Help\MASMLIB.HLP help file. You must include the following lines to use the library functions:

include \masm32\include\masm32.inc
includelib \masm32\lib\masm32.lib
Posted on 2003-03-24 13:17:59 by donkey
Well donkey U were right it works dw2a. Guess I better read the masm32 lib hlp file

Sorry I haven't coded anything useful yet! Hopefully some I will
Posted on 2003-03-31 03:04:12 by Tweak