// 101107.cpp
// 第一个应用程序
// 钱磊 2010/11/07
#include "stdafx.h"
#include
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//获取桌面的句柄
HWND hWnd = GetDesktopWindow();
//显示一行消息
::MessageBox(hWnd, _T("第一个应用程序"), _T("例子"), MB_OK);
return 0;
}
VS平台:打开VS,新建项目,选Win32->Win32控制台应用程序 然后下一步,后面的类型中选Windows应用程序,然后就可以在.cpp中把上面代码弄进去,记得.h文件名变化...另外再加上#include
VC6.0平台:Win32 Application->一个简单的Win32程序 然后在WinMain中就可以把上面代码放进去...另外再加上#include VC编译如果出现Cannot open precompiled header file:'Debug/(文件名).pch'问题,解决方法: http://blog.csdn.net/mh_memory/archive/2010/11/01/5979079.aspx