flat assembler
Message board for the users of flat assembler.

Index > Windows > What does IDYES mean?

Author
Thread Post new topic Reply to topic
Lengua_Maquinista



Joined: 05 Apr 2017
Posts: 4
Lengua_Maquinista 09 Apr 2017, 22:30
Below I have the program in question's source code listed.

Now I see that for the cd player to open on your computer when you run it, you have to answer the message box "YES", and assembly language compares the message box with what you entered to see if the program will continue. With a little bit of research IDYES obviously has something to do with basic/message-box. But what?



Thanks




Code:
; Beer - example of tiny (one section) Win32 program

format PE GUI 4.0

include 'win32a.inc'

; no section defined - fasm will automatically create .flat section for both
; code and data, and set entry point at the beginning of this section

        invoke  MessageBoxA,0,_message,_caption,MB_ICONQUESTION+MB_YESNO
        cmp     eax,IDYES
        jne     exit

        invoke  mciSendString,_cmd_open,0,0,0
        invoke  mciSendString,_cmd_eject,0,0,0
        invoke  mciSendString,_cmd_close,0,0,0

exit:
        invoke  ExitProcess,0

_message db 'Do you need additional place for the beer?',0
_caption db 'Desktop configuration',0

_cmd_open db 'open cdaudio',0
_cmd_eject db 'set cdaudio door open',0
_cmd_close db 'close cdaudio',0

; import data in the same section    


Edit by revolution: Added code tags
Post 09 Apr 2017, 22:30
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 09 Apr 2017, 22:33
MessageBoxA returns value in eax based on what button you clicked. IDYES is the value which is returned when you clicked MB_YES button
Post 09 Apr 2017, 22:33
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek 09 Apr 2017, 22:58
Post 09 Apr 2017, 22:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.