Hide maya output window (maya Console win) automatically

maya

#1

Maya output window is a “small annoying things”, most maya user i knew think it is a “noise”

these scripts can hide maya output window automatically
it works for NT(windows) Platform maya

installation :download Hide_Maya_Output_Window_for_WinNT_V.zip file,unzip to a folder *(avoid the folder path contain non-English characters) drag and drop file “maya_script_drag_drop_install.mel” to maya 3d modelPanel for installation,
restart maya

Uninstallation :
open file “userSetup.mel” which is in C:\Users[user name]\Documents\maya[maya version]\scriptsfind line “catch(python(“import hide_maya_output_win”));” and delete the line, save the file
delete file “hide_maya_output_win.py(.pyc)” which is in C:\Users[user name]\Documents\maya[maya version]\scripts
restart maya

download link:
Hide_Maya_Output_Window_for_WinNT_V.zip (2.34 KB)


# -*- coding:utf-8 -*-
import  ctypes
def hid_mya_opt_wnd():
    buf_win_lst = []
    top_win = ctypes.windll.user32.GetTopWindow(0)
    if not top_win:    return 0
    buf_win_lst.append(top_win)
    buf_clas_nm = ctypes.create_unicode_buffer(1024)
    while 1:
        nxt_win = ctypes.windll.user32.GetWindow(buf_win_lst[-1], 2)
        ctypes.windll.user32.GetClassNameW(nxt_win, buf_clas_nm, 1024)
        if buf_clas_nm.value.startswith('mayaConsole'):
            ctypes.windll.user32.ShowWindow(nxt_win, 1)
            ctypes.windll.user32.ShowWindow(nxt_win, 0)
            ctypes.windll.user32.SetWindowLongPtrW(nxt_win, -20, 0x00000080)
            ctypes.windll.user32.ShowWindow(nxt_win, 8)
            ctypes.windll.user32.MoveWindow(nxt_win, 0, 0, 180, 10, 1)
            return 1
        if not nxt_win: break
        buf_win_lst.append(nxt_win)
    return 0
try : hid_mya_opt_wnd()
except : print 'not NT platform, skip !'


#2

or add -hideConsole to the shortcut