Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

I need to know the command to run external application files

Hi,
Sorry it's any trouble, but I need to know what command to use to open an external application(I specifically want to run another program so as to open a specific file, much like the way windows open files). I need it so I can use the bink play program (from Rad videos) to play .bik files.

Please help me.
 
Hey, long time no see, khmp!!

That is definitely the command i need, but I'm running into some problems...
Using that for a video file is no good, as it throws a message saying like "Errno: ENOEXEC occured"

I can run the binkplay application by itself all right, but when I load a parameter e.g. "binkplay.exe video" (like I should when I'm to run a bink file from the command prompt) it says "bink error: error opening file". The same video runs normally in command prompt. I've even tried making a .bat file to load the command directly instead of an application with a parameter, but it's still no good. What am I doing wrong?

(P.S. Thanks in advance.  ;)  )
 

khmp

Sponsor

MSDOS is one language I never played around with so I'm always at a loss when it comes to syntax. I thought it would be as easy as entering just the video file's name and hopefully windows would be able to determine the default program for playing them. I'll try to mess around with it

[update]
Woops. After looking at the documentation for exec it replaces the current process with whatever you do get it to run. Meaning even if we get that to work only the *.bik will play. And I don't think that's what you are looking for.

I guess it wasn't as easy as I thought it would be. You are going to need the help of someone much more knowledgeable in the ways of Ruby, grecias, because I'm at a total loss. Sorry about that.
 
What a shame... just when I thought there'd be a way to avoid using that buggy thing called avi script... can't win them all I guess...

Really thanks for trying to help (once again) though.
 

khmp

Sponsor

I'm just sorry for dashing your hopes. I guess I should keep this topic open just in case one of the smarter guys have an thoughts on the matter.

Good luck with it grecias! :afro:
 
luck you..I got interested in how to do this XD.
I got this, but didn't test it, first add this into the script you are trying to call the window in

Code:
  def find_window(name)
    getCurrentThreadId=Win32API.new('kernel32','GetCurrentThreadId', '%w()','l')
    getWindowThreadProcessId=Win32API.new('user32','GetWindowThreadProcessId', '%w(l p)','l')
    gindWindowEx=Win32API.new('user32','FindWindowEx', '%w(l l p p)','l')
    processid=[0].pack('l')
    threadid=getCurrentThreadId.call
    nextwindow=0
    begin
      nextwindow=findWindowEx.call(0,nextwindow,"#{name}",0)
      if nextwindow
        wndthreadid=getWindowThreadProcessId.call(nextwindow,processid)
        if wndthreadid==threadid
          return true
        end
      end
    end until nextwindow==0
    return false
  end

Now use this to call up your window:
Code:
Thread.new{system('NAME')} 
while find_window('NAME')
  Graphics.update
end

credit Poccil and I if it works.

Edit:

Are you trying to call from an event?
 

poccil

Sponsor

That approach wouldn't exactly work, as it checks only windows from the same process as that of the game, and Notepad (or another application) runs in
a different process.  I may post a modified version when I have time.  That approach when I posted it was merely intended to find the RGSS Player window.
 
Actually, this doesn't work at all. "Error at line 9: Undefined variable findWindowEx"... I put the script among the others and tried to use this on the intro menu(but yes, I also need it for events)...

Anyway, it's not worth much trouble...
 
poccil":4q076yub said:
That approach wouldn't exactly work, as it checks only windows from the same process as that of the game, and Notepad (or another application) runs in
a different process.  I may post a modified version when I have time.  That approach when I posted it was merely intended to find the RGSS Player window.

That makes sense. Good luck :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top