pasting image to left/right/top/bottom

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
Guy4
Posts: 1
Joined: 04 Jul 2019, 08:36
Location: sweden
Contact:

pasting image to left/right/top/bottom

04 Jul 2019, 08:49

I have this code running in an always-on AutoHotkey script, listening for Ctrl + Up/Down/Left/Right combinations. When IrfanView has an open image, pressing the corresponding combination (Ctrl + one of the direction keys) will paste the image in your clipboard to that respective side. It's just a shortcut for Edit > Paste Special (add on the side).

Code:

Code: Select all

#IfWinActive ahk_class IrfanView

^Left::
        KeyWait LCtrl
        Send {Alt}{E}{T}{L}
Return

^Right::
        KeyWait Ctrl
        Send {Alt}{E}{T}{R}
Return

^Up::
        KeyWait Ctrl
        Send {Alt}{E}{T}{T}
Return

^Down::
        KeyWait Ctrl
        Send {Alt}{E}{T}{B}
Return
User avatar
Cerberus
Posts: 172
Joined: 12 Jan 2016, 15:46

Re: pasting image to left/right/top/bottom

20 Jul 2019, 18:42

This looks useful, well made!
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: pasting image to left/right/top/bottom

20 Jul 2019, 22:50

Nice, I didn't know you can do that in IrfanView.

BTW, you can send WM_COMMAND message or use WinMenuSelectItem.

Code: Select all

#IfWinActive ahk_class IrfanView
	^Left::IrfanView_PasteSpecial("Left")
	^Right::IrfanView_PasteSpecial("Right")
	^Up::IrfanView_PasteSpecial("Top")
	^Down::IrfanView_PasteSpecial("Bottom")
#If

IrfanView_PasteSpecial(Pos) {
	static wParam := {Left:109, Right:107, Bottom:108, Top:110}
	SendMessage, 0x111, wParam[Pos] ; 0x111 = WM_COMMAND
}

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 202 guests