For Programmers: Free Programming Magazines  


Home > Archive > Tcl > July 2005 > shortcuts / icons / program groups on windows?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author shortcuts / icons / program groups on windows?
lister

2005-07-24, 10:09 pm

Is there a TCL package for messing with shortcuts / icons / program
groups on windows?
Pat Thoyts

2005-07-24, 10:09 pm

lister <lister@primetime.com> writes:

>Is there a TCL package for messing with shortcuts / icons / program
>groups on windows?


You can manipulate shortcuts using the WScript.Shell object by using
the tcom package. Here's a demo that creates a shortcut on the
desktop. It's a translation of a MS demo from the MSDN scripting
pages.

package require tcom
set oShell [tcom::ref createobject "WScript.Shell"]
set sDesktop [[$oShell SpecialFolders] Item "Desktop"]
set oShortcut [$oShell CreateShortcut \
[file nativename \
[file join $sDesktop "Tcl Shortcut Demo.lnk"]]]
$oShortcut TargetPath [file nativename [file normalize [info script]]]
$oShortcut WindowStyle 1
$oShortcut Description "Demonstrate shortcut handling with Tcl"
$oShortcut Save


--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
joiosoy@yahoo.com

2005-07-25, 4:25 am

Several options:

http://wiki.tcl.tk/1844

lister

2005-07-25, 5:35 pm

Pat Thoyts wrote:

Thanks Pat!
Not being a windows guy, how would I associate an icon for the
shortcut? Or if you prefer, where would I read about the details
of what this is doing so I can learn that (MSDN scripting pages?)?

>
> You can manipulate shortcuts using the WScript.Shell object by using
> the tcom package. Here's a demo that creates a shortcut on the
> desktop. It's a translation of a MS demo from the MSDN scripting
> pages.
>
> package require tcom
> set oShell [tcom::ref createobject "WScript.Shell"]
> set sDesktop [[$oShell SpecialFolders] Item "Desktop"]
> set oShortcut [$oShell CreateShortcut \
> [file nativename \
> [file join $sDesktop "Tcl Shortcut Demo.lnk"]]]
> $oShortcut TargetPath [file nativename [file normalize [info script]]]
> $oShortcut WindowStyle 1
> $oShortcut Description "Demonstrate shortcut handling with Tcl"
> $oShortcut Save
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com