I need a fresh pair of eyes
Hi,
I'm now using
VB Code:
For loopy = 1 To number
ShellExecute Me.hwnd, vbNullString, "C:\WINDOWS\explorer.exe", site, vbNullString, SW_MAXIMISE
Next loopy
However, it is launching the websites fine but is not maximising them - any ideas?
Jord
--------------------------------------------------
...and not for myself ;)
I'm opening up websites using explorer.exe and passing the website as a parameter to the executable. I wish to maximise each window that I open, however, the following code does not maximise any windows.
VB Code:
For loopy = 1 To number
runner = Shell("C:\WINDOWS\EXPLORER.EXE " & site, [B]vbMaximizedFocus[/B])
Next loopy
I thought vbMaximizedFocus was suppoed to maximise the window, then I thought that perhaps the fact that the windows are opening iterationally (is that a word :p ?) could cause the window to lose focus before the command can be applied or some other such complication.
Does anyone have any idea why the windows are maximising themselves and if there are any other ways I could maximise them instead.
Jord
Re: I need a fresh pair of eyes
Try ShellExecute with SW_MAXIMIZE
Re: I need a fresh pair of eyes
Not sure why you are opening the web pages in windows explorer. Try open with Internet explorer. The following code opens the web page in maximized mode:
VB Code:
Shell "C:\Program Files\Internet Explorer\iexplore.exe http://www.google.com", vbMaximizedFocus
Re: I need a fresh pair of eyes
I recommand ShellExecute as schoolbusdriver said. you no need to specify the path for internet explorer.
Re: I need a fresh pair of eyes
Not sure why
VB Code:
Shell "iexplore.exe http://www.google.co.in/", vbMaximizedFocus
doesn't work. But in run dialog
VB Code:
"iexplore.exe http://www.google.co.in/"
it works.
Re: I need a fresh pair of eyes
I've not tried this, but if you do:-
Shell("C:\WINDOWS\EXPLORER.EXE", vbMaximizedFocus)
i.e. not specifying the site, does it work ?
EDIT:- Yes it does. Might be the asynchronous problems associated with Shell() ?
Better to use ShellExecute.....
Re: I need a fresh pair of eyes
Cheers guys, rated you all
Re: I need a fresh pair of eyes
Quote:
Originally Posted by cssriraman
Not sure why
VB Code:
Shell "iexplore.exe http://www.google.co.in/", vbMaximizedFocus
doesn't work. But in run dialog
VB Code:
"iexplore.exe http://www.google.co.in/"
it works.
interesting.
im getting the same here.
perhaps the run box gets extra paths?
maybe these two have something to do with it?
C:\WINDOWS\Prefetch\iexplore.exe-27122324.pf
C:\WINDOWS\system32\dllcache\iexplore.exe
i wonder what method the run box uses...
Re: I need a fresh pair of eyes
I believe you need to put quote marks around the URL. But I also recommend ShellExecute'ing just the URL as that opens it in the default browser (the registered HTTP handler on the system).
Prefetch is just a mechanism Windows uses behind the scenes to speed up starting applications. Ignore it.