mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-09 21:17:47 +08:00
28 lines
719 B
Python
28 lines
719 B
Python
#! /usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
#
|
|
# This file is part of npbackup
|
|
|
|
__intname__ = "npbackup.gui.window_reducer"
|
|
__author__ = "Orsiris de Jong"
|
|
__copyright__ = "Copyright (C) 2022-2023 NetInvent"
|
|
__license__ = "GPL-3.0-only"
|
|
__build__ = "2023020501"
|
|
|
|
|
|
import sys
|
|
import os
|
|
import win32gui
|
|
import win32con
|
|
|
|
|
|
def minimize_current_window():
|
|
"""
|
|
Minimizes current commandline window in GUI mode
|
|
"""
|
|
if os.name == "nt":
|
|
current_executable = os.path.abspath(sys.argv[0])
|
|
# console window will have the name of current executable
|
|
hwndMain = win32gui.FindWindow(None, current_executable)
|
|
if hwndMain:
|
|
win32gui.ShowWindow(hwndMain, win32con.SW_MINIMIZE)
|