I just stard using MASM32 and have beem experimenting. One of the things that I will want to do is to have my process sleep for some time and then continue.

I used this simple program from NOPerators tutorial to experiment:

.model flat, stdcall
option casemap :none

include \MASM32\INCLUDE\windows.inc
include \MASM32\INCLUDE\masm32.inc
include \MASM32\INCLUDE\gdi32.inc
include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc

includelib \MASM32\LIB\masm32.lib
includelib \MASM32\LIB\gdi32.lib
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib

ourmessage db "This is a message!",0
ourtitle db "This is the title of our message box!",0

invoke Sleep,60
invoke MessageBox,0,ADDR ourmessage,ADDR ourtitle,MB_OK
invoke ExitProcess,0
end start

As I understand it the process should sleep for 60 seconds before displaying the Message Box. However no matter how many seconds I specify the Box appears "instantaneously".

Can anyone advise in what I am doing wrong?

Thanks, Firmo
Posted on 2002-10-24 14:24:47 by firmo

Try using it with...

invoke Sleep, 60000
Posted on 2002-10-24 14:28:45 by JimmyClif
Hi Jimmy,

Thanks for the reply. It worked, of course.

I get frustrated that I cant find a good reference for the MASM32 commands and an explanation on what functions there are in each of the main libraries, sintax and semantics.

Could you point me to a reference on these?

Thanks, Firmo
Posted on 2002-10-24 15:24:17 by firmo
firmo, the Sleep function is not MASM specific... it is part of widows, kernel32.dll to be more specific. The best place to get info on the API's is the Platform SDK from Microsoft:
Posted on 2002-10-24 16:09:45 by Gunner
Thanks Gunner.

Will do.

Best, Firmo
Posted on 2002-10-24 16:24:00 by firmo

Do a search for a file called WIN32.HLP, it is a winhelp format file that you need to access most of the Windows API function calls. Depending on where you find it on the net, it will be from about 12 meg to about 20 but it is invaluable for you while you are learning this stuff.


Posted on 2002-10-25 20:34:52 by hutch--
Got it.

Thanks, Firmo
Posted on 2002-10-28 07:11:48 by firmo