PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Creating a shortcut
CreateShortcut (Example)
Creating a shortcut
This example creates the shortcut on the desktop of current user. The caption of this shortcut is "Application for Sales Management".
This shortcut is created for the "SalesMgt.exe" program installed in the SALESMGT sub-directory of "Program Files" directory of current user.
This shortcut:
  • is using the command line: /P=parameter
  • is associated with the Ctrl + Alt + A shortcut
  • has the data directory of user (SALESMGT sub-directory) as working directory
// Vista/7 ...: No administrator privilege is required
IF NOT CreateShortCut(shortcutFree, ...
// Free shortcut to specify a directory of the current user
// and not a directory common to all users
"Application for Sales Management", ... // Shortcut caption
StringBuild([
"%1SALESMGT\SalesMgt.exe" /P=parameter
], SysDir(srProgramFiles)+["\"]), ...
// Path of application to start (with its command line)
SysDir(srDesktop),...
// Shortcut location: directory of the desktop of the user
 swsNormal, ... // "Standard" opening
 "A", ... // Keyboard shortcut: Ctrl + Alt + A
StringBuild([
"%1SALESMGT\"
], SysDir(srAppData)+["\"])...
// Working directory:
// data directory of user (SALESMGT sub-directory)
) THEN
Error("Failure creating the shortcut in " + SysDir(srDesktop), ErrorInfo())
ELSE
Info("The shortcut was created")
END
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment