The WUYING Workspace Plug-in Connection Manager SDK (WYSDK) lets you embed cloud computer and cloud application sessions directly into your Windows application. Your app loads WYSDK.dll, initializes the SDK, and controls the full session lifecycle — connect, monitor status, and disconnect — through a small C API.
Download the sample project: WYSDKDemo.zip
Prerequisites
Before you begin, make sure you have:
A Windows machine with the WUYING Workspace application installed (64-bit)
WYSDK.dllpresent in the WUYING Workspace installation directoryA server-side integration that can log on and obtain a connection ticket — see List of operations by function
Supported features
| Feature | Supported |
|---|---|
| Open a cloud computer | Yes |
| Disconnect from a cloud computer | Yes |
| Open a cloud application | Yes |
| Close a cloud application | Yes |
| Set the display language (Chinese/English) | Yes. Configure after connecting. |
| Set the zoom factor (dots per inch) | Yes. Configure after connecting. |
| Hide DesktopAssistant | Yes. Configure after connecting. |
| Full-screen mode | Yes. Configure after connecting. |
| Query the device UUID | Yes |
| Query the SDK version | Yes |
| Query cloud computer information | Yes |
| Listen for SDK errors | Yes |
| Listen for connection status changes | Yes |
| Trigger the feedback page | Yes |
| Trigger the version update page | Yes |
How it works
All operations use one of three core functions exported from WYSDK.dll:
WYSyncRequest— synchronous call; blocks until complete and returns aWYResponseWYAsyncRequest— asynchronous call; returns immediately and invokes a callbackWYFreeResponse— releases the memory allocated for aWYResponse
Each operation is identified by a string key. Pass the key and a JSON parameter string to WYSyncRequest or WYAsyncRequest. After processing the response, call WYFreeResponse to release its memory.
The required call sequence is:
Load
WYSDK.dlland resolve the three function pointersInitialize the SDK (
WYInitialize)Run the SDK (
WYRun)Register listeners as needed (
WYRegisterListener)Connect to cloud computers or applications (
WYCreateConnect)Disconnect (
WYDisconnect) and deregister listeners (WYUnregisterListener)Destroy the SDK (
WYUninitialize)
Load WYSDK.dll
Find the installation path
Read the InstallLocation value from the WUYING Workspace uninstall registry key to get the installation directory:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D19D277C-E465-4F61-A725-231B7DB9255D}_is1The following function reads this value and appends \bin to form the directory containing WYSDK.dll:
std::string getDicOfSDK() {
HKEY hkey = nullptr;
std::string sub_key = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{D19D277C-E465-4F61-A725-231B7DB9255D}_is1";
LSTATUS res = ::RegOpenKeyExA(HKEY_LOCAL_MACHINE, sub_key.c_str(), 0, KEY_READ, &hkey);
if (res != ERROR_SUCCESS) {
printf("RegOpenKeyExA status:%d failed: %d\n", res, GetLastError());
return "";
}
std::string valueName = std::string("InstallLocation");
DWORD dwType = REG_SZ;
DWORD dwSize = 0;
LSTATUS ret = RegQueryValueExA(hkey, valueName.c_str(), NULL, &dwType, nullptr, &dwSize);
if (ret != ERROR_SUCCESS || dwSize <= 0) {
printf("RegQueryValueExA status:%d size:%d valueName:%s failed: %d\n", ret, dwSize, valueName.c_str(), GetLastError());
RegCloseKey(hkey);
return "";
}
std::vector<BYTE> value_data(dwSize);
ret = RegQueryValueExA(hkey, valueName.c_str(), NULL, &dwType, value_data.data(), &dwSize);
if (ret != ERROR_SUCCESS) {
printf("RegQueryValueExA status:%d valueName:%s failed: %d\n", ret, valueName.c_str(), GetLastError());
RegCloseKey(hkey);
return "";
}
RegCloseKey(hkey);
std::string path(value_data.begin(), value_data.end());
if (path.back() == '\0') {
path.pop_back();
}
path.append(std::string("bin"));
printf("RegQueryValueExA11 valueName:%s res: %s\n", valueName.c_str(), path.c_str());
return path;
}Resolve function pointers
Load WYSDK.dll with LoadLibrary and resolve the three exported functions:
// The DLL lifecycle matches your process lifecycle — do not unload it early.
HMODULE hModule = LoadLibrary(L"WYSDK.dll");
if (hModule == NULL) {
std::cout << "Failed to load DLL: " << GetLastError() << std::endl;
return 1;
}
SyncRequest = (WYSyncRequest)GetProcAddress(hModule, "WYSyncRequest");
AsyncRequest = (WYAsyncRequest)GetProcAddress(hModule, "WYAsyncRequest");
FreeResponse = (WYFreeResponse)GetProcAddress(hModule, "WYFreeResponse");
if (!SyncRequest || !AsyncRequest || !FreeResponse) {
printf("Failed to resolve functions\n");
return 1;
}The type definitions for these functions are:
struct WYResponse {
int code; // 0 = success; any other value = failure
const char* content; // response payload
const char* requestKey; // echoes back the key you passed in
const char* requestParams; // echoes back the params you passed in
};
typedef WYResponse (*WYSyncRequest)(const char* key, const char* params);
typedef void (*WYAsyncRequest)(const char* key, const char* params, void (*callback)(WYResponse));
typedef void (*WYFreeResponse)(WYResponse& response);API reference
Core functions
WYSyncRequest
Executes a request synchronously and returns the result.
Signature
WYResponse WYSyncRequest(const char* key, const char* params);Parameters
| Parameter | Direction | Type | Description |
|---|---|---|---|
key | [in] | const char* | The operation key (for example, "WYInitialize") |
params | [in] | const char* | JSON-encoded parameters, or NULL if none |
Return value
A WYResponse struct. code == 0 means success; any other value means failure. Call WYFreeResponse to release the response after use.
WYAsyncRequest
Executes a request asynchronously and invokes the callback when complete.
Signature
void WYAsyncRequest(const char* key, const char* params, void (*callback)(WYResponse));Parameters
| Parameter | Direction | Type | Description |
|---|---|---|---|
key | [in] | const char* | The operation key |
params | [in] | const char* | JSON-encoded parameters, or NULL if none |
callback | [in] | function pointer | Invoked when the operation completes or when a registered listener fires |
Remarks
WYAsyncRequest supports all keys that WYSyncRequest supports. Use it for listener registration so the callback receives events without blocking your thread.
WYFreeResponse
Releases the memory allocated for a WYResponse.
Signature
void WYFreeResponse(WYResponse& response);Parameters
| Parameter | Direction | Type | Description |
|---|---|---|---|
response | [in/out] | WYResponse& | The response object to release |
Remarks
Call this after every WYSyncRequest call and after processing each response in an async callback.
SDK lifecycle operations
Initialize the SDK — WYInitialize
Call time: Before any other SDK operations.
Parameters (JSON)
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
partnerInfo.partner | String | Yes | Your company name | "Acme Corp" |
partnerInfo.partnerApp | String | Yes | Your application name | "AcmeDesktop" |
launcherPath | String | Yes | Absolute path to stream_launcher.exe | "C:\\Program Files\\...\\bin\\stream_launcher.exe" |
Example
std::string directory = getDicOfSDK();
std::string config = "{\"partnerInfo\":{\"partner\":\"<your-company>\",\"partnerApp\":\"<your-app>\"}, \"launcherPath\":\"";
config.append(directory);
config.append("\\stream_launcher.exe\"}");
WYResponse value = SyncRequest("WYInitialize", config.c_str());
FreeResponse(value);
// value.code == 0 means initialization succeededRun the SDK — WYRun
Call time: After WYInitialize, before connecting to any cloud resource.
Parameters: None
Example
WYResponse value = SyncRequest("WYRun", NULL);
int runCode = value.code;
FreeResponse(value);
// runCode == 0 means the SDK is runningDestroy the SDK — WYUninitialize
Call time: When shutting down; after disconnecting all sessions and deregistering all listeners.
Parameters: None
Example
WYResponse value = SyncRequest("WYUninitialize", NULL);
FreeResponse(value);Connection operations
Connect to a cloud computer or application — WYCreateConnect
Call time: After WYRun.
Parameters (JSON)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
operation | String | Yes | "openDesktop" to open a cloud computer; "openApp" to open a cloud application | "openDesktop" |
bizParam.ticket | String | Yes | Connection ticket from GetConnectionTicket | |
bizParam.desktopId | String | Yes | The cloud computer ID, returned by GetConnectionTicket | "ecd-7nvbz4ccjly95xxxx" |
bizParam.desktopName | String | Yes | The cloud computer display name, returned by GetConnectionTicket | "Alice's cloud computer" |
bizParam.osType | String | Yes | The operating system type, returned by GetConnectionTicket | "windows" |
partnerInfo.partner | String | Yes | Your company name | "Acme Corp" |
partnerInfo.partnerApp | String | Yes | Your application name | "AcmeDesktop" |
extInfo.language | String | No | Display language. Default: Chinese. | "zh" (Chinese), "en" (English) |
extInfo.cloudDpi | int | No | Default dots per inch (DPI) scaling percentage on startup. Windows cloud computers only. Integer from 100 to 200 (for example, 150 = 150%). | 150 |
extInfo.fullscreen | bool | No | Open the session in a full-screen window. | true |
extInfo.isVpc | bool | No | Route the connection through a virtual private cloud (VPC). | false |
extInfo.hideFloatingBall | bool | No | Hide DesktopAssistant in the session window. | false |
proxy.type | String | No | Proxy type. Valid values: "system", "socket", "HTTP". | "system" |
proxy.host | String | No | The proxy host address. | "127.0.0.1" |
proxy.port | int | No | The proxy port. | 50550 |
proxy.account | String | No | The proxy account. | |
proxy.password | String | No | The proxy password. |
Example — open a cloud computer
{
"operation": "openDesktop",
"bizParam": {
"ticket": "<connection-ticket>",
"desktopId": "ecd-7nvbz4ccjly95xxxx",
"desktopName": "Alice's cloud computer",
"osType": "windows"
},
"partnerInfo": {
"partner": "<your-company>",
"partnerApp": "<your-app>"
},
"extInfo": {
"language": "zh",
"cloudDpi": 150,
"fullscreen": true,
"isVpc": true,
"hideFloatingBall": true,
"proxy": {
"type": "system",
"host": "127.x.x.x",
"port": 50550,
"account": "",
"password": ""
}
}
}WYResponse value = SyncRequest("WYCreateConnect", connectParams.c_str());
FreeResponse(value);Example — open a cloud application
std::string params = "{\"operation\":\"openApp\","
"\"bizParam\":{\"ticket\":\"<ticket>\","
"\"appInstanceGroupId\":\"<group-id>\","
"\"appName\":\"<app-name>\","
"\"osType\":\"Windows\"}}";
WYResponse value = SyncRequest("WYCreateConnect", params.c_str());
FreeResponse(value);Disconnect — WYDisconnect
Call time: After the session is established, when you want to close it.
Parameters (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
connectId | String | Yes | The ID of the cloud computer or application to disconnect |
Example
std::string params = "{\"connectId\":\"<desktop-id>\"}";
WYResponse value = SyncRequest("WYDisconnect", params.c_str());
FreeResponse(value);Listener operations
Register a listener — WYRegisterListener
Call time: After WYRun.
Register callbacks to receive SDK logs, errors, and connection status events.
| Tag | Trigger | Key fields in WYResponse |
|---|---|---|
onOutputLog | SDK log line emitted | content — the log message |
onErrorCode | SDK error occurred | code — the error code; requestParams — the listener tag |
onStatusChange | Connection status changed | content — status details |
Example — listen for log output
AsyncRequest("WYRegisterListener", "{\"tag\": \"onOutputLog\"}", [](WYResponse value) {
printf("%s\n", value.content);
});Example — listen for errors
AsyncRequest("WYRegisterListener", "{\"tag\": \"onErrorCode\"}", [](WYResponse value) {
int code = value.code;
if (code == 200 || code == 201 || code == 202) {
// The communication service has failed. Stop the process and restart it.
// Alternatively, you can uninstall the SDK and reload it, but reloading WYSDK.dll
// without restarting the process leaves static residuals.
}
printf("Error callback tag %s code %d\n", value.requestParams, code);
});Example — listen for connection status changes
// Register before calling WYCreateConnect for the same connectId.
std::string params = "{\"tag\": \"onStatusChange\", \"connectId\":\"<desktop-id>\"}";
AsyncRequest("WYRegisterListener", params.c_str(), [](WYResponse value) {
printf("Status changed: %s\n", value.content);
});Deregister a listener — WYUnregisterListener
Use the same tag and connectId you passed to WYRegisterListener.
Example
std::string params = "{\"tag\": \"onStatusChange\", \"connectId\":\"<desktop-id>\"}";
WYResponse value = SyncRequest("WYUnregisterListener", params.c_str());
FreeResponse(value);To deregister the log and error listeners (no connectId required):
WYResponse unLog = SyncRequest("WYUnregisterListener", "{\"tag\": \"onOutputLog\"}");
FreeResponse(unLog);
WYResponse unError = SyncRequest("WYUnregisterListener", "{\"tag\": \"onErrorCode\"}");
FreeResponse(unError);Query operations
Query cloud computer information — enumConnections
Returns a JSON array describing all active cloud computer and application connections.
WYResponse value = SyncRequest("enumConnections", NULL);
printf("Connections: %s\n", value.content);
FreeResponse(value);Response format
{
"connection": "<connect-id>",
"connectionPid": 27324,
"partner": "<your-company>",
"partnerApp": "<your-app>",
"processId": 8696,
"status": "start"
}status is either "start" (session active) or "exit" (session ended). connectionPid is the PID of the cloud computer process.
Get the device UUID — uuid
WYResponse value = SyncRequest("uuid", NULL);
printf("UUID: %s\n", value.content);
FreeResponse(value);Get the SDK version — sdkVersion
WYResponse value = SyncRequest("sdkVersion", NULL);
printf("Version: %s\n", value.content);
FreeResponse(value);UI trigger operations
Open the feedback page — feedback
WYResponse value = SyncRequest("feedback", NULL);
FreeResponse(value);Open the version update page — upgrade
WYResponse value = SyncRequest("upgrade", NULL);
FreeResponse(value);Error codes
| Code | Description | Action |
|---|---|---|
| 1 | SDK initialization failed | Check the WYInitialize configuration |
| 2 | Partner information not found in SDK configuration | Verify partnerInfo.partner and partnerInfo.partnerApp |
| 100 | Launcher failed to start | Check that launcherPath points to a valid stream_launcher.exe |
| 101 | Launcher initialization failed | Reinstall the WUYING Workspace application |
| 200 | Communication service query failed | Stop the process and restart it, or uninstall the SDK and reload it. Note: reloading WYSDK.dll in-process leaves static residuals. |
| 201 | Communication service interrupted | Stop the process and restart it, or uninstall the SDK and reload it. Note: reloading WYSDK.dll in-process leaves static residuals. |
| 202 | Communication service creation failed | Stop the process and restart it, or uninstall the SDK and reload it. Note: reloading WYSDK.dll in-process leaves static residuals. |
| 300 | Invalid connection parameters | Check that all required WYCreateConnect parameters are present and correctly formatted |
| 301 | Connection to cloud computer or application failed | Verify the ticket is valid and the server is reachable |
What's next
List of operations by function — server-side API reference for obtaining connection tickets
GetConnectionTicket — retrieve the ticket and desktop parameters required by
WYCreateConnect