General information
Category:
Windows API functions
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only