Created
May 20, 2019 01:44
-
-
Save Ronkiro/4a36b5daa1e3f355dcf62f21d28b5e7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
kernel32 = ctypes.WinDLL('kernel32') | |
user32 = ctypes.WinDLL('user32') | |
SW_HIDE = 0 | |
hWnd = kernel32.GetConsoleWindow() | |
if hWnd: | |
user32.ShowWindow(hWnd, SW_HIDE) | |
#STD | |
def closeEvent(self, event): | |
try: | |
user32.ShowWindow(hWnd, 1) | |
except: | |
pass | |
# Vê necessidade de iniciar com console ou sem. | |
import ctypes | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-C', '--console', action = 'store_true', required = False) | |
arguments = parser.parse_args() | |
HIDE_CONSOLE_BOOL = not(arguments.console) | |
if HIDE_CONSOLE_BOOL: | |
kernel32 = ctypes.WinDLL('kernel32') | |
user32 = ctypes.WinDLL('user32') | |
SW_HIDE = 0 | |
hWnd = kernel32.GetConsoleWindow() | |
if hWnd: | |
user32.ShowWindow(hWnd, SW_HIDE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment