Skip to content Skip to sidebar Skip to footer

Hide Windows Start Orb In Python (3.2)

I am creating a program that will replace the windows start menu in Python. I have managed to find a way to hide the taskbar as shown below but i can't find a way to hide the start

Solution 1:

You can get a handle to the start orb using FindWindow with the class atom for the orb, 0xC017. Then use ShowWindow or SetWindowPos to hide the taskbar and the orb. For example:

import ctypes
from ctypes import wintypes

user32 = ctypes.WinDLL("user32")

SW_HIDE = 0
SW_SHOW = 5

START_ATOM = wintypes.LPCWSTR(0xC017) # i.e. MAKEINTATOM(...)

user32.FindWindowW.restype = wintypes.HWND
user32.FindWindowW.argtypes = (
    wintypes.LPCWSTR, # lpClassName
    wintypes.LPCWSTR) # lpWindowName

user32.ShowWindow.argtypes = (
    wintypes.HWND, # hWnd
    ctypes.c_int)  # nCmdShow

def hide_taskbar():
    hWndTray = user32.FindWindowW(u"Shell_traywnd", None)
    user32.ShowWindow(hWndTray, SW_HIDE)
    hWndStart = user32.FindWindowW(START_ATOM, None)
    if hWndStart:
        user32.ShowWindow(hWndStart, SW_HIDE)

def unhide_taskbar():
    hWndTray = user32.FindWindowW(u"Shell_traywnd", None)
    user32.ShowWindow(hWndTray, SW_SHOW)
    hWndStart = user32.FindWindowW(START_ATOM, None)
    if hWndStart:
        user32.ShowWindow(hWndStart, SW_SHOW)

Post a Comment for "Hide Windows Start Orb In Python (3.2)"