#include<windows.h>
#include<stdio.h>
LRESULT CALLBACK WinSunProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdshow
)
{
WNDCLASS wndcls;
wndcls.cbClsExtra=0;
wndcls.cbWndExtra=0;
wndcls.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wndcls.hCursor=LoadCursor(NULL,IDC_CROSS);
wndcls.hIcon=LoadIcon(NULL,IDI_ERROR);
wndcls.hInstance=hInstance;
wndcls.lpfnWndProc=WinSunProc;
wndcls.lpszClassName="Gem";
wndcls.lpszMenuName=NULL;
wndcls.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wndcls);
HWND hwnd;
hwnd=CreateWindow("Gem","欢迎你来我的Blog http://hexxun.com/ctfysj",
WS_OVERLAPPEDWINDOW,0,0,600,400,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK WinSunProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_CHAR:
char szChar[20];
sprintf(szChar,"char is %d",wParam);
MessageBox(hwnd,szChar,"jinm",0);
break;
case WM_LBUTTONDOWN:
MessageBox(hwnd,"mouse clicked","jinm",0);
HDC hdc;
hdc=GetDC(hwnd);
TextOut(hdc,0,50,"兰兰",strlen("兰兰"));
ReleaseDC(hwnd,hdc);
break;
case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
hDC=BeginPaint(hwnd,&ps);
TextOut(hDC,0,0,"I LOVE YOU!",strlen("I LOVE YOU!"));
EndPaint(hwnd,&ps);
break;
case WM_CLOSE:
if(IDYES==MessageBox(hwnd,"是否真的退出?","jinm",MB_YESNO))
{
DestroyWindow(hwnd);
}
break;
case WM_DESTROY:
{
PostQuitMessage(0);
}
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
return 0;
}
Microsoft Visual C++ 6.0 工程简介:
atl COM APPWIZARD 创建ATL应用模块工程
cluster resource type wizard 创建Cluster Resource(用于WINDOWS NT)
custom appwizard 创建自己的应用程序向导
database project 创建数据库应用程序
devstudio add-in wizard 创建ActiveX组件或者VBScript宏
isapi extension wizard 基于internet server程序
makefile 创建独立于VC++开发环境的应用程序
mfc activex controlwizard 创建ActiveX Control应用程序
mfc appwizard[dll] MFC动态链接库
mfc appwizard[exe] 一般的MFC的应用程序
utility project 创建简单使用的应用程序
win32 aplication 其他WIN32的WINDOWS应用程序
win32 console application WIN32的控制台应用程序
win32 dynamic-link library WIN32的动态链接库
win32 static library WIN32的静态链接库