Windows
An API set for displaying docking windows and message boxes.
// Retrives the API instance.
IRCXWindowAPI? api = Main.GetAPI<IRCXWindowAPI>();
// Show message box.
var response = api?.ShowMessageBox(
new RCXCaption(Main.CommonId, Caption.ExtensionName),
new RCXCaption("Are you OK?"),
IRCXWindowAPI.ButtonType.Yes_No,
IRCXWindowAPI.IconType.Question
);
if (response == IRCXWindowAPI.ResponseType.OK)
{
// Process when the response is OK.
}
There is also an API for docking windows that host WPF WebView2 controls.
- The following URIs can be handled.
- External (Internet, Intranet) sites
- Static sites located locally on the PC running RC+
- It is also possible to start a dedicated HTTP server to dynamically import JavaScript modules.
- Web applications running locally on the PC running RC+
- You can specify the application startup command (such as node) and parameters.
- When ${port} and ${lang} are specified as parameters, they are replaced with the port number (automatically assigned) and the display language name, respectively.
- You can specify the application startup command (such as node) and parameters.
- Features can be implemented using web technologies such as HTML, CSS, and JavaScript.
- Script execution when closing a window or saving content
- Editing content
- Acquire a selected string and transfer it to the clipboard
- Sending messages corresponding to the edit menu ("RCX.Clear", "RCX.Paste", "RCX.SelectAll", "RCX.Undo", "RCX.Redo")
- Sending a message ("RCX.ShowHelp") corresponding to displaying help by pressing the F10 key
- Once a host object has been created, you can interact with it from C#.
- You can also use the built-in host object chrome.webview.hostObjects.BuiltinBridge, which implements the following functions.
- string GetCaption(int number): Acquires the caption string for the specified number.
- string ReadConfiguration(bool global): Reads the extension's configuration data as a Base64 encoded string.
- string WriteConfiguration(bool global): Writes the extension configuration data provided as a Base64 encoded string.
- If the global flag is true, the configuration data is common to all logged-in Windows users; if it is false, it applies to the logged-in user.
- You can also use the built-in host object chrome.webview.hostObjects.BuiltinBridge, which implements the following functions.
// Retrives the API instance.
IRCXWindowAPI? api = Main.GetAPI<IRCXWindowAPI>();
if (api != null)
{
// Show "Epson Global Portal" site in a docking window
var webVewInfo = new IRCXWindowAPI.WebViewInfo(
(_, _, _) => new Uri("https://epson.com/"),
Id,
$"{Id}.External",
new RCXCaption(CommonId, Caption.WindowTitle_External),
Main.CommonIcon
);
await api.ShowDockingWebViewWindowAsync(webViewInfo).ConfigureAwait(true);
}