Skip to content

Commit f11d01e

Browse files
committed
update window examples code
1 parent aa077ec commit f11d01e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

examples/window/main.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ func findIds() {
7777
}
7878
}
7979

80+
func active() {
81+
robotgo.ActivePID(100)
82+
// robotgo.Sleep(2)
83+
robotgo.ActiveName("code")
84+
robotgo.Sleep(1)
85+
robotgo.ActiveName("chrome")
86+
}
87+
8088
func findName() {
8189
// find the process name by the process id
8290
name, err := robotgo.FindName(100)
@@ -124,15 +132,14 @@ func window() {
124132
////////////////////////////////////////////////////////////////////////////////
125133

126134
alert()
127-
135+
//
128136
get()
129137

130138
findIds()
131-
132-
robotgo.ActiveName("chrome")
139+
active()
133140

134141
findName()
135-
142+
//
136143
ps()
137144

138145
// close current Window

0 commit comments

Comments
 (0)