Jump to content

Controlling Irfanview in full screen mode


Recommended Posts

Hey all I am writing a script that uses IrfanView to display a number of images. However, I can't seem to control IrfanVideo when it is in full screen mode. The problem is that the full screen window that Irfanview opens is not selectable.

What I am doing is starting off Irfanview with a command line like this:

Run("C:\test\i_view32.exe /fs /slideshow=C:\test\crosslist.txt")

That starts the program in full screen mode with a slideshow (the crosslist.txt bit at the end). But, when I then try and select the window and press space to proceed to the next image in the slideshow with the code below, it seems to select another Irfanview window.

WinActivate ("IrfanView")

Send ("{SPACE}")

I understand that I need to specify the window to select, but the full screen window in this case does not seem to be selectable. According to the Autoit Window Info and UISpy, it does not exist: the only thing that exists is the Irfanview window behind it. But if I activate that window, it kicks the program out of full screen mode and ends the slideshow.

I assume that Irfanview is doing something wierd to open the full screen window, but I don't know what. Any ideas on how to deal with this?

Link to comment
Share on other sites

Take a look at ControlSend, it'll let you send the keystrokes to the Irfran window behind the slideshow, which (I assume) is controlling the slideshow.

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

Shouldn't the full screen window already be active when it show up? I don't see how WinActivate makes sense there.

Edited by AdmiralAlkex
Link to comment
Share on other sites

irfanview has a lot of commandline-options

List of all command line options supported in IrfanView:
--------------------------------------------------------

  /one                  - force "Only one instance"
  /fs                   - force Full Screen display
  /bf                   - force "Fit images to desktop" display option
  /title=text           - set window title to "text"
  /pos=(x,y)            - move IrfanView window to x,y
  /convert=filename     - convert input file(s) to "filename" and CLOSE IrfanView
                          (Note: See pattern help file page for more options)
  /slideshow=txtfile    - play slideshow with the files from "txtfile"
  /slideshow=folder     - play slideshow with the files from "folder"
  /reloadonloop         - reload input source used in /slideshow when list finished
  /filelist=txtfile     - use filenames from "txtfile" as input, see examples below
  /thumbs               - open Thumbnails window
  /killmesoftly         - close all IrfanView instances (exit after command line)
  /closeslideshow       - close slideshow and IrfanView after the last image
  /page=X               - open page number X from a multipage input image
  /crop=(x,y,w,h)       - crop input image: x-start, y-start, width, height
  /print                - print to default printer and CLOSE IrfanView
  /print="Name"         - print to specific printer and CLOSE IrfanView
  /resize=(w,h)         - resize input image to w (width) and h (height)
  /resize_long=X        - resize input image: set long side to X
  /resize_short=X       - resize input image: set short side to X
  /resample             - for resize: use Resample option (better quality)
  /capture=X            - capture the screen or window (see examples below)
  /ini                  - use the Windows folder for INI/LST files (read/save)
  /ini="Folder"         - use the folder "Folder" for INI/LST files (read/save)
  /clippaste            - paste image from the clipboard
  /clipcopy             - copy image to the clipboard
  /silent               - don't show messages for command line read/save errors
  /invert               - invert input image (negative)
  /dpi=(x,y)            - change image DPI values, set DPIs for scanning
  /scan                 - acquire the image from the TWAIN device (show TWAIN dialog)
  /scanhidden           - acquire the image from the TWAIN device (hide TWAIN dialog)
  /batchscan=(options)  - simulate menu: File->Batch Scan, see examples below
  /bpp=BitsPerPixel     - change color depth of the input image to BitsPerPixel
  /swap_bw              - swap black and white color
  /gray                 - convert input image to grayscale
  /rotate_r             - rotate input image to right
  /rotate_l             - rotate input image to left
  /hflip                - horizontal flip
  /vflip                - vertical flip
  /filepattern="x"      - browse only specific files
  /sharpen=X            - open image and apply the sharpen filter value X
  /contrast=X           - open image and apply the contrast value X
  /bright=X             - open image and apply the brighntess value X
  /gamma=X              - open image and apply the gamma correction value X
  /advancedbatch        - apply Advanced Batch Dialog options to image (from INI file)
  /transpcolor=(r,g,B)  - set transparent color if saving as GIF/PNG/ICO
  /hide=X               - hide toolbar, status bar, menu and/or caption of the main window
  /aspectratio          - used for resizes: keep image proportions
  /info=txtfile         - write image infos to "txtfile"
  /fullinfo             - used for /info, write EXIF, IPTC and Comment data
  /append=tiffile       - append image as (TIF) page to "tiffile"
  /multitif=(tif,files) - create multipage TIF from input files
  /panorama=(X,files)   - create panorama image from input files; X = direction (1 or 2)
  /jpgq=X               - set JPG save quality
  /tifc=X               - set TIF save compression
  /wall=X               - set image as wallpaper
  /extract=(folder,ext) - extract all pages from a multipage file
  /import_pal=palfile   - import and apply a special palette to the image (PAL format)
  /jpg_rotate=(options) - JPG lossless rotation, see examples below
  /monitor=X            - start EXE-Slideshow on monitor X
  /window=(x,y,w,h)     - set EXE-Slideshow window position and size


Important notes:
- Only lower case options are supported (don't type any UPPERCASE letters) !
- Input file name (if required) is always the first parameter!
- Use "" for file names with spaces, example: "c:\images\dummy test file.jpg"
- Write always the FULL paths for file names (incl. drive letter)
- You can combine several options in one command
- Wildcards supported only for /convert, /print, /info and /jpg_rotate
- Maximal command line length is limited by Windows, so use shorter names/paths.
- Most settings are loaded from the INI file. Using prepared INIs and /ini option, you can extend the possibilities.
- IrfanView exit code is 0. If /convert or /print is used, there is 1 or 2 also possible, for load/save error.
Edited by andygo
Link to comment
Share on other sites

Fulano, Thanks, I'll take a look at ControlSend and see if that can do what I need.

AdmiralAlkex, I need to switch to another window to do something imbetween switching from one slide to the next in the slideshow.

Edited by rbaguley
Link to comment
Share on other sites

Well you know what I would do then? Make my own image viewer. Oh wait I already did :)

Twice if you count the media player!

I'm sorry I can't help more right now. It's bed-time here in Europe :idea:

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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