我正在创建一个程序,它将取代Python中的windows开始菜单。我设法找到了一种隐藏任务栏的方法,如下所示,但我找不到一种方法来隐藏开始orb(Windows按钮)。在
import ctypes
from ctypes import wintypes
FindWindow = ctypes.windll.user32.FindWindowA
FindWindow.restype = wintypes.HWND
FindWindow.argtypes = [
wintypes.LPCSTR, #lpClassName
wintypes.LPCSTR, #lpWindowName
]
SetWindowPos = ctypes.windll.user32.SetWindowPos
SetWindowPos.restype = wintypes.BOOL
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
]
TOGGLE_HIDEWINDOW = 0x80
TOGGLE_UNHIDEWINDOW = 0x40
def hide_taskbar():
handleW1 = FindWindow(b"Shell_traywnd", b"")
SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)
def unhide_taskbar():
handleW1 = FindWindow(b"Shell_traywnd", b"")
SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)
可以使用^{} 和orb的类atom 0xC017获得启动orb的句柄。然后使用^{} 或^{} 隐藏任务栏和球体。例如:
相关问题 更多 >
编程相关推荐