Hi Toralf,
I have implemented some nice ( for me ) features
hard coded:
- Show Easycopy in Tray toggles show/hide
- edit button to open the last saved file in Irfanview
configurable:
- do not show Gui after capture
- do not show Gui on startup
- show/hide Gui by single click on tray icon
hide by right click on titlebar ( instead of rollup/down )
- open button shows irfanview thumbnails instead of folder
I have used HyperSnap as screencopy program until now,
and I am accustomed to these features.
moved up before " ;tray menu " :
Code:
;get previous settings
GoSub, ReadDefaultsFromIni
adapted code snippets :
Code:
Menu, Tray, Default, Show EasyCopy
If ShowGuiWithSingleCLick
Menu, Tray, Click, 1
Code:
Gui, 1:Add, Checkbox, xm y+6 Section vChkShowPreview Checked%ChkShowPreview%, preview
Gui, 1:Add, Button, ys-5 vBtnEdit gBtnEdit , Edit
Gui, 1:Add, Button, ys-5 vBtnSave gBtnSave Disabled, Save
Code:
;get Gui width and height for Resize of Preview
WinGetPos, , , Gui1Width, Gui1Height, %WinNameGui1%
If HideGuiOnStart
Gui, 1:Hide
Code:
ReadDefaultsFromIni:
IniRead, HideGuiOnStart, %StartCenterIni%, EasyCopy, HideGuiOnStart, 1
IniRead, HideGuiAfterCapture, %StartCenterIni%, EasyCopy, HideGuiAfterCapture, 1
IniRead, ShowGuiWithSingleCLick, %StartCenterIni%, EasyCopy,ShowGuiWithSingleCLick, 1
IniRead, OpenThumbsInsteadofFolder, %StartCenterIni%, EasyCopy,OpenThumbsInsteadofFolder, 1
IniRead, EdtPath, %StartCenterIni%, EasyCopy, EdtPath, %PathProjects%
Code:
;############# Close Gui 1 and save settings #############################
GuiEscape:
GuiClose:
Gui, 1: Submit
IniWrite, %EdtPath%, %StartCenterIni%, EasyCopy, EdtPath
IniWrite, %EdtFileName%, %StartCenterIni%, EasyCopy, EdtFileName
IniWrite, %ChkShowPreview%, %StartCenterIni%, EasyCopy, ChkShowPreview
Gui, 1:Show
WinGetPos, PosX, PosY, SizeW, SizeH, %WinNameGui1%
IniWrite, x%PosX% y%PosY%, %StartCenterIni%, EasyCopy, Pos_Gui1
ExitApp
Return
Code:
;############# Show Gui1 from Tray menu ###################################
RollWindowUp:
If not ShowGuiWithSingleCLick
{
GoSub,RollWindowUpNoHide
return
}
MouseGetPos, , , GuiID
If ( Gui1UniqueID <> GuiID )
{
Send, {Rbutton}
return
}
TrayShowGui:
IfWinExist, ahk_id %Gui1UniqueID%
Gui, 1:Hide
else
Gui, 1:Show
Return
Code:
;############# Open destination folder in explorer ########################
BtnOpen:
Gui, 1: Submit, NoHide
If OpenThumbsInsteadofFolder
Run, %ExeCapture% "%EdtPath%" /thumbs
else
Run, explorer /e`,"%EdtPath%"
Return
Code:
;############# Roll Gui 1 up to its titlebar ##############################
RollWindowUpNoHide:
Code:
Gui, 2:Add, Tab, xm w360 r7 Section, Misc|Lines|ShortCuts|Quality|Save|ShowHide
Code:
Gui, 2:Tab, ShowHide
Gui, 2:Add,Checkbox,xs+10 ys+30 vHideGuiOnStart Checked%HideGuiOnStart%,Hide Gui on Startup
Gui, 2:Add,Checkbox, xs+10 ys+60 vHideGuiAfterCapture Checked%HideGuiAfterCapture%, Hide Gui after capture
Gui, 2:Add,Checkbox, xs+10 ys+90 vShowGuiWithSingleCLick Checked%ShowGuiWithSingleCLick%, Show Gui with single
click on tray icon`nhide with right click on titlebar
Gui, 2:Add,Checkbox, xs+10 ys+120 vOpenThumbsInsteadofFolder Checked%OpenThumbsInsteadofFolder%, Open button shows Irfanview thumbnails instead of explorer folder
Code:
;store options to ini
IniWrite, %HideGuiOnStart%, %StartCenterIni%, EasyCopy, HideGuiOnStart
IniWrite, %HideGuiAfterCapture%, %StartCenterIni%, EasyCopy, HideGuiAfterCapture
IniWrite, %ShowGuiWithSingleCLick%, %StartCenterIni%, EasyCopy, ShowGuiWithSingleCLick
IniWrite, %OpenThumbsInsteadofFolder%, %StartCenterIni%, EasyCopy, OpenThumbsInsteadofFolder
IniWrite, %ChkAutoNumber%, %StartCenterIni%, EasyCopy, ChkAutoNumber
Code:
Else ;no preview wanted
{
;give feedback
LastSavedFile = %FileNameForImage%
ToolTip, ScreenShot saved as`n%FileNameForImage%
Code:
;show Gui, autosize to fit preview (added, new or delted)
If not HideGuiAfterCapture
Gui, 1:Show, AutoSize
Code:
;copy preview image to destination image with overwrite
FileCopy, %PreViewFileName%, %FileNameForImage% , 1
LastSavedFile= %FileNameForImage%
;give feedback
Code:
BtnEdit:
;get path and filename
Gui, 1:Submit, NoHide
run,%ExeCapture% %lastSavedFile%
Return
Code:
Else ;no preview wanted
{
;give feedback
LastSavedFile = %FileNameForImage%
ToolTip, ScreenShot saved as`n%FileNameForImage%
Code:
;show Gui, autosize to fit preview (added, new or delted)
If not HideGuiAfterCapture
Gui, 1:Show, AutoSize
;memorize this as last action
RedoBuffer = CaptureRegion