-
Notifications
You must be signed in to change notification settings - Fork 0
/
test21.ahk
56 lines (45 loc) · 1.11 KB
/
test21.ahk
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#SingleInstance Force
#include d:\util\autohotkey\WinClipAPI.ahk
#include d:\util\autohotkey\WinClip.ahk
;; C:\Windows should change to %A_WinDir% for better compatibility.
;; r=rectangle 矩形剪取
^+4::
run, "%A_WinDir%\system32\SnippingTool.exe"
Sleep, 500
WinActivate, "Snipping Tool"
send, !m
send, r
Return
;; w=window 視窗剪取
^+5::
run, "C:\Windows\system32\SnippingTool.exe"
Sleep, 500
WinActivate, "Snipping Tool"
send, !m
send, w
Return
;; f=free-hand 任意剪取
^+6::
run, "C:\Windows\system32\SnippingTool.exe"
Sleep, 500
WinActivate, "Snipping Tool"
send, !m
send, f
Return
;; s=screen 全螢幕剪取
^+7::
run, "C:\Windows\system32\SnippingTool.exe"
Sleep, 500
WinActivate, "Snipping Tool"
send, !m
send, s
Return
^+0::
RunWait "C:\Windows\system32\SnippingTool.exe" /clip
;圖檔檔名: SCREEN-年月日-時分秒.png
imageFile = c:\temp\SCREEN-%A_YYYY%%A_MM%%A_DD%-%A_Hour%%A_Min%%A_Sec%.png
;SaveBitmap第2個參數選項:bmp,jpeg,gif,tiff,png
WinClip.SaveBitmap(imageFile, "png")
;run, %imageFile%
run, mspaint %imageFile%
Return