IMDTouchKnowledge BaseShop main store

Explainer

Why an HMI button cannot minimize or close Edge on Unified PC runtime

HMI and touchscreens Published 5 min read By IMDTouch engineering team

Short answer

A WinCC Unified PC runtime screen is web content inside Edge, so browser security keeps a page button away from Windows window management. The working fix pairs a custom web control with a small local launcher or agent that owns the Edge window and accepts only minimize and close-client commands.

On this page
  1. Why can't the button reach the Edge window at all?
  2. What do the keyboard shortcuts tell you about the problem?
  3. Which layer does each requested action belong to?
  4. Why can't StartProgram simply be reused?
  5. What should the native component look like?
  6. How do you wire the two buttons in the screen?
  7. How do you verify the result before commissioning?
  8. Questions asked

A WinCC Unified PC runtime screen shown in Edge is a web page, and a web page cannot minimize or close a native Windows window it does not own. The StartProgram-style button that worked in WinCC Advanced does not transfer, because the execution model changed from a native HMI to browser content. The reliable answer is a custom web control (CWC) paired with a small local launcher or companion agent that owns the Edge window and accepts only two commands: minimize and close-client.

Why can't the button reach the Edge window at all? #

JavaScript inside the WinCC Unified page runs inside the browser security boundary, which blocks it from managing native windows, ending processes or starting unrestricted local programs. That is a browser rule, not a WinCC limitation you can configure away. Script in a page may close only a window the script itself created, and your desktop-shortcut Edge window has no such relationship to the page, so a page-level close request fails or is refused depending on the browser. Leaving full-screen presentation is a third thing again: it changes how the page is shown, not whether Windows minimizes the window.

What do the keyboard shortcuts tell you about the problem? #

The Windows key and Alt+Space+N both work because they ask Windows itself to act on the active native window, outside the HMI page. That proves Windows sees a normal top-level window you can target with a native controller. Before building anything, record how the shortcut launches Edge, whether a title bar exists, and confirm Alt+Space+N minimizes it; if it does, the window-management route is open.

Which layer does each requested action belong to? #

Each action the operator wants lives at a different layer, and mixing them is what makes the simple button fail. Name each one before you write code:

Requested action Where control lives Result
Open another HMI screen WinCC Unified project The Edge window stays open
Leave full-screen presentation Browser full-screen function Window stays open, not minimized
Minimize Edge Windows window manager Native window leaves the foreground
Close Edge Browser or a native controller The client window ends
Stop the runtime Runtime administration Backend stops; different from closing its client

Why can't StartProgram simply be reused? #

StartProgram belongs to the native WinCC Advanced execution model and is not available to Unified web content. Unified places the screen in a browser, so the replacement needs an explicit bridge between the button and a narrowly scoped native component. Custom web controls are the supported container for that bridge: they run on the web client, are hosted in the runtime, and can exchange data with the host screen, as the Unified custom web control documentation describes; Siemens also publishes a worked example of integrating a custom web control into WinCC Unified?lc=en-pt), and the open UnifiedScreenControl reference control shows the same mechanism. What a CWC does not grant is Windows process control; that part must be a separate native component you deploy and secure yourself.

What should the native component look like? #

Build one small launcher or local agent with three jobs: start Edge with the runtime URL, keep a reliable association with the exact native window it created, and accept an allowlist of commands containing only minimize and close-client. Bind its local communication endpoint to the local machine, validate command names, reject extra arguments, file paths or shell commands, and return an acknowledgement the CWC can display or log. Never expose arbitrary executable paths or command lines to the HMI.

Target the managed window, not every Edge process. Edge runs multiple processes for one visible window, as Microsoft's own answers on excessive Edge processes in Task Manager confirm, and other applications on the station may also use Edge, so killing by process name closes unrelated sessions and loses unsaved browser data.

If the shortcut itself should control presentation, Microsoft documents Edge kiosk mode command-line options for exactly that; use them in the launcher so development and commissioning share one launch mode.

How do you wire the two buttons in the screen? #

Put the two buttons in a custom web control, map Minimize to the minimize command and Close to close-client, and disable repeated activation while a request is pending. Give each button a failure indication when no acknowledgement returns. Keep the labels honest: one says Minimize, one says Close; neither says Exit Full Screen, because that is a different action at a different layer.

How do you verify the result before commissioning? #

Run six checks on the commissioned station: the launcher opens one managed Edge client in the configured presentation; the minimize command removes that window from the foreground without starting a second instance; restoring it returns the same HMI session and current screen state; close ends only the targeted client, with the runtime backend checked separately since it may stay active by design; the approved shortcut or launcher creates exactly one new client on restart; and unknown commands, added arguments or requests from outside the approved interface are rejected without touching another Edge window.

Finally, keep a service path: commissioning and maintenance staff still need an approved way back to Windows if the web control, session or runtime screen becomes unavailable. When the station itself is due for replacement rather than the software, an industrial panel PC is the hardware that hosts this PC-based HMI setup. Related runtime behavior, such as why StartProgram runs a program but shows no window on Unified, follows from this same execution-model change.

Questions asked

Does closing Edge stop the WinCC Unified runtime?

Not necessarily. Closing the client window ends the browser session; the runtime backend on the PC is a separate component and normally keeps running. If the operator should also stop the runtime, make that a third, separate command in the local agent instead of bundling it into close.

Can I use Edge kiosk mode for this?

Edge kiosk mode is configured with Windows command-line options documented by Microsoft and controls how the browser window presents its URL. It shapes the launch, not the HMI button. You still need a native component that owns the window the shortcut or launcher created.

Why can't the button just run a script like StartProgram did?

StartProgram belongs to the native WinCC Advanced execution model. Unified content runs under the browser security model, where page code cannot start arbitrary local programs or manage native windows. The equivalent is a controlled native bridge exposed to a custom web control, never a raw program call from the page.

Keep reading

  • Troubleshooting

    Why StartProgram fails to open the keyboard on Unified PC runtime

    A StartProgram keyboard launch that fails with CF_R_CANCELLED and a rejected promise is usually the calling script, not Windows: the method runs asynchronously, so declare the calling script async and await the call. Then test a harmless executable such as notepad.exe through the same call before trying keyboard paths, cmd.exe wrappers or permissions.

    HMI and touchscreens

  • Selection guide

    Where WinCC Unified Runtime Can Run and Remote HMI Options

    The Unified runtime executes only on a PC, a Panel IPC, a Unified Comfort Panel or the MD-34 tablet; a browser or Sm@rtServer VNC client displays it and never replaces the host. With no PC in the cabinet, a Unified Comfort Panel is the host and the tablet browser is the client. If a safety function must travel with the operator, no Unified mobile panel exists and the design stays Comfort-based.

    HMI and touchscreens

  • Checklist

    What a spare HMI PC needs before the old runtime PC fails

    Build the spare without a license: install the same runtime version on the same operating system as the working PC, restore the application by the product's documented method rather than a copied folder, and when the old disk fails, recover the license through the vendor's documented process. First confirm whether the runtime is WinCC or InTouch, because the two are not interchangeable. A spare that must run alongside the original needs its own runtime license.

    HMI and touchscreens

Why an invisible HMI button shows a focus edge in runtime