如何创建网页快捷方式? ?? 用创建桌面快捷方式的的方法可以实现功能 但是和标准的网页快捷方式不一样 如何能创建标准的网页快捷方式比如IE7 文件 -> 发送 -> 桌面快捷方式 生成的这种 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 创建网页快捷方式的扩展名为url如www.wantsoft.com.url-----------------------------http://www.wantsoft.com qq群:3730223隐形者软件代码交流博客 ----------------------------- 创建网页快捷方式的扩展名为url如www.wantsoft.com.url-----------------------------http://www.wantsoft.com qq群:3730223隐形者软件代码交流博客 ----------------------------- #include <windows.h>#include <intshcut.h>HRESULT CreateShortcutToURL(LPCSTR pszURL, LPCSTR pszLinkFile);int main(){ CoInitialize(NULL); HRESULT hRes = CreateShortcutToURL("http://support.microsoft.com","c:\\mssupport.url"); if (SUCCEEDED(hRes)) { // do something... } CoUninitialize(); return 0;}HRESULT CreateShortcutToURL(LPCSTR pszURL, LPCSTR pszLinkFile){ HRESULT hRes; IUniformResourceLocator *pURL = NULL; // Create an IUniformResourceLocator object hRes = CoCreateInstance (CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, IID_IUniformResourceLocator, (LPVOID*) &pURL); if (SUCCEEDED(hRes)) { IPersistFile *pPF = NULL; hRes = pURL->SetURL(pszURL, 0); if (SUCCEEDED(hRes)) { WCHAR wsz [MAX_PATH]; // buffer for Unicode string // Ensure that the string consists of ANSI characters. MultiByteToWideChar (CP_ACP, 0, pszLinkFile, -1, wsz, MAX_PATH); hRes = pURL->QueryInterface (IID_IPersistFile, (void **)&pPF); if (SUCCEEDED(hRes)) { // Save the shortcut via the IPersistFile::Save member function. hRes = pPF->Save (wsz, TRUE); // Release the pointer to IPersistFile. pPF->Release (); } } // Release the pointer to IUniformResourceLocator pURL->Release (); } return hRes;} mfc下载管理控件 运行算法时界面卡住了??? API 线程不能关闭 基础问题,请问一幅图的宽度*高度 就是它像素点个数吗? 请问:如何获得子窗口的数目? 有谁知道怎样把数据库的数据导入CGridCtrl控件啊?我用的是ODBC接口,谢? 请教关于内存泄露的问题 急问 CSocket的Receive()函数怎么不阻塞啊 散分 关于PostMessage模拟鼠标的问题 请问VC FORM之间如何传参数
如www.wantsoft.com.url
-----------------------------
http://www.wantsoft.com
qq群:3730223
隐形者软件代码交流博客
-----------------------------
如www.wantsoft.com.url
-----------------------------
http://www.wantsoft.com
qq群:3730223
隐形者软件代码交流博客
-----------------------------
#include <intshcut.h>HRESULT CreateShortcutToURL(LPCSTR pszURL, LPCSTR pszLinkFile);int main()
{
CoInitialize(NULL);
HRESULT hRes = CreateShortcutToURL("http://support.microsoft.com","c:\\mssupport.url");
if (SUCCEEDED(hRes))
{
// do something...
}
CoUninitialize();
return 0;
}HRESULT CreateShortcutToURL(LPCSTR pszURL, LPCSTR pszLinkFile)
{
HRESULT hRes;
IUniformResourceLocator *pURL = NULL; // Create an IUniformResourceLocator object
hRes = CoCreateInstance (CLSID_InternetShortcut, NULL,
CLSCTX_INPROC_SERVER, IID_IUniformResourceLocator, (LPVOID*) &pURL);
if (SUCCEEDED(hRes))
{
IPersistFile *pPF = NULL; hRes = pURL->SetURL(pszURL, 0); if (SUCCEEDED(hRes))
{
WCHAR wsz [MAX_PATH]; // buffer for Unicode string // Ensure that the string consists of ANSI characters.
MultiByteToWideChar (CP_ACP, 0, pszLinkFile, -1, wsz, MAX_PATH); hRes = pURL->QueryInterface (IID_IPersistFile, (void **)&pPF);
if (SUCCEEDED(hRes))
{
// Save the shortcut via the IPersistFile::Save member function.
hRes = pPF->Save (wsz, TRUE); // Release the pointer to IPersistFile.
pPF->Release ();
}
}
// Release the pointer to IUniformResourceLocator
pURL->Release ();
}
return hRes;
}