-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathps_switch_to.Rd
More file actions
50 lines (48 loc) · 1.6 KB
/
ps_switch_to.Rd
File metadata and controls
50 lines (48 loc) · 1.6 KB
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/windows.R
\name{ps_switch_to}
\alias{ps_switch_to}
\title{Send an alert to the window of a process}
\usage{
ps_switch_to(p = ps_handle(), ancestors = TRUE)
}
\arguments{
\item{p}{Process handle.}
\item{ancestors}{Logical flag. Whether to try to alert the
closest ancestor in the process tree, if the specified process
does not have an associated window. It uses \code{\link[=ps_descent]{ps_descent()}} to
look up the ancestors.}
}
\value{
A named list:
\itemize{
\item \code{proc}: a process handle. This is the handle that ps tried to
alert. It might that same as \code{p} or an ancestor, if
\code{ancestors = TRUE} was specified. This is \code{NULL} if ps did
not find any process with an associated Window to alert.
\item \code{success}: whether the Windows API call returned success.
If this is \code{TRUE} that typically means that the alerted
window is the active one. If it is \code{FALSE}, then the alert was
probably still sent, and the user will see it on the status bar
(in Windows 10).
}
}
\description{
This function currently only works on Windows and errors on
other platforms.
}
\details{
R processes might not have an associated window, e.g. if they are
running in a terminal, or in RStudio. In RGui they do.
}
\examples{
\dontrun{
# This usually does nothing interactively, since the current
# (RStudio, RGui, Windows Terminal, etc.) window is on top.
ps_switch_to()
# Try switching to another window, while the sleep is running,
# and then you'll see an alert for the current
# (RStudio, RGui, etc.) window
Sys.sleep(4); ps_switch_to()
}
}