Windows 程序设计技巧
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
int nSelect = ::MessageBox(NULL,"windows 程序设计","测试",MB_OKCANCEL);
if (nSelect == IDOK)
{
printf("OK!");
}
else
{
printf("Cancel!");
}
return 0;
}
- 在程序中若要连接到指定的库文件,可以在文件开头使用“#pragma comment(lib,"my.lib")”,其中my.lib为目标库文件。
- 要获取API函数的信息信息,只需将光标移到此函数,在按F1键即可,或查询MSDN。