win32api 修改分辨率、模拟鼠标中轴滚动

1. 修改电脑分辨率

import win32api
dm = win32api.EnumDisplaySettings(None, 0)
dm.PelsHeight = 768
dm.PelsWidth = 1366
dm.BitsPerPel = 32
dm.DisplayFixedOutput = 0
win32api.ChangeDisplaySettings(dm, 0)

2. 模拟鼠标中轴滚动

import win32api
import win32con
#向下滚动1500像素
for i in range(1, 1500):
    win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, 0, 0, -1)