-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshellexecute.go
53 lines (48 loc) · 1.08 KB
/
shellexecute.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package su
const (
// EDIT is the action "edit" for ShellExecute
EDIT = "edit"
// EXPLORE is the action "explore" for ShellExecute
EXPLORE = "explore"
// OPEN is the action "open" for ShellExecute
OPEN = "open"
// PRINT is the action "print" for ShellExecute
PRINT = "print"
// PROPERTIES is the action "properties" for ShellExecute
PROPERTIES = "properties"
// RUNAS is the action "runas" for ShellExecute
RUNAS = "runas"
)
const (
HIDE = 0
SHOWNORMAL = 1
SHOWMINIMIZED = 2
MAXIMIZE = 3
SHOWNOACTIVATE = 4
SHOW = 5
MINIMIZE = 6
SHOWMINNOACTIVE = 7
SHOWNA = 8
RESTORE = 9
SHOWDEFAULT = 10
FORCEMINIMIZE = 11
)
type Param struct {
Action string
Path string
Param string
Directory string
Show int
}
func (i Param) ShellExecute() (int, error) {
return i.shellExecute()
}
func ShellExecute(action, path, param, directory string) (int, error) {
return Param{
Action: action,
Path: path,
Param: param,
Directory: directory,
Show: SHOWNORMAL,
}.shellExecute()
}