隐藏进程

import ctypes

# 定义Windows API函数
import time

user32 = ctypes.WinDLL("user32")
user32.ShowWindow.argtypes = [ctypes.c_void_p, ctypes.c_int]
user32.ShowWindow.restype = ctypes.c_int

# 隐藏进程函数
def hide_process():
    # 获取当前进程的窗口句柄
    hwnd = user32.GetForegroundWindow()

    # 隐藏进程的窗口
    user32.ShowWindow(hwnd, 0)

# 调用隐藏进程函数
hide_process()
time.sleep(20)

 

posted @ 2023-08-02 23:48  zwnsyw  阅读(66)  评论(0编辑  收藏  举报