WebExeBuilder Documentation

windowMinimize

Category: Application Control

Namespace: web.app.windowMinimize

Description

Minimize the application window to the taskbar. The application continues running in the background and can be restored by clicking the taskbar icon.

Syntax

await web.app.windowMinimize();

Parameters

None

Returns

Promise<boolean> - Returns true when the window is minimized

Example

Simple example

await web.app.windowMinimize();

Practical example

document.getElementById('minimize-btn').addEventListener('click', async () => {
    await web.app.windowMinimize();
});

Advanced example

async function minimizeToTray() {
    await web.app.windowMinimize();
    
    // Show notification that app is still running
    await web.system.showNotification({
        title: 'App Minimized',
        message: 'The application is still running in the background',
        icon: 'info'
    });
}

Use Cases

  • Create custom window control buttons
  • Minimize when user clicks minimize button
  • Hide window while background task runs
  • Minimize on application startup (start hidden)
  • Implement keyboard shortcuts (Win+Down)
  • Minimize when closing to system tray
  • Hide window during long operations
  • Minimize when user switches to another app

Error Handling

This method does not throw errors. The window will minimize to the taskbar.

Performance Tips

  • Use minimize instead of close to keep app running
  • Combine with system tray for background operation
  • Consider showing notification when minimizing
  • Use windowRestore() to bring window back
  • web.app.windowMaximize() - Maximize the window
  • web.app.windowRestore() - Restore to previous size
  • web.window.hide() - Hide window completely
  • web.window.show() - Show hidden window

Notes

  • Minimized windows appear in the taskbar
  • Application continues running in background
  • Click taskbar icon to restore window
  • Different from hiding window (which removes from taskbar)