Salut, j'm'appelle Quentin, j'suis de montargis.... Heu, non, c'est moi : SPH
je me demandais si quelqu'un avait ici meme deja codé en pb un "fabriqueur" de raccourci ?
J'en ai matté en hexa; c'est un peu le bordel (pour etre poli)
FABRIQUER un raccourci de programme
FABRIQUER un raccourci de programme
Dernière modification par SPH le mar. 09/juil./2019 21:16, modifié 1 fois.
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: FABRIQUER un raccourci de programme
bouton recherche =
https://www.purebasic.fr/french/viewtop ... +raccourci
la aussi :
https://www.purebasic.fr/french/viewtop ... +raccourci
https://www.purebasic.fr/french/viewtop ... +raccourci
la aussi :
https://www.purebasic.fr/french/viewtop ... +raccourci
Site: http://michel.dobro.free.fr/
Devise :"dis moi ce dont tu as besoin, je t'expliquerai comment t'en passer"
- falsam
- Messages : 7244
- Inscription : dim. 22/août/2010 15:24
- Localisation : IDF (Yvelines)
- Contact :
Re: FABRIQUER un raccourci de programme
Tu es désespérant SPH
Configuration : Windows 11 Famille 64-bit - PB 6.03 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Re: FABRIQUER un raccourci de programme
Bin, je ne trouve pas ca evident en partant de rien...falsam a écrit :Tu es désespérant SPH
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: FABRIQUER un raccourci de programme
Bonsoir à tous,
Créer un raccourci sur le bureau, il faut que l'application se trouve dans le même dossier que le code ci_dessous.
Créer un raccourci sur le bureau, il faut que l'application se trouve dans le même dossier que le code ci_dessous.
Code : Tout sélectionner
Declare createShellLink(Application.s, LinkFileName.s, arg.s, desc.s, dir.s, icon.s, index)
'ProgName$ doit contenir le nom de votre application sans extension qui doit se trouveer dans le même dossier courant
ProgName$="Myprog"
ProgDesc$="Logiciel test"
Procedure createShellLink(Application.s, LinkFileName.s, arg.s, desc.s, dir.s, icon.s, index)
Protected hRes.l, mem.s, ppf.IPersistFile
CompilerIf #PB_Compiler_Unicode
Protected psl.IShellLinkW
CompilerElse
Protected psl.IShellLinkA
CompilerEndIf
;make shure COM is active
CoInitialize_(0)
hRes = CoCreateInstance_(?CLSID_ShellLink, 0, 1, ?IID_IShellLink, @psl)
If hRes = 0
psl\SetPath(Application)
psl\SetArguments(arg)
psl\SetDescription(desc)
psl\SetWorkingDirectory(dir)
psl\SetIconLocation(icon, index)
;query IShellLink for the IPersistFile interface for saving the
;link in persistent storage
hRes = psl\QueryInterface(?IID_IPersistFile, @ppf)
If hRes = 0
;CompilerIf #PB_Compiler_Unicode
;save the link
hRes = ppf\Save(LinkFileName, #True)
ppf\Release()
EndIf
psl\Release()
EndIf
;shut down COM
CoUninitialize_()
DataSection
CLSID_ShellLink:
Data.l $00021401
Data.w $0000,$0000
Data.b $C0,$00,$00,$00,$00,$00,$00,$46
IID_IShellLink:
CompilerIf #PB_Compiler_Unicode
Data.l $000214F9
CompilerElse
Data.l $000214EE
CompilerEndIf
Data.w $0000,$0000
Data.b $C0,$00,$00,$00,$00,$00,$00,$46
IID_IPersistFile:
Data.l $0000010b
Data.w $0000,$0000
Data.b $C0,$00,$00,$00,$00,$00,$00,$46
EndDataSection
ProcedureReturn hRes
EndProcedure
;-----------------------------------------------------------------------------
Procedure CreateIcone()
If createShellLink(Application, LinkFileName, "", LinkName, WorkDirectory, Application, 0) = 0
errorfound=0
Else
MessageRequester("Erreur","Le raccourci n'a pas pu être créé")
EndIf
EndProcedure
i=Len(ProgName$)
;-----------------------------------------------------------------------------------
;Création du raccourci
Application = GetCurrentDirectory() + "\" + progname$+".exe"
WorkDirectory = GetPathPart(Application)
LinkFileName = GetHomeDirectory() + "desktop\" + progName$ +".lnk"
LinkName =ProgDesc$
CreateIcone()
MessageRequester("","Création raccourci terminé!")
End
Win7 (x64) 64 bits Pb 5.72
Re: FABRIQUER un raccourci de programme
Heu !!! omega et dans la barre de tache sous W10 s'il vous plait M'sieur
Merci pour le code ci-dessus
Merci pour le code ci-dessus