获取系统信息(WINDOWS目录/系统目录/临时目录/我的文档/桌面)
2021-01-20 04:14
标签:src tor desktop temp inf get style win mamicode 获取系统信息(WINDOWS目录/系统目录/临时目录/我的文档/桌面) 标签:src tor desktop temp inf get style win mamicode 原文地址:https://www.cnblogs.com/mktest123/p/12144420.html 1 void C获取系统目录Dlg::OnBnClickedButton1()
2 {
3 TCHAR szPath[MAX_PATH] = { 0 };
4 GetWindowsDirectory(szPath, MAX_PATH);
5 MessageBox(szPath);
6 }
7
8
9 void C获取系统目录Dlg::OnBnClickedButton2()
10 {
11 TCHAR szPath[MAX_PATH] = { 0 };
12 GetSystemDirectory(szPath, MAX_PATH);
13 MessageBox(szPath);
14 }
15
16
17 void C获取系统目录Dlg::OnBnClickedButton3()
18 {
19 TCHAR szPath[MAX_PATH] = { 0 };
20 GetTempPath(MAX_PATH, szPath);
21 MessageBox(szPath);
22 }
23
24
25 void C获取系统目录Dlg::OnBnClickedButton4()
26 {
27 TCHAR szPath[MAX_PATH] = { 0 };
28 SHGetSpecialFolderPath(m_hWnd, szPath, CSIDL_DESKTOP, FALSE);
29 MessageBox(szPath);
30 }
31
32
33 void C获取系统目录Dlg::OnBnClickedButton5()
34 {
35 TCHAR szPath[MAX_PATH] = { 0 };
36 SHGetSpecialFolderPath(m_hWnd, szPath, CSIDL_MYDOCUMENTS, FALSE);
37 MessageBox(szPath);
38 }
文章标题:获取系统信息(WINDOWS目录/系统目录/临时目录/我的文档/桌面)
文章链接:http://soscw.com/index.php/essay/44375.html