Hi,
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:
.386
.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
.data
ourmessage db "This is a message!",0
ourtitle db "This is the title of our message box!",0
.code
start:
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
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:
.386
.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
.data
ourmessage db "This is a message!",0
ourtitle db "This is the title of our message box!",0
.code
start:
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
MilliSeconds....
Try using it with...
invoke Sleep, 60000
Try using it with...
invoke Sleep, 60000
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
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
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:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate
http://www.microsoft.com/msdownload/platformsdk/sdkupdate
Thanks Gunner.
Will do.
Best, Firmo
Will do.
Best, Firmo
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.
Regards,
hutch@movsd.com
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.
Regards,
hutch@movsd.com
Got it.
Thanks, Firmo
Thanks, Firmo