shortcut

package module
v0.0.0-...-bbbbd4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 1 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go Report Card MIT License

go get

go get github.com/shu-go/shortcut

It is available only in Windows.

Usage

s, _ := shortcut.Open("./myshortcut")
s.TargetPath = "new path"
s.Save()
s, _ := shortcut.New("path to target")
s.WindowStyle = 3 // max
s.Arguments = "a b c"
s.IconLocation = "path to exe, 0"
s.Save()

memo (URL Shortcut)

Not supported.

memo

[InternetShortcut]
URL=https://www.google.com/
HotKey=1601
IconIndex=0
IconFile=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
HotKey

ACS KEY_ CODE
011 0100 0001 Ctrl+Shift+A
011 0100 0010 Ctrl+Shift+B
110 0100 0001 Ctrl+Alt+A

Documentation

Overview

Package shortcut manupulates Windows shortcut file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shortcut

type Shortcut struct {
	// path to be invoked, except arguments.
	TargetPath string

	// optional arguments in a string
	Arguments string

	// optional description of the shortcut
	Description string

	// hotkey to invoke the shortcut.
	// like "Ctrl+Shift+A"
	Hotkey string

	// see https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/windows-scripting/w88k7fw2%28v%3dvs.84%29
	// 1: normal window(size restored), activated
	// 3: max, activated
	// 7: min, deactivated
	WindowStyle int

	// filepath(fullpath),index
	// like "c:/path/to/file,0"
	IconLocation string

	// working directory
	WorkingDirectory string
}

Shortcut contains shortcut properties.

func New

func New(targetPath string) *Shortcut

New returns a simle shortcut with default value.

func Open

func Open(path string) (*Shortcut, error)

Open reads a shortcut file.

func (Shortcut) Save

func (s Shortcut) Save(path string) error

Save saves a shortcut file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址