Quantcast
Viewing all articles
Browse latest Browse all 2638

Re: Creating a Desktop Shortcut programatically

oleobject ws, loo_shortcut

string ls_desktop

 

ws = CREATE oleobject

ws.ConnectToNewObject("WScript.Shell")

 

// other "specialfolder" of interest

// AllUsersDesktop

// AllUsersStartMenu

// AllUsersPrograms

// AllUsersStartup

// Desktop

// Favorites

// MyDocuments

// Programs

// Recent

// SendTo

// StartMenu

// Startup

ls_desktop = ws.SpecialFolders("Desktop")

loo_shortcut = ws.CreateShortcut(ls_desktop +"\realhowto.lnk")

loo_shortcut.TargetPath = "http://www.rgagnon.com/howto.html"

loo_shortcut.WorkingDirectory = ls_desktop

 

// 1 Activates and displays a window.

// If the window is minimized or maximized, the system restores it to

// its original size and position.

// 3 Activates the window and displays it as a maximized window.

// 7 Minimizes the window and activates the next top-level window.

loo_shortcut.WindowStyle = 1

loo_shortcut.IconLocation = &

  ws.ExpandEnvironmentStrings("%WINDIR%\SYSTEM\url.dll , 0")

 

loo_shortcut.Save


ref:  Create a Shortcut - Real's PowerBuilder Howto


Viewing all articles
Browse latest Browse all 2638

Trending Articles