常用MFC和API函数(15)

时间:2026-01-16

数通过发送一条 WM_PAINT 消息以更新客户区 vo

id UpdateWindow(); API 函数 GetPrivateProfileInt 从 ini 文件中读取整数值 UINT GetPrivateProfileInt(LPCTSTR lpAppName,LPCTSTR lpKeyName,INT nDefault,LPCSTR lpFileName); lpAppName 为段名,lpKeyName 为项名,nDefault 为找不到该项时返回的默认值, lpFileName 为 ini 文件名 返回值:若成功,返回指定项后的整数值,若该项 不存在,返回 nDefault 的值

GetPrivateProfileString 从 ini 文件中读取字 符串 DWORD GetPrivateProfileString(LPCTSTR lpAppName,LPCTSTR lpKeyName,LPCTSTR lpDefault,LPTSTR lpReturnedString,DWORD nSize,LPCTSTR lpFileName); lpAppName 为段名,lpKeyName 为项名,lpDefault 为找不到该项时返回的默认值, lpReturnedString 指向接收结果的字符串缓冲区,nSize 为缓冲区长 度,lpFileName 为 ini 文件名 执行结果:若成功,lpReturnedString 指示的串 中为读出的项值,若该项不存在, lpReturnedString 中为 lpDefault 的值 WritePrivateProfileString 把字符串写入 ini 文件 BOOL WritePrivateProfileString(LPCTSTR lpAppName,LPCTSTR lpKeyName,LPCTSTR lpString,LPCTSTR lpFileName); lpAppName 为段名,lpKeyName 为项名,lpString 为写入的字符串,lpFileName 为 ini 文件名 返回值:若成功,返回 true,否则返回 false 若写入时,该 ini 文件不存在,则这个函数会自动 建立这个文件,并建立相应的段和项。

常用MFC和API函数(15).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:4.9 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:19元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219