system

package
v0.0.0-...-566fc8f Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	SW_HIDE            = 0
	SW_MAXIMIZE        = 3
	SW_MINIMIZE        = 6
	SW_RESTORE         = 9
	SW_SHOW            = 5
	SW_SHOWDEFAULT     = 1
	SW_SHOWMAXIMIZED   = 3
	SW_SHOWMINIMIZED   = 2
	SW_SHOWMINNOACTIVE = 7
	SW_SHOWNA          = 8
	SW_SHOWNOACTIVATE  = 4
	SW_SHOWNORMAL      = 1
)
View Source
const (
	COINIT_APARTMENTTHREADED = 0x2
	COINIT_MULTITHREADED     = 0x0
	COINIT_DISABLE_OLE1DDE   = 0x4
	COINIT_SPEED_OVER_MEMORY = 0x8
)
View Source
const (
	EDIT       = "edit"
	EXPLORE    = "explore"
	OPEN       = "open"
	PRINT      = "print"
	PROPERTIES = "properties"
	RUNAS      = "runas"
)

Variables

This section is empty.

Functions

func MsiGetComponentPath

func MsiGetComponentPath(szProduct *uint16, szComponent *uint16, lpPathBuf *uint16, pcchBuf *int) (ret int, err error)

func MsiGetShortcutTarget

func MsiGetShortcutTarget(szShortcutTarget *uint16, szProductCode *uint16, szFeatureId *uint16, szComponentCode *uint16) (ret int, err error)

func ShellExecute

func ShellExecute(action string, path string, param string, directory string) error

Call ShellExecute-API: edit,explore,open and so on.

Types

type System

type System struct {
	// contains filtered or unexported fields
}

func NewSystem

func NewSystem() *System

func (*System) AppIcon

func (s *System) AppIcon(path string) (image.Image, error)

func (*System) Close

func (s *System) Close()

func (*System) EmbeddedAppIcon

func (s *System) EmbeddedAppIcon(path string) (string, error)

func (*System) OpenFolder

func (s *System) OpenFolder(path string) error
func (s *System) ResolveLink(path string) string
func (s *System) ResolveMSILink(path string) string

ResolveMSILink finds the target for what are called Advertisment Shortcuts. These are special shortcuts installed with windows installer MSI that don't follow the conventions of regular shortcuts. I had to do some funky things with CoInitialize because this code seems to only work with apartment threads, while the rest of the code in here fails with apartment threads.

func (*System) RunProgram

func (s *System) RunProgram(path string, args string, dir string, user string) error

Jump to

Keyboard shortcuts

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