execfile with maximize?

BlitzPlus Forums/BlitzPlus Programming/execfile with maximize?

sswift(Posted 2005) [#1]
I'm trying to open a browser window with execfile, but when I do and another browser window is open, the behavior is erratic. Even if I minimize my window before calling execfile, the browser doesn't neccessarily bring itself to the front (the blitz IDE may be in front for example) and it doesn't neccessarily display the window that just opened my page.

Does anyone know a more reliable way to do this? (without creating a window with an html gadget!)


SebHoll(Posted 2005) [#2]
Hi.
This is how I did it... (Including Sample Code)

site$ = "http://www.yahoo.co.uk/"
iexplorerpath$ = GetEnv$("PROGRAMFILES")+"\Internet Explorer\IEXPLORE.EXE"
ExecFile( Chr$(34) + iexplorerpath$ + Chr$(34) + " -new " + Chr$(34) + site$ + Chr$(34))
WaitKey()
End


This will only work with Internet Explorer and also will only work if Internet Explorer is installed in the default location. (99.999999% of cases it is.) Incase you were wondering the "Chr$(34)" command puts in a speech mark into the string incase the path has spaces in it. Just change the site$ string to whatever you want. ;D

Hope this helps

Seb


BlitzSupport(Posted 2005) [#3]
If you combine Seb's IE path thing with this code you should get what you want.

Using the ShellExecute command from shell32.dll (obviously need to create a .decls for it) lets you choose flags that specify how the program should open. Should be easy enough to get going -- usage should be something like:

Const SW_SHOWMAXIMIZED = 3

ShellExecute (0, "open", iepath$, "http://news.bbc.co.uk/", "", SW_SHOWMAXIMIZED)



Arem(Posted 2005) [#4]
Internet Explorer? What's Internet Explorer? GET FIREFOX ALREADY!


Bot Builder(Posted 2005) [#5]
Yeah, that code snippit would make more sense if ExecFile was DeleteFile....