'바로가기'에 해당되는 글 1

  1. 2008.11.14 바탕화면에 인터넷 바로가기 만들기

바탕화면에 인터넷 바로가기 만들기

CuveDev | 2008. 11. 14. 16:16 | 큐브씨
(Last Modified: 2008.11.17 10:22)

사실 '인터넷 바로가기 아이콘'은 그냥 평범한 INI 형식의 텍스트 파일입니다 ^^;
(실행파일 바로가기 아이콘은 조금 다릅니다.. ;;)
따라서 다음과 같이 코딩하는 것만으로 간단히 인터넷 바로가기를 만들 수 있습니다.

01.BOOL CreateShortcut(LPCTSTR ptszURL,
02.            LPCTSTR ptszIconPath,
03.            LPCTSTR ptszShortcutName)
04.{
05.    BOOL Res = TRUE;
06. 
07.    Res &= WritePrivateProfileString(_T("InternetShortcut"),
08.            _T("URL"), ptszURL, ptszShortcutName);
09.    Res &= WritePrivateProfileString(_T("InternetShortcut"),
10.            _T("IconFile"), ptszIconPath, ptszShortcutName);
11.    Res &= WritePrivateProfileString(_T("InternetShortcut"),
12.            _T("IconIndex"), _T("1"), ptszShortcutName);
13. 
14.    return Res;
15.}