Skip to content

Commit

Permalink
Fix <PrintScreenAndSave>
Browse files Browse the repository at this point in the history
  • Loading branch information
goreliu committed Aug 22, 2016
1 parent 4ce7596 commit 0da972f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 28 deletions.
48 changes: 21 additions & 27 deletions plugins/General/General.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,15 @@ return
Run, https://www.baidu.com/s?wd=%clipboard%
return

<Test>:
MsgBox, 测试
return

TestFunction(arg)
{
MsgBox, 参数:%arg%
}

<PrintScreenAndSave>:
if (RegExMatch(A_ThisHotkey, "i)!PrintScreen"))
{
Expand All @@ -950,32 +959,10 @@ return
Send, {PrintScreen}
}

Run, mspaint
Loop, 5
{
if (WinActive("ahk_class MSPaintApp"))
{
Send, ^v^s
break
}
sleep 100
}
return

<Test>:
MsgBox, 测试
return

TestFunction(arg)
{
MsgBox, 参数:%arg%
}
sleep, 50

/*
<PrintScreenWindowAndSave>:
WinGetPos x, y, w, h, A
ScreenSnapshot(A_Temp "\vimd.tmp.png", x "|" y "|" w "|" h "|")
Fileselectfile, selectedFile, s16, 截图.png, 另存为, PNG图片(*.png)
SaveImageFromClipboard(A_Temp "\vimd.tmp.png")
FileselectFile, selectedFile, s16, 截图.png, 另存为, PNG图片(*.png)

if (selectedFile == "")
{
Expand All @@ -988,9 +975,17 @@ TestFunction(arg)
}

FileMove, % A_Temp "\vimd.tmp.png", % selectedFile, 1
return

SaveImageFromClipboard(filename)
{
pToken := Gdip_Startup()
pBitmap := Gdip_CreateBitmapFromClipboard()
Gdip_SaveBitmapToFile(pBitmap, filename)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
}

; ScreenSnapshot("FullScreen.png")
; ScreenSnapshot("Area_xywh.png", "10|20|200|200")
ScreenSnapshot(filename, area := 0)
Expand All @@ -1001,7 +996,6 @@ ScreenSnapshot(filename, area := 0)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
}
*/

SwitchIME(dwLayout)
{
Expand Down
1 change: 0 additions & 1 deletion vimd.ini.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ vim
<w-o>=<TC_OpenTCDialog>
<w-c>=run|explorer
<w-j>=<RunZ>
;<w-u>=run|..\RunZ\RunZ.ahk
<w-`>=run|control
;<w-f>=run|firefox
;<w-q>=run|c:\mine\app\msys2\usr\bin\mintty -t " " -e /usr/bin/ssh -q -t -p 50248 127.0.0.1 'NOTMUX=1 zsh'
Expand Down

0 comments on commit 0da972f

Please sign in to comment.