PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → WX Informatica: Criando Atalhos para a sua aplicação
WX Informatica: Criando Atalhos para a sua aplicação
Iniciado por BOLLER, abr., 03 2019 1:25 PM - Sem resposta
Membro registado
3.657 mensagems
Popularité : +175 (223 votes)
Publicado em abril, 03 2019 - 1:25 PM
CreateShortcuts()

sShortcut_Name is string = "Ranna"
sShortcut_Command is string = "C:\Projeto\Ranna.exe"

//Diretorio de execução
IF fDirectoryExist("C:\Temp\") = False
fMakeDir("C:\Temp\")
END

//Copiar arquivo
IF fFileExist("C:\Temp\Ranna.exe") = False
fCopyFile(fCurrentDir()+"\Ranna.exe","C:\Temp\Ranna.exe")
END

//Criar Autorun no Registro
RegistrySetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\", sShortcut_Name, sShortcut_Command)

//criação dos atalhos
IF CreateShortCut(shortcutStart, sShortcut_Name, sShortcut_Command, "", swsNormal, "A") = False THEN
Error("Failure creating the shortcut in" + SysDir(srCommonDesktop) + ...
", check your rights (administrator privileges required)", ErrorInfo())
//ELSE
// Info("The shortcut was created")
END

IF CreateShortCut(shortcutStartup, sShortcut_Name, sShortcut_Command, "", swsNormal, "A") = False THEN
Error("Failure creating the shortcut in" + SysDir(srCommonDesktop) + ...
", check your rights (administrator privileges required)", ErrorInfo())
//ELSE
// Info("The shortcut was created")
END

IF CreateShortCut(shortcutUserDesktop, sShortcut_Name, sShortcut_Command, "", swsNormal, "A") = False THEN
Error("Failure creating the shortcut in" + SysDir(srCommonDesktop) + ...
", check your rights (administrator privileges required)", ErrorInfo())
//ELSE
// Info("The shortcut was created")
END

IF CreateShortCut(shortcutProgram, sShortcut_Name, sShortcut_Command, "", swsNormal, "A") = False THEN
Error("Failure creating the shortcut in" + SysDir(srCommonDesktop) + ...
", check your rights (administrator privileges required)", ErrorInfo())
//ELSE
// Info("The shortcut was created")
END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/