新网创想网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
BOOL CreateLink(LPWSTR szPath, LPCWSTR szLink) { HRESULT hres; IShellLink * psl; IPersistFile* ppf; WORD wsz[MAX_PATH]; CoInitialize(NULL); hres = CoCreateInstance( CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl); if (FAILED(hres)) { return FALSE; } psl->SetPath(szPath); psl->SetHotkey(MAKEWORD('M', HOTKEYF_SHIFT | HOTKEYF_CONTROL)); hres = psl->QueryInterface(IID_IPersistFile, (void**)&ppf); if (FAILED(hres)) return FALSE; //MultiByteToWideChar(CP_ACP, 0, szLink, -1, (LPWSTR)&wsz[0], MAX_PATH); hres = ppf->Save((LPCOLESTR)szLink, STGM_READWRITE); ppf->Release(); psl->Release(); CoUninitialize(); return TRUE; } VOID CreateShortCut(CString strAppName) { TCHAR DeskTopPath[MAX_PATH]; TCHAR currDirPath[MAX_PATH]; LPITEMIDLIST pidl = NULL; if (SUCCEEDED(SHGetFolderLocation(NULL, CSIDL_DESKTOP, NULL, 0, &pidl))) { SHGetPathFromIDList(pidl, DeskTopPath); IMalloc* pMalloc = NULL; ::SHGetMalloc(&pMalloc); pMalloc->Free(pidl); pMalloc->Release(); } CString tmp1 = GetApplicationPath2() + strAppName; TCHAR szFilename[MAX_PATH]; TCHAR szDrive[MAX_PATH]; TCHAR szPath[MAX_PATH]; TCHAR szExt[MAX_PATH]; _wsplitpath_s(tmp1, szDrive,255, szPath,255, szFilename,255, szExt,255); USES_CONVERSION; if (_access(W2A(tmp1), 0) == -1)return; CString tmp; tmp = DeskTopPath; tmp += "\\"; tmp += szFilename; tmp += _T(".lnk"); if (!CreateLink(tmp1.GetBuffer(), tmp)) AfxMessageBox(_T("创建快捷方式出错!")); tmp1.ReleaseBuffer(); }
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。