现在开始学习 <windows程序设计> .把学习过程中的一些问题.一些笔记.记录在这边.以便以后复习的时候,回头比较有争对性.
自己清楚,接下来会遇到很多的问题,毕竟以前没有接触过windows 平台下程序设计.可能一些问题看起来土了.
把学习中遇到的问题用 特殊的颜色标志起来. 以后回头复习的话.也更有针对性.
:) Let me go.
///
// 01FirstApp.cpp文件
#include "stdafx.h" // 这是VC自动添加的头文件,没有什么用途
//这个头文件是框价头文件, 但是我编译的时候总是出现 error 1803...No such file or No file directory
//google 了一些方法.但是没有办法解决,我是那么的摸不着头脑. 请教你们一下 thanx ~:)
#include <windows.h> // 包含MessageBox函数声明的头文件
int main(int argc, char* argv[])
{
// 调用API函数MessageBox
int nSelect = ::MessageBox(NULL, "Hello, Windows XP", "Greetings", MB_OKCANCEL);
if(nSelect == IDOK)
printf(" 用户选择了“确定”按钮 /n");
else
printf(" 用户选择了“取消”按钮 /n");
return 0;
}
----------------------------------------------
关于函数MessageBox function 的介绍. MSDN如下说明:
This function creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons.
int MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);