Enterprise organizations frequently rely on highly customized, legacy Win32 “thick client” applications (such as aging ERP systems or bespoke AS/400 terminal emulators). These systems were developed decades before the standardization of RESTful APIs or modern webhooks. Consequently, attempting to integrate these legacy applications into modern, cloud-based data pipelines is a logistical nightmare. When backend API integration is impossible, systems engineers must rely on Robotic Process Automation (RPA). Microsoft Power Automate Desktop provides a robust RPA engine, allowing developers to construct UI flows that programmatically control the mouse, scrape data from legacy Win32 windows, and bridge the gap between archaic software and modern cloud architecture.
The Mechanics of Robotic Process Automation
Unlike standard Power Automate (which executes purely in the Azure cloud by chaining together APIs), Power Automate Desktop runs a local agent directly on a Windows Server or Windows 10/11 workstation.
Instead of sending JSON payloads to an endpoint, the Desktop agent interacts with the Windows operating system at the GUI level. It hooks into the Windows UI Automation (UIA) API to identify specific buttons, text boxes, and data grids within legacy applications. It can simulate keystrokes, execute mouse clicks, parse the text rendered on the screen, and extract that data into structured variables for subsequent processing.
Building the Desktop Flow
To orchestrate an RPA sequence, you must install the Power Automate Desktop application on a machine that has the legacy Win32 software installed.
- Launch Power Automate Desktop and create a new Flow named “Legacy ERP Scraper”.
- The Flow Designer relies on a drag-and-drop interface of “Actions.” The first required action is Run application. You provide the absolute path to the legacy executable (e.g.,
C:\ERP\legacy_client.exe). - Once the application launches, the script must wait for the UI to render. Drag the Wait for window action into the flow. Use the built-in UI element picker to select the main window of the legacy app. The flow will pause execution until this specific window handle is detected by the OS.
Interacting with the Win32 Interface
With the application open, the flow must navigate to the correct data screen. Do not rely on coordinate-based mouse clicks (X/Y axis), as these will break if the window is resized or moved. Instead, rely on UI Automation elements.
- Use the Populate text field in window action. Click “Add UI element” and hover over the Search box in the legacy application. The UI picker will outline the text box in red, capturing its unique internal control ID. Instruct the flow to input a specific customer ID into this box.
- Use the Press button in window action, utilizing the UI picker to target the “Search” button.
Extracting the Data
Once the legacy application retrieves the customer record, you must scrape the data from the screen.
- Drag the Get details of a UI element in window action into the designer.
- Use the UI picker to target the specific text label displaying the customer’s account balance.
- Power Automate will read the text value currently rendered inside that Win32 control and assign it to a local flow variable (e.g.,
%AccountBalance%).
Bridging Desktop RPA with Cloud Automation
The true power of this architecture lies in combining the Desktop flow with a Cloud flow. Data scraped from a local Win32 application is useless if it remains trapped on that workstation.
In the Power Automate Cloud web portal, create an automated Cloud flow triggered by a webhook or a schedule. Add the Run a flow built with Power Automate for desktop action.
You can configure the Cloud flow to pass an input variable (the Customer ID) down to the Desktop agent. The Desktop agent launches the legacy app, performs the UI scraping, and passes the %AccountBalance% back up to the Cloud flow as an output variable. The Cloud flow can then instantly inject that legacy data into a modern SharePoint list, a Dynamics 365 dashboard, or an Azure SQL database. This architecture effectively provides a modern, automated API layer over software that was never designed for the internet era.