Results 1 to 3 of 3

Thread: Why SW_ - params in ShelExecute() not work

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Posts
    4

    Question

    Please, help! I must work with IExplorer at "background" (minimized). But if I use ShellExecute() as ShellExecute(hWindow, vbNullString, strURL,"", "", SW_MINIMIZE) it don't minimize IE-window. I check aslo SW_SHOWMINNOACTIVE and SW_SHOWMAXIMIZED and all others. But without result
    My code:
    Private Sub Form_Activate()
    'I need open IE automaticaly at the beginning time of my application. I use Shell(). And I don't need IE "small window" (with version number etc.) splashing so I use SetWindowPos()
    lngOnTop = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, (SWP_NOMOVE Or SWP_NOSIZE))
    lngProcessID = Shell(strIEPath & " " & strURL_1, vbMinimizedNoFocus) 'it's WORK. IE minimized
    lngOnTop = SetWindowPos(Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, (SWP_NOMOVE Or SWP_NOSIZE))

    'Now Timer begin work for checking URL errors as "404", "Cannot find server" etc.
    Private Sub tmrTimer_Timer()
    'I get handle of IE-window - hWindow
    'I get it's Title.
    'If there are "HTTP 404" or "Cannot find server" in the Title so I need to change URL at the same instance of IE
    lngReturnValue = ShellExecute(hWindow, vbNullString, strURL_2, "", "", SW_MINIMIZE)
    And at this time I see that IE window opens from TaskBar. Why??? I check ALL SW_... but without triumph

  2. #2
    Guest
    Have you got all the SW_ constants?

    Code:
    Const SW_HIDE = 0
    Const SW_MAXIMIZE = 3
    Const SW_MINIMIZE = 6
    Const SW_RESTORE = 9
    Const SW_SHOW = 5
    Const SW_SHOWMAXIMIZED = 3
    Const SW_SHOWMINIMIZED = 2
    Const SW_SHOWMINNOACTIVE = 7
    Const SW_SHOWNA = 8
    Const SW_SHOWNOACTIVATE = 4
    Const SW_SHOWNORMAL = 1

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Posts
    4
    Yes, ALL of 11 SW_...

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