/*_##################################### #######################################
_##
### 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.
*/