Programming Windows Programming Guide-> Chapter 1 example Program

Source: Internet
Author: User
/*_##################################### #######################################
_##
### Programming Windows Programming Design Guide-> Chapter 1 example Program
_ ## Author: xwlee
_ ## Time: 2007.01.09
### Chang'an University
_ ## Development condition: win2003 SERVER + vc6.0
_##
_ ## Hellomsg. c file
_####################################### ###################################*/
/*------------------------------------------------------------------
Hellomsg. c -- displays "Hello, Windows 98! "In a message box

(C) Charles Petzold, 1998
--------------------------------------------------------------------*/
# Include <windows. h>

Int winapi winmain (hinstance, hinstance hprevinstance,
Pstr szcmdline, int icmdshow)
{
MessageBox (null, text ("Hello, Windows 98! "), Text (" hellomsg "), 0 | 1 );
Return 0;
}

/*
Windows. H is the main file that contains other Windows header files. Some of these header files also contain other header files.
The most important and basic of these header files are:

· Windef. H basic type definition.
· Winnt. h supports Unicode type definition.
· WINBASE. h kernel function.
· Winuser. h user interface function.
· Wingdi. h graphic device interface function.
 
These header files define all windows data types, function calls, data structures, and constant delimiter,
They are an important part of Windows files. Use Visual C ++ studio's
Find in files in the edit menu is very convenient to search for these header files. You can also
Open these header files in developer studio and read them directly.

The first parameter of winmain is called "instance handle 」. In Windows programming,
A handle is only a number used by an application to identify something. In this case,
The handle uniquely identifies the program and must be used as a parameter in other Windows function calls.
In earlier versions of Windows, when you run the same program multiple times at the same time
「 Multiple instances )」. All instances of the same application
And read-only memory (usually resources such as menus and dialog box templates ). Program Pass Check
The hprevinstance parameter determines whether other instances are running. Then it
You can skip some complicated work and move some data from the previous instance to your data region.

The second parameter passed to winmain is always null (defined as 0 ). In 32-bit windows, this concept has been abandoned.

The third parameter of winmain is the command column used to run the program. Some Windows applications use it when the program starts
Load files into memory.

The fourth parameter of winmain indicates the method in which the program is initially displayed, which can be normal or fully filled with the entire screen,
Or minimize the display in the taskbar.
*/

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.