windows程序设计(第五版)笔记-001
来源:互联网 发布:理财大视野数据靠谱吗 编辑:程序博客网 时间:2024/06/06 02:10
#include <Windows.h>#include <tchar.h>#include <stdio.h>int CDECL MessageBoxPrint(TCHAR *szCaption, TCHAR * szFormat, ...)//CDECL stands for C Declaration. //In CDECL, subroutine arguments are passed on the stack.{TCHAR szBuffer[1024];va_list pArgList; // va_list is a pointer type in <stdarg.h>, which means variable list. // It can take variable argument from the target list using va_arg() // after initialize by va_start(), and after that, it should be terminate by va_end().// The va_start macro (defined in STDARG.H) is usually equivalent to// pArgList = (char*) & szFormat + sizeof(szFormat);va_start(pArgList, szFormat);// The last argument to wvsprintf points to the arguments// The function wvsprintf was abandoned.// And the substitute function is _vsntprintf_s or _vsnwprintf_s.//_vsntprintf(szBuffer, sizeof(szBuffer) / sizeof(TCHAR), szFormat, pArgList);//_vsntprintf(szBuffer, sizeof(szBuffer) - 1, szFormat, pArgList);//_vsntprintf(szBuffer, 1024, szFormat, pArgList);_vsntprintf_s(szBuffer, sizeof(szBuffer), 1024, szFormat, pArgList);// The va_end macro just zeroes out pArgList for no good reasonva_end(pArgList);return MessageBox(NULL, szBuffer, szCaption, 0);}int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow){int cxScreen, cyScreen;cxScreen = GetSystemMetrics(SM_CXSCREEN);cyScreen = GetSystemMetrics(SM_CYSCREEN);MessageBoxPrint(TEXT("ScrnSize"), TEXT("The screen is %i pixels wide by %i pixels high."), cxScreen, cyScreen);return 0;}
0 0
- windows程序设计(第五版)笔记-001
- 《windows程序设计》第五版学习笔记(1)
- Windows程序设计(第五版)源代码重写
- 《Windows程序设计》(第五版)勘误表
- 摘自windows程序设计第五版
- windows程序设计第五版 第四章SYSMETS3.C 示例分析(自己的笔记)
- windows程序设计 第五章笔记 GDI(1)
- windows程序设计(第五版珍藏版)清华大学出版
- 关于WIN32窗体ID(Windows程序设计第五版)
- Windows程序设计第五版读书笔记之一
- Windows程序设计第五版章节记录
- Windows程序设计第五版 读书体会
- Windows程序设计第五版(清华出版…
- windows程序设计第五章图形基础学习笔记
- window程序设计第五版学习笔记
- win32多线程程序设计笔记(第五章)
- javascript高级程序设计笔记(第五章)
- javascript高级程序设计笔记(第五章)
- float 浮点数的无效值和无限大和无限小
- TinyOS bug程序的执行01(T-Check中的bug)
- 显著性检测(Salient Detection)
- 1007. 素数对猜想 (20)
- RDD持久化、广播、累加器
- windows程序设计(第五版)笔记-001
- python 二进制,十进制,十六进制
- 配置Ceph为openstack后端
- 浮点数的理解和BigDecimal的使用
- 关于符号位扩展你又知道多少
- bzoj2002
- iOS9 中不支持http
- 我对递归的认识
- MySQL 常用日期和时间处理函数