:Start of demo1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"> <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>demo1.dsc</title><STYLE>BODY{FONT-SIZE: 12px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #ffffed } A{COLOR: Blue} A:active {FONT-WEIGHT: bold; COLOR: #008000} A:visited{FONT-WEIGHT: bold; COLOR: #400000} A:hover{ FONT-WEIGHT: bold; COLOR: #008000;} H1{COLOR: #400000; TEXT-ALIGN: left FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif} #copyright { border-top: 2px solid rgb(165, 82, 0); width: 100%; } DIV.left{TEXT-ALIGN: left} DIV.centered{TEXT-ALIGN: center}</STYLE></head><body bgcolor=#ffffed><table width="100%" height="133"><tr height="129"><th width="173"><a href = "http://www.dragonsphere.net" target = "_blank"><img style="Z-INDEX: 100; LEFT: 25px; POSITION: absolute; TOP: 40px" height="124" alt="DragonSphere" src="http://www.dragonsphere.net/images/dragonfly.png" width="169" align="left" border="0"></a></th><th><a href = "http://www.dragonsphere.net" target = "_blank"><img style="Z-INDEX: 100; LEFT: 200px; POSITION: absolute; TOP: 40px" height="124" alt="Software" src="http://www.dragonsphere.net/images/dslogotext.png" width="473" align="left" border="0"></a></th></tr></table><br/><!--

#DEFINE COMMAND,<!--
#DEFINE COMMAND,-->
<!-- This is crazy but now we should be able to see this script in the browser and run it in VDS too without changing the source code. --><h1>DragonSphere Software Demos</h1><br/><p>If you are viewing this script in your browser you can save it as a VDS 5.x source file (*.dsc) to run it.</p><br/><hr><br/><pre>
#-----------------------------------------------------------------------------#
#                                                                             #
# Several demostrations showing the usage of the VDSShortCut.dll              #
#                                                                             #
# Author:  Johnny Kinsey                                                      #
#                                                                             #
# Copyright: Copyright © 2007 DragonSphere Software                           #
#                                                                             #
#-----------------------------------------------------------------------------#


External vdsshortcut.dll
If @Greater(@Name(@Sysinfo(DSVER)),4)
#DEFINE COMMAND,SHORTCUT
#DEFINE FUNCTION,SHORTCUT
End
# Create a new Shortcut file (.LNK)
%%LinkId = @ShortCut(New)
If %%LinkId
  # Set properties for the new Shortcut file
  ShortCut Set,Target,%%LinkId,c:\myapp.exe
  ShortCut Set,Description,%%LinkId,This is just a demo of the ShortCut commands
  ShortCut Set,WorkingDir,%%LinkId,C:\
  ShortCut Set,Icon,%%LinkId,c:\myapp.exe,1
  ShortCut Set,HotKey,%%LinkId,Ctrl+Alt+J
  ShortCut Set,ShowCmd,%%LinkId,Minimized
  ShortCut Set,Arguments,%%LinkId,"%1"
  # Save the new shortcut.
  ShortCut Save,%%LinkId,c:\test.lnk
  If @OK()
    Info c:\test.lnk was saved successfully.
  End
Else
  Warn Could not create a new Icon
End

# Load an existing shortcut file (*.LNK)
%%LinkId = @ShortCut(Load,C:\test.LNK)
If %%LinkId
  # Read the properties of the shortcut file
  %%Target = @ShortCut(Get,Target,%%LinkId)
  %%Description = @ShortCut(Get,Description,%%LinkId)
  %%WorkingDir = @ShortCut(Get,WorkingDir,%%LinkId)
  %%Arguments = @ShortCut(Get,Arguments,%%LinkId)
  %%Hotkey = @ShortCut(Get,HotKey,%%LinkId)
  %%ShowCmd = @ShortCut(Get,ShowCmd,%%LinkId)
  Parse "%%IconPath;%%IconIdx",@ShortCut(Get,Icon,%%LinkId,@fsep())
  Info test.lnk Properties@CR()Description: %%Description@cr()Target: %%Target@cr()WorkingDir: %%WorkingDir@cr()Arugments: %%Arguments@cr()IconPath: %%IconPath@cr()IconId: %%IconIdx@cr()Hotkey: %%Hotkey@cr()ShowCmd: %%ShowCmd
  ShortCut UnLoad,%%LinkId
Else
  Warn Cannot open Link
End

