Launching a web browser from Squeak?
mike.rueger at gmail.com
Thu May 11 22:27:47 UTC 2006
John Maloney wrote:
> Does anyone know how to launch a Web browser from within Squeak? I need
> to be able to pass the URL to the browser to open. It would be really
> great if I could also tell the browser how big to be and where to open
> on the screen.
> I realize the solution will probably be highly platform dependent; I'm
> interesting in solutions for Windows, Macs, and Linux.
For Sophie we just solved that problem :-)
Below is the windows part, hot of the grill.
The usual disclaimers about exploding CPUs etc apply...
"Win32Services new openURIOrPath:'http://www.yahoo.com/'"
| shellString |
shellString := uriOrPath , 0 asCharacter.
^self apiShellExecute: 0 with: 'open' with: shellString with: nil with:
nil with: 1
apiShellExecute: aWindowHandle with: aCmdString with: target with: para
with: dir with: flag
<apicall: long 'ShellExecuteA' (ulong char* char* char* char* long)
More information about the Squeak-dev