Windows2000下如何获取某用户文档的路径? 一、请问如何获取Windows2000的系统盘符?二、假如我要获得以下路径该如何做?(H盘是我的Windows2000系统盘)H:\Documents and Settings\Administrator\「开始」菜单\程序\启动 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用APIGetSystemDirectory()检索windows系统文件名;我以前用过一个API,好像是获得系统盘府的,不过记不起来了,等我找到在给你!祝你进步! 获得当前用户名用GetUserName() 以下代码如何修改才能达到我想要的效果? char path[MAX_PATH]; char link[MAX_PATH]; CShortcut shortcut; SHORTCUTSTRUCT strt; memset(path,0,sizeof(path)); memset(link,0,sizeof(link)); //GetWindowsDirectory(link,MAX_PATH); GetWindowsDirectory(link,MAX_PATH); GetCurrentDirectory(MAX_PATH,path); wsprintf(link+strlen(link),"%s","\\Start Menu\\Programs\\启动\\定时关机.lnk"); wsprintf(path+strlen(path),"\\%s.exe",AfxGetApp()->m_pszExeName); strt.nIconIndex = 0; strt.nShowCmd = 0; strt.wHotkey = MAKEWORD((BYTE) 0, (BYTE) 0); strt.strPath = link; strt.strTarget = path; strt.strArgs = _T(""); strt.strDescription = _T(""); strt.strIconLocation = _T(""); shortcut.CreateEx(&strt); char path[MAX_PATH];使用SHGetFolderPath(NULL,CSIDL_STARTUP ,NULL,SHGFP_TYPE_CURRENT,&path)取得,建议在MSDN中查一下这个函数。 char buf[60];GetSystemDirectory(buf, 60); //本机 buf="C:\winnt\system32"//取出冒号前的字符串就可 如何给系统发送WM_DEVICECHANGE消息 串口通信的第9位PC机是怎么读取的 有志创业者,参加赢在中国的进啊! 如何限制窗口大小?一个MDI窗口,我想限制它的大小,宽度和高度成比例。 网上下载的P2P源码怎么老是编译不过呢?有谁编译通过的吗?进来说说,是怎么回事呢? 关于CRecordSet **Socket字节数组问题,高分求教** 关于CTreeCtrl::SortChildrenCB,不明白。。。 数据类型转换的问题,答对就给分 ◆问:程序跑起来之后,在不停下来的情况吓,还能修改里面的值嘛? 紧急提问????? 大家看看我做的游戏,来者有分!
GetSystemDirectory()检索windows系统文件名;
我以前用过一个API,好像是获得系统盘府的,不过记不起来了,
等我找到在给你!
祝你进步!
用GetUserName()
char path[MAX_PATH];
char link[MAX_PATH];
CShortcut shortcut;
SHORTCUTSTRUCT strt; memset(path,0,sizeof(path));
memset(link,0,sizeof(link));
//GetWindowsDirectory(link,MAX_PATH);
GetWindowsDirectory(link,MAX_PATH);
GetCurrentDirectory(MAX_PATH,path);
wsprintf(link+strlen(link),"%s","\\Start Menu\\Programs\\启动\\定时关机.lnk");
wsprintf(path+strlen(path),"\\%s.exe",AfxGetApp()->m_pszExeName); strt.nIconIndex = 0;
strt.nShowCmd = 0;
strt.wHotkey = MAKEWORD((BYTE) 0, (BYTE) 0);
strt.strPath = link;
strt.strTarget = path;
strt.strArgs = _T("");
strt.strDescription = _T("");
strt.strIconLocation = _T(""); shortcut.CreateEx(&strt);
建议在MSDN中查一下这个函数。
GetSystemDirectory(buf, 60);
//本机 buf="C:\winnt\system32"
//取出冒号前的字符串就可