# Read and Update properties in an existing shortcut file (*.LNK)
Info Updating c:\test.lnk
%%LinkId = @ShortCut(Load,C:\test.LNK)
If %%LinkId
  # Begin Reading
  %%Target = @ShortCut(Get,Target,%%LinkId)
  %%Description = @ShortCut(Get,Description,%%LinkId)
  %%WorkingDir = @ShortCut(Get,WorkingDir,%%LinkId)
  %%Arguments = @ShortCut(Get,Arguments,%%LinkId)
  %%Hotkey = @ShortCut(Get,HotKey,%%LinkId)
  %%ShowCmd = @ShortCut(Get,ShowCmd,%%LinkId)
  Parse "%%IconPath;%%IconIdx",@ShortCut(Get,Icon,%%LinkId,@fsep())
  Info Original Properties@CR()Description: %%Description@cr()Target: %%Target@cr()WorkingDir: %%WorkingDir@cr()Arugments: %%Arguments@cr()IconPath: %%IconPath@cr()IconId: %%IconIdx@cr()Hotkey: %%Hotkey@cr()ShowCmd: %%ShowCmd
  # Begin updating
  ShortCut Set,Target,%%LinkId,c:\myapp2.exe
  # clear the description
  ShortCut Set,Description,%%LinkId,
  # clear the working directory
  ShortCut Set,WorkingDir,%%LinkId,
  # Change the Icon
  ShortCut Set,Icon,%%LinkId,c:\myapp.exe,0
  # Change the Hotkey
  ShortCut Set,HotKey,%%LinkId,Ctrl+Alt+L
  # Change the show command
  ShortCut Set,ShowCmd,%%LinkId,Normal Window
  # Remove the arguments
  ShortCut Set,Arguments,%%LinkId,
  # Save the updates of the current shortcut
  ShortCut Save,%%LinkId
  # Reload the shortcut and read back the changes
  %%LinkId = @ShortCut(Load,C:\test.LNK)
  If %%LinkId
    # Begin Reading
    %%Target = @ShortCut(Get,Target,%%LinkId)
    %%Description = @ShortCut(Get,Description,%%LinkId)
    %%WorkingDir = @ShortCut(Get,WorkingDir,%%LinkId)
    %%Arguments = @ShortCut(Get,Arguments,%%LinkId)
    %%Hotkey = @ShortCut(Get,HotKey,%%LinkId)
    %%ShowCmd = @ShortCut(Get,ShowCmd,%%LinkId)
    Parse "%%IconPath;%%IconIdx",@ShortCut(Get,Icon,%%LinkId,@fsep())
    Info Updated Properties@CR()Description: %%Description@cr()Target: %%Target@cr()WorkingDir: %%WorkingDir@cr()Arugments: %%Arguments@cr()IconPath: %%IconPath@cr()IconId: %%IconIdx@cr()Hotkey: %%Hotkey@cr()ShowCmd: %%ShowCmd
    ShortCut UnLoad,%%LinkId
  Else
    Warn Cannot open shortcut file
  End
Else
  Warn Cannot open shortcut file
End

# Save an existing shortcut file to different file name
# Read and Update properties in an existing shortcut file (*.LNK)
Info Saving c:\test.lnk to c:\test2.lnk
%%LinkId = @ShortCut(Load,C:\test.LNK)
If %%LinkId
  # Begin Reading
  %%Target = @ShortCut(Get,Target,%%LinkId)
  %%Description = @ShortCut(Get,Description,%%LinkId)
  %%WorkingDir = @ShortCut(Get,WorkingDir,%%LinkId)
  %%Arguments = @ShortCut(Get,Arguments,%%LinkId)
  %%Hotkey = @ShortCut(Get,HotKey,%%LinkId)
  %%ShowCmd = @ShortCut(Get,ShowCmd,%%LinkId)
  Parse "%%IconPath;%%IconIdx",@ShortCut(Get,Icon,%%LinkId,@fsep())
  Info test.lnk Properties@CR()Description: %%Description@cr()Target: %%Target@cr()WorkingDir: %%WorkingDir@cr()Arugments: %%Arguments@cr()IconPath: %%IconPath@cr()IconId: %%IconIdx@cr()Hotkey: %%Hotkey@cr()ShowCmd: %%ShowCmd
  # Save the current shortcut to a different file leaving the old shortcut file in place.
  # If you needed to change any property do that before saving to the new shortcut.
  ShortCut Save,%%LinkId,C:\test2.lnk
  # Load the new shortcut file
  %%LinkId = @ShortCut(Load,C:\test2.lnk)
  If %%LinkId
    # Begin Reading
    %%Target = @ShortCut(Get,Target,%%LinkId)
    %%Description = @ShortCut(Get,Description,%%LinkId)
    %%WorkingDir = @ShortCut(Get,WorkingDir,%%LinkId)
    %%Arguments = @ShortCut(Get,Arguments,%%LinkId)
    %%Hotkey = @ShortCut(Get,HotKey,%%LinkId)
    %%ShowCmd = @ShortCut(Get,ShowCmd,%%LinkId)
    Parse "%%IconPath;%%IconIdx",@ShortCut(Get,Icon,%%LinkId,@fsep())
    Info test2.lnk Properties@CR()Description: %%Description@cr()Target: %%Target@cr()WorkingDir: %%WorkingDir@cr()Arugments: %%Arguments@cr()IconPath: %%IconPath@cr()IconId: %%IconIdx@cr()Hotkey: %%Hotkey@cr()ShowCmd: %%ShowCmd
    ShortCut UnLoad,%%LinkId
  Else
    Warn Cannot open shortcut file.
  End
Else
  Warn Cannot open shortcut file.
End
Exit
<!-- This is crazy but now we should be able to see this script in the browser. --></pre><div id="copyright"><p>copyright &copy; DragonSphere Software 2000-2006<br><a href="http://www.dragonsphere.net/terms.html" target="_blank">Terms and Conditions</a></p></div></body></html><!--
:-->
:<!--
  
Exit 
# -->End of demo1
