Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
George Tasker's Lnkfile.dll
Message
De
19/09/1999 05:50:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00265730
Message ID:
00266451
Vues:
20
>I am trying to create a shortcut at win desktop
> form my file called "p1.exe"
> Please, if you could write form the necessary lines
> for it.
> Because I didn't undestand the example of help file.


Here it is in a nut shell ... and a very cool little tool it is too.


&& SET UP SOME DECLARATION

DECLARE INTEGER CreateShellLink IN LNKFILES.DLL;
STRING @lpzLinkFileName, STRING @lpzExeFileName

DECLARE INTEGER FindDesktopFolder IN LNKFILES.DLL;
INTEGER hOwner, STRING @lpbuffer

DECLARE INTEGER SetWindowState IN LNKFILES.DLL;
INTEGER hWnd, STRING @lpszLinkName, INTEGER iWinState

DECLARE INTEGER SetLinkWorkDir IN LNKFILES.DLL;
INTEGER hWnd, STRING @lpszLinkName, STRING @lpszPath

DECLARE INTEGER SetLinkArgs IN LNKFILES.DLL;
INTEGER hWnd, STRING @lpszLinkName, STRING @lpszArguments

&& FIND DESKTOP ADDRESS - This finds the correct folder for the desktop

lcbuffer = SPACE(260)
lnresult = FindDesktopFolder(0, @lcbuffer)
lcdesktop = LEFT(lcbuffer, lnresult)

&& CREATE SHELL LINK

lclinkfile = ADDBS( lcdesktop ) + "Name of Link Goes Here.lnk"
lcexefile = "c:\somefolder\somefile.EXE" && PUT PATH TO EXE HERE
lnresult = CreateShellLink( @lclinkfile, @lcexefile )

llresult = SetWindowState( 0, @lclinkfile, 0 ) && SET TO STATE OF CHOICE

lcpath = "c:\somefolder\" && SET UP START/WORK DIRECTORY
llresult = SetLinkWorkDir( 0, @lclinkfile, @lcpath)

lcargs = "" && IF YOU NEED COMMAND LINK ARGS PUT THEM HERE
llresult = SetLinkArgs(0, @lclinkfile, @lcargs )


&& ALL DONE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform