Jump to content
Welcome, welcome! Come in and register, and have some developer coffee. 👨‍💻 ×

Try creating a small GUI program yourself!


Recommended Posts

Want to know what this code does? Try it yourself in FASMW.

format PE GUI 4.0
entry start

include 'win32a.inc'

section '.data' readable writable
       title       db 'Kaki.GG',0
       message     db 'Developers and Programmers Unite!',0

section '.code' code readable writable executable

start:

       push 0x40
       push title
       push message
       push 0
       call [MessageBox]

       push eax
       call [ExitProcess]

section '.idata' import readable writable

       library kernel,'KERNEL32.DLL',\
               user,'USER32.DLL'

       import kernel,\
              ExitProcess,'ExitProcess'

       import user,\
              MessageBox,'MessageBoxA'

You can change the 0x40 with the following value to experiment different output:

           MB_OK = 0x000000,
           MB_OKCANCEL = 0x000001,
           MB_ABORTRETRYIGNORE = 0x000002,
           MB_YESNOCANCEL = 0x000003,
           MB_YESNO = 0x000004,
           MB_RETRYCANCEL = 0x000005,
           MB_ICONHAND = 0x000010,
           MB_ICONQUESTION = 0x000020,
           MB_ICONEXCLAMATION = 0x000030,
           MB_ICONASTERISK = 0x000040,
           MB_USERICON = 0x000080,
           MB_ICONWARNING = MB_ICONEXCLAMATION,
           MB_ICONERROR = MB_ICONHAND,
           MB_ICONINFORMATION = MB_ICONASTERISK,
           MB_ICONSTOP = MB_ICONHAND,

This program calls two Win32 API functions.   Do you know what are they?

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...