// 바로가기 아이콘 만들기
/* gf_Create_Shortcuts(string : as_name, as_path, as_file, as_age, as_icon )
// 바탕화면 경로 는 다름과 같이
s_Key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
s_val = "Desktop"
RegistryGet(s_Key, s_val, RegString!, s_Desktop)
string as_name 바로가기 이름 : 전체경로를 줘야 한다. C:\Users\sinwook\Desktop\미트 관리.lnk
string as_path 실행하는 경로
string as_file 실행하는 파일명
string as_age 실행시 아그먼트
string as_icon 아이콘 파일 : 전체경로를 줘야 한다.
*/
OleObject WSHShell
WSHShell = Create OleObject
Integer li_rtn
li_rtn = WSHShell.ConnectToNewObject("WScript.Shell")
Choose Case li_rtn
Case -1 ; MessageBox(String(li_rtn),'Invalid Call: the argument is the Object property of a control')
Case -2 ; MessageBox(String(li_rtn),'Class name not found')
Case -3 ; MessageBox(String(li_rtn),'Object could not be created')
Case -4 ; MessageBox(String(li_rtn),'Could not connect to object')
Case -9 ; MessageBox(String(li_rtn),'Other error')
Case -15 ; MessageBox(String(li_rtn),'MTS is not loaded on this computer')
Case -16 ; MessageBox(String(li_rtn),'Invalid Call: this function not applicable')
End Choose
if li_rtn < 0 Then
WSHShell.DisconnectObject()
DESTROY WSHShell
Return -1
End if
if Right(as_path,Len('\')) <> '\' then as_path += '\'
OleObject MyShortcut, MyDesktop
MyShortcut = Create OleObject
MyDesktop = Create OleObject
If FileExists(as_name) Then FileDelete ( as_name )
MyShortcut = WSHShell.CreateShortcut(as_name)
// 바로가기 아이콘 속성 설정 및 저장
//대상(Target Path) 설정(실행파일위치 + 실행파일명.exe)
MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings(as_path+as_file)
// 실행위치 설정(실행파일위치한 Path)
MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings(as_path)
MyShortcut.WindowStyle = 4
// 실행 옵션
MyShortcut.Arguments = WSHShell.ExpandEnvironmentStrings(as_age)
// Icon 설정(아이콘지정위치)
MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings(as_icon)
// 저장
MyShortcut.Save()
Destroy MyShortcut
Destroy MyDesktop
WSHShell.DisconnectObject()
DESTROY WSHShell
return 0