Results 1 to 7 of 7

Thread: Open IE with shellexecute as HIDEN window

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    6
    I use sellexecute to open .HTML file with IE, but no matter what nShowCmd code I use it opens in NORMAL mode.
    Can someone help?

    Thanks
    ........

    Public Declare Function ShellExecute Lib "shell32.dll" Alias _
    "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, ByVal _
    lpDirectory As String, ByVal nShowCmd As Long) As Long

    res = ShellExecute(0&, vbNullString, "proba.htm", vbNullString, vbNullString, SW_HIDE)

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    6

    Nothing works

    [/code] [/B][/QUOTE]
    Nothing works.

  3. #3
    Junior Member
    Join Date
    Aug 2000
    Posts
    27
    Private Declare Function GetModuleUsage Lib "Kernel32" Alias _
    "GetModuleUsage" (ByVal hModule As Integer) As Integer
    Private Const SW_HIDE = 0 '// Normal Window
    Private Const SW_NORMAL = 1 '// Maximized Window
    Private Const SW_MAXIMIZE = 3 '// Minimized Window
    Private Const SW_MINIMIZE = 6 '// Hidden Window

  4. #4
    Guest

    Re: Nothing works

    Originally posted by stipsa
    [/code]
    Nothing works. [/B][/QUOTE]

    You sure? I tried my method and it worked fine for me. (Remember to add a Button to the Form then place the code into it).

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    6

    Re: Re: Nothing works

    I have VB6 SP4. You're method works fine for text documents, but not HTML and IE.
    I also need to open file from module, not form, but that could be arranged if it works on form.
    Maybe IE is forcing documents to open in normal mode, I don't know?

    Thanks for trying.

  6. #6
    Guest
    How about this:
    Code:
    Shell "C:\Program Files\Internet Explorer\IExplore.exe C:\MyHtml.html", vbNormalFocus

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    6

    It works!

    Yes, that works.
    I guess I didn't want to specify path to IEXPLORE and it doesn't work without it.
    Thanks.

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