Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ctypes
- from ctypes import wintypes
- user32 = ctypes.WinDLL("user32")
- TOGGLE_UNHIDEWINDOW = 0x40
- TOGGLE_HIDEWINDOW = 0x80
- user32.FindWindowW.restype = wintypes.HWND
- user32.FindWindowW.argtypes = (
- wintypes.LPCWSTR, # lpClassName
- wintypes.LPCWSTR) # lpWindowName
- user32.SetWindowPos.restype = wintypes.BOOL
- user32.SetWindowPos.argtypes = (
- wintypes.HWND, # hWnd
- wintypes.HWND, # hWndInsertAfter
- ctypes.c_int, # X
- ctypes.c_int, # Y
- ctypes.c_int, # cx
- ctypes.c_int, # cy
- ctypes.c_uint) # uFlags
- def hide_taskbar():
- handleW1 = user32.FindWindowW(u"Shell_traywnd", u"")
- user32.SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)
- def unhide_taskbar():
- handleW1 = user32.FindWindowW(u"Shell_traywnd", u"")
- user32.SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement