728x90
반응형

지금 사용하는 현재 마우스커서는 아래와 같습니다.

다음과 같이 5초간 변경합니다. 이후 마우스 커서를 원상 복구 합니다.

import win32con
import win32api
import win32gui
import ctypes
import time
import atexit
# 현재 커서 저장 (복구하기 위한용)
cursor = win32gui.LoadImage(0, 32512, win32con.IMAGE_CURSOR, 0, 0, win32con.LR_SHARED)
save_system_cursor = ctypes.windll.user32.CopyImage(cursor, win32con.IMAGE_CURSOR, 0, 0, win32con.LR_COPYFROMRESOURCE)
# 커서 변경
cursor = win32gui.LoadImage(0, "E:/RnD/지식IN/turtle.cur", win32con.IMAGE_CURSOR, 0, 0, win32con.LR_LOADFROMFILE);
ctypes.windll.user32.SetSystemCursor(cursor, 32512)
ctypes.windll.user32.DestroyCursor(cursor);
time.sleep(5) # 5초후 원 커서로 복구
# 원 커서로 복구
ctypes.windll.user32.SetSystemCursor(save_system_cursor, 32512)
ctypes.windll.user32.DestroyCursor(save_system_cursor);
exit
728x90
반응형
'프로그램' 카테고리의 다른 글
[파이썬] pandas 에러(KeyError(f'{not_found} not in index')) (0) | 2022.09.06 |
---|---|
[파이썬] 키보드 입력 감지 (0) | 2022.09.06 |
[파이썬] 주식 매수,매도 최적 조건 자동 찾기 (0) | 2022.09.04 |
[파이썬] pandas DataFrame loc(null값 조회) (0) | 2022.08.31 |
[파이썬] 문장 요약 하기 (summa package) (1) | 2022.08.29 |
댓글