Results 1 to 9 of 9

Thread: I need a fresh pair of eyes

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Resolved I need a fresh pair of eyes

    Hi,

    I'm now using

    VB Code:
    1. For loopy = 1 To number
    2. ShellExecute Me.hwnd, vbNullString, "C:\WINDOWS\explorer.exe", site, vbNullString, SW_MAXIMISE
    3. 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:
    1. For loopy = 1 To number
    2. runner = Shell("C:\WINDOWS\EXPLORER.EXE " & site, [B]vbMaximizedFocus[/B])
    3. 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 ?) 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
    Last edited by intraman; Jun 7th, 2006 at 05:43 PM. Reason: Not resolved

  2. #2
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: I need a fresh pair of eyes

    Try ShellExecute with SW_MAXIMIZE

  3. #3
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    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:
    1. Shell "C:\Program Files\Internet Explorer\iexplore.exe http://www.google.com", vbMaximizedFocus
    CS

  4. #4
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: I need a fresh pair of eyes

    I recommand ShellExecute as schoolbusdriver said. you no need to specify the path for internet explorer.
    CS

  5. #5
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: I need a fresh pair of eyes

    Not sure why
    VB Code:
    1. Shell "iexplore.exe http://www.google.co.in/", vbMaximizedFocus
    doesn't work. But in run dialog
    VB Code:
    1. "iexplore.exe http://www.google.co.in/"
    it works.
    CS

  6. #6
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    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.....
    Last edited by schoolbusdriver; Jun 7th, 2006 at 04:46 PM.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    266

    Re: I need a fresh pair of eyes

    Cheers guys, rated you all

  8. #8
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: I need a fresh pair of eyes

    Quote Originally Posted by cssriraman
    Not sure why
    VB Code:
    1. Shell "iexplore.exe http://www.google.co.in/", vbMaximizedFocus
    doesn't work. But in run dialog
    VB Code:
    1. "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...

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width