need help on how to open another exe using a button.

Just starting out? Need help? Post your questions and find answers here.
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

need help on how to open another exe using a button.

Post by kane »

How do I get it to open a exe in a subfolder from this exe /bob/bob.exe
thanks.

Code: Select all

IncludeFile "Common.pb"
Open_Window_0()

  Quit = 0
  Repeat
    Event = WaitWindowEvent()
    
    Select Event
      Case #PB_EventCloseWindow 
        Quit = 1
        
       Case #PB_Event_Gadget
       
        Select EventGadgetID()
        
          Case #Button_1 ; If push Exit then quit
            Quit = 1
          Case #Button_0 ; the Patch Button

          Case #Button_2
            CloseWindow(#Window_1) ; If push cancel in that, close it
            
        EndSelect
        
   EndSelect
    
      
  Until Quit = 1
  End
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

Post by kane »

ahh got it sorta...

Code: Select all

prog$="bob\bob.exe"

RunProgram(prog$)

Problem is how do I make so don't have to use full path just path from where exe is?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

"./subdir/prog.exe"

the "." signifies the current working directory
".." would mean one directory lower.
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

Post by kane »

ahh thanks so much
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

Post by kane »

another question if you don't mind how would I open a new page on the internet. so a button called register when click on it opens a webpage.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

kane wrote:another question if you don't mind how would I open a new page on the internet. so a button called register when click on it opens a webpage.

Code: Select all

RunProgram("http://www.registerhere.com/register.htm")
--Kale

Image
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

Post by kane »

thanks so much :)
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

Post by kane »

ahh ok 2 things..

when click play button need 2 examples of clicking button one stop music and another example of it closing the program.
kane
User
User
Posts: 23
Joined: Sun May 15, 2005 9:28 pm

Post by kane »

Problem...

I was using the prog$ way but what happends if I had a 2nd button needs open another 3rd party button what would it look like>??
Post Reply