Jump to content

Recommended Posts

Posted (edited)

Script Function:
            
                Open Pictuire when clikked once on the image
                Close Picture when mouse was moved

User Guide:

http://www.youtube.com/watch?v=eT1ylyiJsCo

The Script lets you open the image by cliking once on the thumbnail in the IrfanView window

And after you move your mouse a bit it will close that opened window

This is very useful if you have tons of junky images and only some good ones.

If you want to hide your cursor while viewing the image download: nomousey.exe & put it in your scriptdir.

http://www.apps4apps.filetap.com/nomousy.html

#cs ----------------------------------------------------------------------------
 AutoIt Version: 3.3.0.0
 Author: goldenix        

 Script Function:
                Script is Paused at startup
                Press ALT + Esc to terminate script, Pause/Break to "pause" 
                
                Open Pictuire when clikked once on the image
                Close Picture when mouse was moved  
http://www.autoitscript.com/forum/index.php?showtopic=96846             
#ce ----------------------------------------------------------------------------
#include <Misc.au3>
;~ =========================================================================================
;~ Config
;~ =========================================================================================

;~ Change this Nr. if you want to move your mouse for longer or shorter 
;~ distance to close the image [DEFAULT is 20]
Global $range   = 20 

HotKeySet("{pause}", "TogglePause")     ;Pause/Break HotKey
HotKeySet("!{ESC}", "Terminate")        ; Alt + Esc Hotkey


;~ Do not change anything Below this line - Unless you know what you are doing!
;~ /////////////////////////////////////////////////////////////////////////////////////////
Global $Window  = " - IrfanView"            ;Sub Sting of the Irfan window DO not change this
Global $window2 = "IrfanView Thumbnails"    ;Irfan Thumbnails window title Do not change

;~ =========================================================================================

Opt("WinTitleMatchMode", 2)     ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

Global $Paused
Global $x, $y

TogglePause() ; pause the script at startup

$dll = DllOpen("user32.dll")
While 1
    Sleep(50)
    If _IsPressed("01", $dll) Then ; right mouse , 01 = left mouse

        MouseDown("left")
        Sleep(10)
        MouseUp("left")

        MouseDown("left")
        Sleep(10)
        MouseUp("left")
        
        MouseDown("left")
        Sleep(10)
        MouseUp("left")     
        
        If FileExists('nomousy.exe') Then ShellExecute("nomousy.exe","-h") ; mouse hide

        $pos = MouseGetPos()
        
        $x = $pos[0]
        $y = $pos[1]

        _close_window()             
            
    EndIf   
        
WEnd
DllClose($dll)
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func _close_window()
    
;~  WinWait($Window)    
    If WinExists($Window) then WinActivate($Window)
    
    While 1
        $pos = MouseGetPos()

        $x2 = $pos[0]
        $y2 = $pos[1]
        
;~      ToolTip($x &" "& $y & @CRLF & $x2 &" "& $y2,0,0)    
        
        If $x2 > $x+$range Or $y2 > $y+$range Then ExitLoop
        If $x2 < $x-$range Or $y2 < $y-$range Then ExitLoop 
        Sleep(5)        
    WEnd

    If FileExists('nomousy.exe') Then ShellExecute("nomousy.exe") ; mouse show
        
;~  ----------------------------------------------------
    $hwnd2 = WinGetHandle("[CLASS:FullScreenClass]") ; returns nothing if not in fullscreen
        
        If $hwnd2 <> '' then
            ConsoleWrite('Send ESC' & @CRLF)
            Send('{esc}')
;~          WinClose($hwnd2)
;~          Opt('WINTITLEMATCHMODE', 4)
;~          ControlShow('classname=Shell_TrayWnd', '', '')
;~          Opt('WINTITLEMATCHMODE', 2)
        EndIf       
;~  ----------------------------------------------------
        If WinExists($Window) Then 
            $hwnd1 = WinGetHandle($Window)          
            WinClose($hwnd1)
            ConsoleWrite('WinClose($hwnd1)' & @CRLF)
        EndIf
            
;~  ----------------------------------------------------
EndFunc

Func Terminate() ; exit
    Exit 0
EndFunc

imgSortHelper.au3

Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...