WndRules is a special registry value that instructs Cameyo how to initialize sessions and/or modify initial app window styles. WndRules can be defined either as a registry value, or using a PowerTag named !WndRules. This document describes the registry mode, but the same can be accomplished using the PowerTag.
WndRules server-side registry value
- On the Cameyo Play server open Regedit, then go to HKLM\Software\Cameyo\[AppName], where [AppName] is either the application's name as defined in the portal, or "PlayServer" to indicate all applications on that server.
- Create a new string value called WndRules, with data being the rules you want the app to follow.
The registry key takes a JSON-syntax set of app Window rules. The string can either be a one-line or multiple-line string.
Example (multi-line string):
{ "rules": [ { "title": "~pacific", "ops": [ "StyleRemove:caption", "Resize:max", "Session:start" ], "once": "true" } ] }
Or (single-line string):
{ "rules": [ { "title": "~pacific", "ops": [ "StyleRemove:caption", "Resize:max", "Session:start" ], "once": "true" } ] }
Rules
"rules": one or several rules containing the following fields:
- "title": the exact title of the window, case insensitive. If starting with "~", means: any window title containing this string. For example "title=pacific" will match windows having the title "Pacific", but not "Pacific Ocean". Whereas "title=~ocean" will match the latter example.
- "class": instead of "title". Identifies the window by class name, when title identification is not possible or not wished. To determine a window's class name, we suggest using Window Detective.
- "ops": a set of actions to perform on such windows:
- "Resize":
- "max": maximizes the window.
- "StyleRemove": removes one of the following window's items:
- "visible": hides the window.
- "caption": removes the window's caption bar.
- "sys": removes the window's system menu (the Window's minimize / maximize / close menu).
- "MoveXY":
- "center": centers the window (only if not maximized).
- "Session":
- "start": starts the session, hiding the "Connecting..." splash screen.
- "Resize":
- "once":
- "true": executes this rule just once. This avoids checking for the window condition in a loop, hence reducing CPU usage. Use this whenever possible.
- "false": keeps looking for the above conditions infinitely, even when the rule was already applied once. This is only useful in cases where the same condition should be watched for over and over again (uncommon).
Note: not all commands are documented here. Some less frequent commands are kept undocumented awaiting use-case validation.
Example 1
HKLM\SOFTWARE\Cameyo\MyApp\WndRules:
{ "rules": [ { "title": "~pacific", "ops": [ "Resize:max" ], "once": "true" } ] }
Result: as soon as a window with the word "pacific" (case-insensitive) in its title appears, it will get maximized.
Example 2
HKLM\SOFTWARE\Cameyo\MyApp\WndRules:
{ "rules": [ { "title": "pacific ocean", "ops": [ "StyleRemove:caption", "Resize:max", "Session:start" ], "once": "true" } ] }
Result: as soon as a window titled "Pacific ocean" (case-insensitive) appears, it gets maximized, its title bar removed, and the session gets started (Cameyo's "Connecting..." screen removed).
The rule only performs once.