Announcement

Collapse
No announcement yet.

Multiple Instances of Iview from Command Line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Tell me what you've been up to.

    Comment


      #32
      Tempest,

      If you can't determine what went wrong, let's try my alternative.

      Let's bring the batch file back, but instead link to it. Make a shortcut to Bottom.bat and name it Bottom.

      Launch before line:
      Code:
      "C:\Program Files (x86)\IrfanView2\Bottom.lnk" [ROM]
      Bottom.bat:
      Code:
      cd C:\Program Files (x86)\IrfanView2
      
      i_view32.lnk "C:\Emulators\Mame64.127\marquees\%1.png" /ini="C:\Program Files (x86)\IrfanView2\Bottom" /hide=15 /resize=(1670,470) /aspectratio /resample
      
      Exit
      The Gameex runitgame.bat should look I'm guessing like this:
      Code:
      @ECHO OFF
      "C:\PROGRAM FILES (X86)\IRFANVIEW2\Bottom.lnk" 88games
      C:
      CD "C:\Emulators\Mame64.127"
      vmame64.exe 88games -rompath "C:\Extras\CHD;C:\Extras\Mame 0.127 roms"
      Keep me informed.

      Comment


        #33
        Oh Oh, I have a stalker... LOL

        I have had major internet problem, I couldn't connect yesterday afternoon at all, and I don't know if they have it fixed permanently or not. I think it stops working while they try to make repairs, so If I don't respond, I'm not ignoring you.

        I have it working (sort of) by writing a script in AHK. It really is no different than what we were doing, I guess Gameex likes AHK scripts better than batch files. I have to go to work, but when I get back (probably a short day), I will post the details, and let you know what issues I have.
        I'll give you a hint... The open irfanview windows respond to keyboard commands while Mame is running.... I really haven't taken a look at it yet, Talk to you soon...

        Comment


          #34
          Hello Morpheus,

          Originally posted by Morpheus
          Alright, I'm getting a little worried... you seem to be able to see what I'm doing! LOL
          Yah, it was only a short drive over to Adrian...LOL. Can you get me a bite to eat while you're at it.

          Originally posted by Morpheus View Post
          If I don't respond, I'm not ignoring you.
          Understandably.

          I'll give you a hint... The open irfanview windows respond to keyboard commands while Mame is running.... I really haven't taken a look at it yet, Talk to you soon...
          Yes, I've had that problem in my trials, too. Because we eliminated the 'waiting till one program is finished capability', now we are at the will of whatever one starts first! Unfortunately, if IrfanView starts last it will get focus. I don't really know how to give it focus programmatically. Obviously, you can do it manually, but do you want to?

          So, what happened with the alternative I gave you yesterday? Did you try it or skip it? Did it fail as well?

          Comment


            #35
            I'll try to bring you up to date (I tried earlier, hit "submit reply", and got a "explorer can't display the page" error.) AAARRRGG!

            I have it working pretty well, but I'll give you some background...

            When Mame is run, it opens a disclaimer window "Do you have the right to play this game, Type OK, or hit ESC" Then, depending on the game another window may open that says "This Game may not run perfectly, Type OK, or hit ESC". AS I mentioned before, I have built an arcade style cabinet, and do not want to have a keyboard visible, so I am running a custom compiled version of Mame. This custom version apparently gets around the "nag screens" by sending "O", "K", and "Enter" about ten times, "shotgunning" it to make sure that it gets the idea that yes, it is OK.

            That is what was causing Iview to try to open a file. The "O" was opening the "open file" dialog, and "K" was being entered as the filename. (I mentioned that Iview was trying to open a file in a previous post.)

            You gave me the idea, that of course Mame was going to be sending those keystrokes to Iview if the timing wasn't correct... So I wrote an AHK script to do everything.

            This is the script:
            Code:
            ;#NoTrayIcon
            #SingleInstance ignore
            SetTitleMatchMode, 2
            
            Run, C:\Marqueemaker\Bottom\i_view32.exe C:\Emulators\Mame64.127\marquees\%1%.png /hide=15
            Run, C:\Marqueemaker\TopRight\i_view32.exe C:\Emulators\Mame64.127\flyers\%1%.png /hide=15
            Run, C:\Marqueemaker\TopLeft\i_view32.exe C:\Emulators\Mame64.127\titles\%1%.png /hide=15
            
            Run, vmame.exe %1% -rompath "C:\Extras\CHD;C:\Extras\Mame 0.127 roms", C:\Emulators\Mame64.127
            
            WinWaitActive, MAME: ;Wait here until Mame opens
            
            WinWaitClose ;Wait here until Mame closes
            
            Run, taskkill.exe /IM i_view32.exe
            
            Exitapp
            It works decently, but everyonce in awhile, Iview still receives an "Enter" key, and the window will go fullscreen. I played with it for an hour, but I can't seem to get it to run perfectly every time. There is no pattern to it, I can run the same game twice, and it will work correctly the first time, and Iview will go fullscreen the second.

            That's all I know for now, if you don't have any suggestions, I'll ask for help at the AHK forums, I use the name "Morpheus" there as well. (Matrix Fan)

            Let me know what your thoughts are, and thanks again for the help!
            Tempest
            Last edited by Morpheus; 24.10.2008, 09:49 PM. Reason: Typo's

            Comment


              #36
              I don't know anything about AHK scripting. Haven't had time to ever try it before.

              (I mentioned that Iview was trying to open a file in a previous post.)
              Yes, you had me believing that I was cracking you up. Apparently, this game is.

              I thought a bit about the focus issue and came up with a solution. It's not necessarily the most efficient, but it works pretty well. You'll have to figure out how to adapt it. It looks basically like this:

              Code:
              @echo off
              cd C:\Program Files (x86)\IrfanView2
              i_view32.lnk "C:\Emulators\Mame64.127\marquees\%1.png" /ini="C:\Program Files (x86)\IrfanView2\Bottom" /hide=15 /resize=(1670,470) /aspectratio /resample
              set x=0
              goto timer
              
              :next
              C:
              CD "C:\Emulators\Mame64.127"
              vmame64.exe %1 -rompath "C:\Extras\CHD;C:\Extras\Mame 0.127 roms"
              exit
              
              :timer
              if "%x%"=="25" goto next
              set /a x=%x%+1
              goto timer
              Since, I don't know how Gameex creates its batch file, you'll have to figure out what to do with this. Preferably, if you can just run this single batch file from a launch line, it will work. Is that possible? Maybe the code above could be called Bottom.bat and your launch line could still be:

              Code:
              "C:\Program Files (x86)\IrfanView2\Bottom.lnk" [ROM]
              The problem is, if you need to pass some other values to Mame other than [ROM]. Maybe you'll figure out a way around this.

              Anyway, the code introduces a delay timer that forces Mame to start later, giving IrfanView time to load first. Thus, Mame ends up with focus. Depending on how things go, you might want to play with the timer to get the right amount of delay so it works right for you. Just modify "25".

              ... thanks again for the help!
              You're welcome. Where should I send the bill? LOL Would you have ever gotten this far without me? I usually disappear on the weekend, so I'm not ignoring you.

              Good luck Morpheus!
              Last edited by Skippybox; 24.10.2008, 11:12 PM.

              Comment


                #37
                Try it yet???

                Comment


                  #38
                  Where are we on the project, Morpheus?

                  If you are still working with the timer setup you could do it like this:

                  Bottom.bat
                  Code:
                  cd C:\Program Files (x86)\IrfanView2
                  
                  i_view32.lnk "C:\Emulators\Mame64.127\marquees\%1.png" /ini="C:\Program Files (x86)\IrfanView2\Bottom" /hide=15 /resize=(1670,470) /aspectratio /resample
                  
                  Exit
                  Mame.bat
                  Code:
                  @echo off
                  set x=0
                  goto timer
                  
                  :exit
                  C:
                  CD "C:\Emulators\Mame64.127"
                  vmame64.exe %1 -rompath "C:\Extras\CHD;C:\Extras\Mame 0.127 roms"
                  exit
                  
                  :timer
                  if "%x%"=="25" goto exit
                  set /a x=%x%+1
                  goto timer
                  Launch before line:

                  Code:
                  "C:\Program Files (x86)\IrfanView2\Bottom.lnk" [ROM]
                  Launch after? line:

                  Code:
                  "C:\Emulators\Mame64.127\Mame.lnk" [ROM]
                  Gameex runitgame.bat:
                  Code:
                  @ECHO OFF
                  "C:\PROGRAM FILES (X86)\IRFANVIEW2\Bottom.lnk" 88games
                  "C:\Emulators\Mame64.127\Mame.lnk" 88games
                  You still get to use the original Bottom.bat with its shortcut. You just need to make Mame.bat and a shortcut to it somewhere, like in C:\Emulators\Mame64.127. Then add the new launch after? line and see if that works for the runitgame.bat. Remember to tweak the timer if necessary.

                  Comment


                    #39
                    I got it working...
                    Sorry I haven't posted, I haven't been able to connect since Saturday, I finally went to my mom's just to catch up on the forums... I wil be posting all of the details at the Gameex forum, I will provide you with a link when I get it done.

                    The problem was that Gameex was sending the "O" "K" "enter", not Mame, so I was putting the code in the wrong place in the script!

                    Thanks again for your help! I don't think I would have gotten it done without you!
                    Last edited by Morpheus; 28.10.2008, 08:22 PM.

                    Comment


                      #40
                      Don't you love a happy ending?

                      Interesting. Looking forward to the details.

                      I don't think I would have gotten it done without you!
                      What would you say I helped you with?
                      Last edited by Skippybox; 28.10.2008, 08:50 PM.

                      Comment


                        #41
                        I went through the topic quickly, here are some Ideas that I may not have thought of:

                        Remember you can also have more than one IrfanView program installed at a time!
                        I'm using the "more than on copy of Iview method", because it is easy to pop up three windows, and get them to look like you want, without tracking all of the ini's. It also simplifies the command line somewhat.

                        I remembered you turned off Remember the last window size/postion
                        Who knows if I would have remembered to turn this back on or not...at the very least you saved me some hair pulling! LOL

                        You probably are displaying extensions. You don't rename the shortcut i_view32.exe or i_view32.lnk because that won't change the extension and you don't want to. Simply rename it i_view32; the extension is lnk and is hidden.
                        You taught me about .lnk's... they use these sometimes with GameEx, so it might be helpful in the future!

                        Obviously, you won't find anyone as devoted as me.
                        I learned a little about you...

                        Because we eliminated the 'waiting till one program is finished capability', now we are at the will of whatever one starts first! Unfortunately, if IrfanView starts last it will get focus.
                        This is what made me decide to script it. I needed to have control over what happened, in what order. I'm pretty new to scripting, so it's a slow process, but I am enjoying it.


                        I think that's quite a bit, especially since you don't use GameEx, or Mame. You seem to have a good understanding of how things work, and I really don't. It's all the little things that trip me up. It's all in the details...

                        Comment


                          #42
                          Nice summary, I appreciated that. It helped me understand what you found important. I always wonder though, if given enough time on their own, if people really could figure out how to do all the things I tell them. I guess you would certainly say otherwise?

                          Did you ever try the "timer" or that wouldn't have worked with Gameex issuing those keystrokes?
                          Last edited by Skippybox; 28.10.2008, 09:35 PM.

                          Comment


                            #43
                            I finished it without being able to read your last posts, because of the internet problems, so no I didn't try it. The script works better, because I can "Wait" for programs to open, or close, I tried "Sleep" at first, but I figured that would not be accurate to account for different system speeds...

                            I made my post at GameEx:

                            Another internet SNAFU, so the attachments are not displayed :-(
                            not much of a post... hopefully it will be fixed soon...

                            Comment


                              #44
                              I updated the Post at GameEX. Much better with attachments!

                              Comment


                                #45
                                Can't see them. Apparently I'm not a member.

                                How come fullscreen uses a maximized window instead of true fullscreen mode?

                                Tempest has made it to the Stickies! Nice tribute.

                                Originally posted by Morpheus
                                I think that's quite a bit, especially since you don't use GameEx, or Mame. You seem to have a good understanding of how things work, and I really don't. It's all the little things that trip me up. It's all in the details...
                                I know, and I've only been on the forum for three months. You are quite capable yourself. Do you go to Adrian College?

                                We should do a slideshow now!
                                Last edited by Skippybox; 29.10.2008, 09:23 PM.

                                Comment

                                Working...
                                X