windowMaximize
Category: Application Control
Namespace: web.app.windowMaximize
Description
Maximize the application window to fill the entire screen while keeping the taskbar and window borders visible. This is different from fullscreen mode, which hides all window decorations.
Syntax
await web.app.windowMaximize();
Parameters
None
Returns
Promise<boolean> - Returns true when the window is maximized
Example
Simple example
await web.app.windowMaximize();
Practical example
document.getElementById('maximize-btn').addEventListener('click', async () => {
await web.app.windowMaximize();
});
Advanced example
let isMaximized = false;
async function toggleMaximize() {
if (isMaximized) {
await web.app.windowRestore();
isMaximized = false;
} else {
await web.app.windowMaximize();
isMaximized = true;
}
}
Use Cases
- Create custom window control buttons
- Maximize window on application startup
- Provide maximize button in custom title bar
- Maximize when user double-clicks title bar
- Maximize for better viewing of content
- Implement keyboard shortcuts (F11, Win+Up)
- Maximize when opening large documents
- Restore window size based on user preference
Error Handling
This method does not throw errors. If the window is already maximized, calling this method has no effect.
Performance Tips
- Check window state before maximizing to avoid unnecessary calls
- Use
windowRestore()to return to previous size - Consider saving window state in user preferences
- Combine with
isFullScreen()to manage window modes
Related Methods
web.app.windowMinimize()- Minimize the windowweb.app.windowRestore()- Restore to previous sizeweb.app.enterFullScreen()- Enter fullscreen modeweb.app.isFullScreen()- Check fullscreen status
Notes
- Maximized windows still show taskbar and window borders
- Different from fullscreen mode which hides all decorations
- Window remembers its previous size for restore operation
- Works on all platforms (Windows, macOS, Linux)