Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Text Services API
ZGTSB-Slider Button
Play/Pause/Stop SWA(Shockwave Audio)
Object Browser
SpellChecker
Show Recordset's Current Record
3D games online. New cosmic world of Tensoric.
XML TextRender v1.3
Set Quality of a QTVR Sprite
Version
 

 

 

Behavior Generic behavior to create a Shortcut

Added on 1/19/2002

 

Compatibilities:
behavior D6_5 D7 D8 D8_5 PC UK US

Required Xtras:
Desktop Xtra

This item has not yet been rated

Author: Shockdev

This behavior allows to create a Shortcut at Startup, Start Menu, Programs Menu or Desktop

Download PC Source
-- Generic behavior to create a Shortcut at Startup, Start Menu, Programs Menu or Desktop
-- Desktop Xtra 1.0 or later required
-- Compatibilities: Director 6.x, 7.x, 8.x, Windows

property Location, AddInfo, ProgramName, Object, Icon, WrkDirectory

on getPropertyDescriptionList
  set description = [:]
  addProp description, #Location, [#default:"Startup", #format:#string, #comment:"Shortcut location:" & RETURN & "(Startup, StartMenu, Programs, Desktop)"]
  addProp description, #AddInfo, [#default:"", #format:#string, #comment:"AddInfo, if Shortcut location = Programs" & RETURN & "(MyCompanyMyProgram...)"]
  addProp description, #ProgramName, [#default:"MyProgramName", #format:#string, #comment:"Shortcut Name"]
  addProp description, #Object, [#default:"C:Program FilesMyProgramMyProgram.exe", #format:#string, #comment:"Program Path"]
  addProp description, #Icon, [#default:"C:Program FilesMyProgramicon.ico", #format:#string, #comment:"Icon Path"]
  addProp description, #WrkDirectory, [#default:"C:Program FilesMyProgram", #format:#string, #comment:"Working Directory"]
  return description
end

on getBehaviorDescription
  return "            " &
  "- -    Generic Shortcut Behavior    - -" & RETURN &
  "Creates shortcut at:" & RETURN &
  "- Startup group;" & RETURN &
  "- Start Menu;" & RETURN &
  "- Programs Menu;" & RETURN &
  "- Desktop."
end

on mouseDown
  newShortcut
end

on newShortcut
  set Shortcut = [Location, AddInfo, ProgramName]
  set Ok = CreateShortcut(Shortcut)
  if getAt(Ok, 1)=0 then
    SetShortcutParameter(Shortcut, "Object", Object)
    SetShortcutParameter(Shortcut, "Icon", Icon)
    SetShortcutParameter(Shortcut, "WrkDirectory", WrkDirectory)
  else
    -- Error
    alert("Error: " & getAt(Ok, 1) & " - base error code")
  end if
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail