-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.py
More file actions
31 lines (24 loc) · 893 Bytes
/
Test.py
File metadata and controls
31 lines (24 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
Created on 2013-7-12
@author: SuShiting
'''
import win32gui,win32con
import vim
def setWindowTransp():
hwnd=win32gui.FindWindow("Vim",None)
if hwnd:
s=win32gui.GetWindowLong(hwnd,win32con.GWL_EXSTYLE)
win32gui.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, s|win32con.WS_EX_LAYERED)
opCode=vim.eval("g:alphaOp")
alphaValue=int(vim.eval("g:alphaValue"))
stepValue=int(vim.eval("g:stepValue"))
if opCode=="plus":
alphaValue=alphaValue+stepValue
else:
alphaValue=alphaValue-stepValue
if alphaValue<200 or alphaValue>255:
vim.command("echo 'AlphaValue exceed!'")
else:
vim.command("let g:alphaValue="+str(alphaValue))
win32gui.SetLayeredWindowAttributes(hwnd, 0, alphaValue,win32con.LWA_ALPHA)
setWindowTransp()