Results 1 to 6 of 6

Thread: Maxmising window

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    India
    Posts
    85

    Exclamation

    I am having an application which creates an instance of IE using the create object method when clicked on a button.
    If the user clicks on the button an instance of IE is created and it is opened by using the visible property.
    When the user minimise the window and works on the application and at a later time clicks on the button again it should open the existing instance of IE and maximise it.
    When I use the window handle and make it visible it works fine if the existing IE window is already in maximised state. but if the existing window is in minimised state then seting the visible property is not working.it just sets the focus to the window but it is still minimised.
    I tried to user the Sendmessage API call but it returns 0 and is not successful.
    Please help

    Thanks in advance
    Ramdas

  2. #2
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Question

    I'm not sure what you are trying to do, but it seems complicated.

    All i usually do is:

    Code:
    Public Sub Command1_Click()
        Shell "C:\Program Files\Plus!\IExplore.exe", vbMaximisedFocus
    End Sub
    That starts an instance of IE in the maximized state with the focus set to it.

    Maybe you are looking for something different, but maybe this helps

    r0ach™
    Don't forget to rate the post

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    India
    Posts
    85
    on command click I was able to open IE but I need to hanlde the new IE window.
    If the user minimises the IE that is opened and again click on the command button I need to maximise the IE that is already available rather than creating a new IE window.

    Thanks
    Ramdas

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    India
    Posts
    85
    Any Help???????????

    Ramdas

  5. #5
    New Member
    Join Date
    May 2000
    Posts
    5
    What you need is ShowWindow. Using something like SetForeGroundWindow or simply setting the focus to the window with SendMessage will only select the minimized window, but won't maximize it.

    Public Const SW_MAXIMIZE = 3
    Public Const SW_NORMAL = 1

    Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

    Pass the handle of your instance of IE to the hwnd parameter and use one of the SW_ constants for nCmdShow.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    India
    Posts
    85
    Thanks TomIrvine
    It was bugging me for lat two days. I am not much used to API's. It worked fine.

    Thanks a lot.

    Ramdas

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