Textgadget
#txtURL contains -->  http://www.ready4music.com
Runprogram(Getgadgettext(#txtURL),"","",2) does not fire the url
The following does work
temp.s  = Getgadgettext(#txtURL)
Runprogram(temp,"","",2) does not fire the url
Am I missing something or is it a bug?
			
			
									
									Runprogram behaviour
Runprogram behaviour
Cor de Visser
Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
						Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Re: Runprogram behaviour
> Runprogram(Getgadgettext(#txtURL),"","",2) does not fire the url
Yep, it fires fine for me with this code:
			
			
									
									
						Yep, it fires fine for me with this code:
Code: Select all
If OpenWindow(1,300,250,400,200,#PB_Window_SystemMenu,"Window")
  CreateGadgetList(WindowID())
  ButtonGadget(1,20,50,60,25,"Button")
  StringGadget(2,20,100,300,20,"http://www.ready4music.com/")
  Repeat
    ev=WaitWindowEvent()
    If ev=#PB_Event_Gadget
      Select EventGadgetID()
        Case 1 ; Button.
          RunProgram(GetGadgetText(2),"","",2)
      EndSelect
    EndIf
  Until ev=#PB_EventCloseWindow
EndIf
It does not fire on win95
			
			
									
									Cor de Visser
Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
						Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
> It does not fire on win95
True! Use ShellExecute instead of RunProgram like so, and it works:
  Use ShellExecute instead of RunProgram like so, and it works:
I think Fred intended RunProgram to be for apps only, and not web pages,
which may be why RunProgram doesn't work in this case on Win 95.
			
			
									
									
						True!
 Use ShellExecute instead of RunProgram like so, and it works:
  Use ShellExecute instead of RunProgram like so, and it works:Code: Select all
ShellExecute_(0,"open",GetGadgetText(2),"","",#SW_SHOW)
which may be why RunProgram doesn't work in this case on Win 95.
ShellExecute()
This is the Second of Two Threads I have found that mention  ShellExecute(), but I do not find it in the Help, nor does the IDE highlight or case-correct an entry of ShellExecute().  What gives?
--Never mind. I just noted the following underscore (ShellExecute_()), meaning it is a Windows API call. Dern! I wish my eyes were better.
			
			
									
									--Never mind. I just noted the following underscore (ShellExecute_()), meaning it is a Windows API call. Dern! I wish my eyes were better.
has-been wanna-be (You may not agree with what I say, but it will make you think).
						Re: ShellExecute()
It's a Win32 API command. If you place a win32.hlp file in the help folder in your PB installation you'll be able to use F1 to get help. All commands ending with an underscore '_' are API commands and as such aren't included in the PB help file.oldefoxx wrote:This is the Second of Two Threads I have found that mention ShellExecute(), but I do not find it in the Help, nor does the IDE highlight or case-correct an entry of ShellExecute(). What gives?




