API---有意思的API
//函數以毫秒計的系統時間。該時間為從系統開啟算起所經過的時間。
timeGetTime();
//獲取文件擴展名
char extension[5];
strcpy(extension,PathFindExtension(szPath));
//檢測文件是否存在
BOOL bifExist=PathFileExists("FileList.txt");
#include "stdafx.h"
#include <Windows.h>
#include "Shlwapi.h"
#pragma comment(lib, "shlwapi.lib")
int _tmain(int argc, _TCHAR* argv[])
{
?? ?TCHAR file[MAX_PATH]=_T("");
?? ?GetModuleFileName(NULL,file,MAX_PATH);
?? ?LPTSTR filePath=PathFindFileName(file);//如果路徑中不包含文件名,則返回值是最下面的目錄名。
?? ?LPTSTR extension=PathFindExtension(file);
?? ?PathRenameExtension(file, _T(".log"));
?? ?bool bPathFileExists=PathFileExists(file);
?? ?LPTSTR pszParam = PathGetArgs(_T("notepad.exe c://temp.txt"));
?? ?bool bPathIsURL=PathIsURL(_T("http://www.baidu.com"));
?? ?return 0;
}
總結
以上是生活随笔為你收集整理的API---有意思的API的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 多线程学习(一)----CreateTh
- 下一篇: GlobalAlloc全局内存的使用