The simplest Windows program

Source: Internet
Author: User

Getting ready to study VMP protection, starting with one of the simplest Windows programs seems like a good idea.

What is the simplest, only one MessageBox call OK.

Pop-up message, exit, OH also, simple enough.

Sacrifice the VC2010 of the ritual, the new Win32 project,

#include "stdafx.h"

int Apientry _tWinMain (hinstance hinstance,
HInstance hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MessageBox (NULL, L "smallest", l "smallest", MB_OK);
return 0;
}
Release mode compilation generation, OD debug tracking.

Low oil, too bloated!

Find back the lost Masm32, wow, all v11!

Find a simple example, thin body, and then thin ...

; ?
.486; Create + bit code
. Model flat, stdcall; A-bit memory model
Option Casemap:none; Case sensitive

Include \masm32\include\windows.inc
Include \masm32\include\kernel32.inc
Include \masm32\include\user32.inc

Includelib \masm32\lib\kernel32.lib
Includelib \masm32\lib\user32.lib

. const
SzTitle db ' smallest ', 0
Szmessage db ' smallest ', 0

. Code
; ?

Start

Invoke MessageBox, NULL, addr szmessage, addr szTitle, MB_OK

Invoke Exitprocess,eax

; ?

End Start

Well, build all, well, that's the simplest Windows program,:-).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.