Shlwapi.dll 应用系列

/********************************************************************
 created: 2010/03/02
 created: 2:3:2010   8:54
 author:  还是追加内容
 purpose: 
*********************************************************************/
void main( void )
{
 // String for path name without file extension.
 char buffer_1[MAX_PATH] = "file";
 char *lpStr1;
 lpStr1 = buffer_1;
 
 // String for path name with file extension.
 char buffer_2[ ] = "file.doc";
 char *lpStr2;
 lpStr2 = buffer_2;
 
 // String for extension name.
 char F_Ext[MAX_PATH] = ".txt";
 char *lpStr3;
 lpStr3 = F_Ext;
 
 // Null string as path.
 char N_String[MAX_PATH] = "/0";
 char *lpStr4;
 lpStr4 = N_String;
 
 // Path 1 without the file extension.
 cout << "The original path string 1 is  " << lpStr1 << endl;
 
 int ret_1 = PathAddExtension(lpStr1,lpStr3);
 cout << "The modified path string 1 is  " << lpStr1 << endl;
 
    // Path 2 with the file extension already there.
    cout << "The original path string 2 is  " << lpStr2 << endl;
    int ret_2 = PathAddExtension(lpStr2,lpStr3);
    cout << "The modified path string 2 is  " << lpStr2<< endl;
 
    // Path 3 null string as a path.
    int ret_3 = PathAddExtension(lpStr4,lpStr3);
    cout << "The return value is " << ret_3<< endl;
    cout << "The modified path on a null string is " << lpStr4<< endl;
 
}

输出:

The original path string 1 is  file
The modified path string 1 is  file.txt
The original path string 2 is  file.doc
The modified path string 2 is  file.doc
The return value is 1
The modified path on a null string is .txt
Press any key to continue

 

版本 shlwapi.dll 4.7

头文件 shlwapi.h

shlwapi.lib

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值