MFC怎樣建立快捷方式?

2021-06-20 14:15:22 字數 842 閱讀 7657

bool ctestcreateshortdlg::createshort(cstring strname, cstring strsourcepath )

int i;

char path[max_path+1];

cstring strdestdir;

i=csidl_desktopdirectory;

lpitemidlist pidl;

lpmalloc pshell;

if(succeeded(shgetmalloc(&pshell)))

pshell->release();

strdestdir.format("%s",path);

strdestdir+="\\";

strdestdir+=strname;//設定桌面快捷方式的名字

strdestdir+=".lnk";

ishelllink* psl;

if(succeeded(cocreateinstance

(clsid_shelllink,null,clsctx_inproc_server,iid_ishelllink,(lpvoid*)&psl)))

else

}else

}else

}else

}else

}

呼叫這個函式的時候,createshort(cstring strname, cstring strsourcepath )

strname是快捷方式的名字,strsourcepath是要建立快捷方式的檔案的路徑。如:

createshort("快捷方式",「d:\\新建資料夾\\abc.exe」)

建立快捷方式

苦苦搜尋了n天,終於被我找到了,拿出來給大家參考一下 private declare function fcreateshelllink lib vb6stkit.dll byval lpstrfoldername as string,byval lpstrlinkname as string,by...

WinCE建立快捷方式

1.wince的快捷方式是乙個.lnk為字尾的文字檔案,其內容格式為 number of ascii characters after pound sign allocated to command line arguments command line optional parameters 例如...

ubuntu 建立快捷方式

然後在彈出的檔案中輸入 1 desktop entry 2 encoding utf 8 3 name eclipse 4 comment eclipse ide 5 exec usr local eclipse eclipse 6 icon usr local eclipse icon.xpm 7...