
有什么方法可以通過 Python 實際呼叫這個 Windows 卷視窗?
我知道我可以使用 pycaw 來改變音量本身,我已經這樣做了。我需要幫助才能打電話給這個。
uj5u.com熱心網友回復:
使用 pywin32,您可以為VK_VOLUME_UP/發送鍵盤輸入VK_VOLUME_DOWN,關鍵訊息將顯示那個煩人的視窗,例如
import win32con
import win32api
import time
win32api.keybd_event(win32con.VK_VOLUME_UP, 0)
win32api.keybd_event(win32con.VK_VOLUME_UP, 0, win32con.KEYEVENTF_KEYUP)
time.sleep(1) #sleep is just to see the effect, it's not required here
win32api.keybd_event(win32con.VK_VOLUME_DOWN, 0)
win32api.keybd_event(win32con.VK_VOLUME_DOWN, 0, win32con.KEYEVENTF_KEYUP)
time.sleep(1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/380109.html
